]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stream-int: don't try to receive again after receiving an EOS
authorWilly Tarreau <w@1wt.eu>
Tue, 12 Dec 2017 08:58:40 +0000 (09:58 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Dec 2017 12:43:52 +0000 (13:43 +0100)
When an end of stream has been reported, we should not try to receive again
as the mux layer might not be prepared to this and could report unexpected
errors.

This is more of a strengthening measure that follows the introduction of
conn_stream that came in 1.8. It's desired to backport this into 1.8 though
it's uncertain at this time whether it may have caused real issues.

src/stream_interface.c

index cfd0b8e2ecca779e7446194ba519f0099ab49c67..9f61a7510589e79f225845de04f07fa34bab010f 100644 (file)
@@ -1176,7 +1176,7 @@ static void si_cs_recv_cb(struct conn_stream *cs)
         * recv().
         */
        while (!(conn->flags & (CO_FL_ERROR | CO_FL_SOCK_RD_SH | CO_FL_WAIT_ROOM | CO_FL_HANDSHAKE)) &&
-              !(cs->flags & CS_FL_ERROR) && !(ic->flags & CF_SHUTR)) {
+              !(cs->flags & (CS_FL_ERROR|CS_FL_EOS)) && !(ic->flags & CF_SHUTR)) {
                max = channel_recv_max(ic);
 
                if (!max) {