mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
MINOR: stconn/mux-h2: Use a iobuf flag to report EOI to consumer side during FF
IOBUF_FL_EOI iobuf flag is now set by the producer to notify the consumer that the end of input was reached. Thanks to this flag, we can remove the ugly ack in h2_done_ff() to test the opposite SE flags. Of course, for now, it works and it is good enough. But we must keep in mind that EOI is always forwarded from the producer side to the consumer side in this case. But if this change, a new CO_RFL_ flag will have to be added to instruct the producer if it can forward EOI or not.
This commit is contained in:
parent
4be0c7c655
commit
84d26bcf3f
@ -37,6 +37,7 @@ enum iobuf_flags {
|
||||
IOBUF_FL_INTERIM_FF = 0x00000008, /* Producer side warn it will immediately retry a fast-forward.
|
||||
* .done_fastfwd() on consumer side must take care of this flag
|
||||
*/
|
||||
IOBUF_FL_EOI = 0x00000010, /* A EOI was encountered on producer side */
|
||||
};
|
||||
|
||||
struct iobuf {
|
||||
|
@ -4720,6 +4720,11 @@ static int h1_fastfwd(struct stconn *sc, unsigned int count, unsigned int flags)
|
||||
|
||||
|
||||
sdo->iobuf.flags &= ~IOBUF_FL_INTERIM_FF;
|
||||
if (se_fl_test(h1s->sd, SE_FL_EOI)) {
|
||||
sdo->iobuf.flags |= IOBUF_FL_EOI; /* TODO: it may be good to have a flag to be sure we can
|
||||
* forward the EOI the to consumer side
|
||||
*/
|
||||
}
|
||||
se_done_ff(sdo);
|
||||
|
||||
ret = total;
|
||||
|
17
src/mux_h2.c
17
src/mux_h2.c
@ -7041,21 +7041,8 @@ static size_t h2_done_ff(struct stconn *sc)
|
||||
goto end;
|
||||
head = b_peek(mbuf, b_data(mbuf) - sd->iobuf.data);
|
||||
|
||||
/* FIXME: Must be handled with a flag. It is just a temporary hack */
|
||||
{
|
||||
struct xref *peer;
|
||||
struct sedesc *sdo;
|
||||
|
||||
peer = xref_get_peer_and_lock(&h2s->sd->xref);
|
||||
if (!peer)
|
||||
goto end;
|
||||
|
||||
sdo = container_of(peer, struct sedesc, xref);
|
||||
xref_unlock(&h2s->sd->xref, peer);
|
||||
|
||||
if (se_fl_test(sdo, SE_FL_EOI))
|
||||
h2s->flags &= ~H2_SF_MORE_HTX_DATA;
|
||||
}
|
||||
if (sd->iobuf.flags & IOBUF_FL_EOI)
|
||||
h2s->flags &= ~H2_SF_MORE_HTX_DATA;
|
||||
|
||||
if (!(sd->iobuf.flags & IOBUF_FL_FF_BLOCKED) &&
|
||||
!(h2s->flags & H2_SF_BLK_SFCTL) &&
|
||||
|
Loading…
Reference in New Issue
Block a user