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.
This commit is contained in:
Christopher Faulet 2018-10-31 08:53:54 +01:00 committed by Willy Tarreau
parent 27a3dc8fb2
commit effc3750cc
2 changed files with 11 additions and 1 deletions

View File

@ -82,7 +82,11 @@ enum {
CS_FL_REOS = 0x00002000, /* End of stream received (buffer not empty) */ 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_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 */ /* cs_shutr() modes */

View File

@ -1217,6 +1217,12 @@ int si_cs_recv(struct conn_stream *cs)
if (cs->flags & CS_FL_RCV_MORE) if (cs->flags & CS_FL_RCV_MORE)
si_rx_room_blk(si); 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) { if (ret <= 0) {
break; break;
} }