]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Handle read0 during TCP splicing
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 17 Apr 2019 09:03:22 +0000 (11:03 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 17 Apr 2019 12:52:31 +0000 (14:52 +0200)
It avoids a roundtrip with underlying I/O callbacks to do so. If a read0 is
handled at the end of h1_rcv_pipe(), the flag CS_FL_REOS is set on the
conn_stream. And if there is no data in the pipe, the flag CS_FL_EOS is also
set.

This path may be backported to 1.9.

src/mux_h1.c

index c820ebe3cc7e9f562ef12db26f7f0bdcd154553a..b854fb232271911fb6d5a9c9d1e3bf7df3f44d81 100644 (file)
@@ -2318,6 +2318,11 @@ static int h1_rcv_pipe(struct conn_stream *cs, struct pipe *pipe, unsigned int c
        }
 
   end:
+       if (conn_xprt_read0_pending(cs->conn)) {
+               cs->flags |= CS_FL_REOS;
+               if (!pipe->data)
+                       cs->flags |= CS_FL_EOS;
+       }
        return ret;
 }