]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: conn_stream: Add a flag to notify the SI some data were received
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 31 Oct 2018 07:53:54 +0000 (08:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 18 Nov 2018 20:45:49 +0000 (21:45 +0100)
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.

include/types/connection.h
src/stream_interface.c

index 72562194dc0d35249c2fdd5ee462da4369f6f94c..dbf985be9c63314011ac7885ed90ff13541a4b82 100644 (file)
@@ -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 */
index 3c7284f6c98a9049e7b67159fdd4963b1dcf9b5c..1f82959523db64f22ec8b3601e6df563e4c5cf79 100644 (file)
@@ -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;
                }