From: Olivier Houchard Date: Thu, 13 Dec 2018 14:38:16 +0000 (+0100) Subject: BUG/MEDIUM: stream_interface: Don't report read0 if we were not connected. X-Git-Tag: v1.9-dev11~68 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fd0c2dcf0052c46ca8790ceb0a2309cdb555140c;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stream_interface: Don't report read0 if we were not connected. 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. --- diff --git a/src/stream_interface.c b/src/stream_interface.c index 81e1778eab..ae9a76f744 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -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; }