]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stream_interface: Don't report read0 if we were not connected.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 13 Dec 2018 14:38:16 +0000 (15:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Dec 2018 16:32:15 +0000 (17:32 +0100)
In si_cs_recv(), report that arrive at the end of stream only if we were
indeed connected, we don't want that if the connection failed and we're about
to retry.

src/stream_interface.c

index 81e1778eab98f20433527ccf7efe95f8c12f1ec0..ae9a76f744a5f044e290659b14d2ab2c57a32469 100644 (file)
@@ -1340,11 +1340,13 @@ int si_cs_recv(struct conn_stream *cs)
        return (cur_read != 0) || si_rx_blocked(si);
 
  out_shutdown_r:
-       /* we received a shutdown */
-       ic->flags |= CF_READ_NULL;
-       if (ic->flags & CF_AUTO_CLOSE)
-               channel_shutw_now(ic);
-       stream_sock_read0(si);
+       if (conn->flags & CO_FL_CONNECTED) {
+               /* we received a shutdown */
+               ic->flags |= CF_READ_NULL;
+               if (ic->flags & CF_AUTO_CLOSE)
+                       channel_shutw_now(ic);
+               stream_sock_read0(si);
+       }
        return 1;
 }