From: Christopher Faulet Date: Wed, 31 Oct 2018 07:53:54 +0000 (+0100) Subject: MINOR: conn_stream: Add a flag to notify the SI some data were received X-Git-Tag: v1.9-dev7~76 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=effc3750cc082ae0f1aefea1ade244d34a466b30;p=thirdparty%2Fhaproxy.git MINOR: conn_stream: Add a flag to notify the SI some data were received The flag CS_FL_READ_PARTIAL can be set by the mux on the conn_stream to notify the stream interface that some data were received. Is is used in si_cs_recv to re-arm read timeout on the channel. --- diff --git a/include/types/connection.h b/include/types/connection.h index 72562194dc..dbf985be9c 100644 --- a/include/types/connection.h +++ b/include/types/connection.h @@ -82,7 +82,11 @@ enum { CS_FL_REOS = 0x00002000, /* End of stream received (buffer not empty) */ CS_FL_WAIT_FOR_HS = 0x00010000, /* This stream is waiting for handhskae */ - CS_FL_NOT_FIRST = 0x00100000, /* This stream is not the first one */ + /* following flags are supposed to be set by the mux and read/unset by + * the stream-interface : + */ + CS_FL_NOT_FIRST = 0x00100000, /* this stream is not the first one */ + CS_FL_READ_PARTIAL = 0x00200000, /* some data were received (not necessarly xferred) */ }; /* cs_shutr() modes */ diff --git a/src/stream_interface.c b/src/stream_interface.c index 3c7284f6c9..1f82959523 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1217,6 +1217,12 @@ int si_cs_recv(struct conn_stream *cs) if (cs->flags & CS_FL_RCV_MORE) si_rx_room_blk(si); + if (cs->flags & CS_FL_READ_PARTIAL) { + if (tick_isset(ic->rex)) + ic->rex = tick_add_ifset(now_ms, ic->rto); + cs->flags &= ~CS_FL_READ_PARTIAL; + } + if (ret <= 0) { break; }