]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: mux-fcgi: Stop sending loop if FCGI stream is blocked for any reason
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 19 May 2020 13:13:00 +0000 (15:13 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 19 May 2020 14:00:55 +0000 (16:00 +0200)
Because of a typo error in conditions to exit the sending loop, it is possible
to loop infinitely in fcgi_snd_buf() function. Instead of checking the FCGI
stream is not blocked to continue sending data, the FCGI connection is used. So
it is possible to have a stream blocked because there is not enough space in the
mux buffers to copy more data but continue to loop to send more data.

This patch should fix the issue #637. It must be backported to 2.1.

src/mux_fcgi.c

index 5685ba9c447da9155cc40e02feef8ebe8c2ec2a2..d1db2a011a1ca92ee46bec02681b0132b59eaea6 100644 (file)
@@ -3931,7 +3931,7 @@ static size_t fcgi_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t co
        if (!(fstrm->flags & FCGI_SF_OUTGOING_DATA) && count)
                fstrm->flags |= FCGI_SF_OUTGOING_DATA;
 
-       while (fstrm->state < FCGI_SS_HLOC && !(fconn->flags & FCGI_SF_BLK_ANY) &&
+       while (fstrm->state < FCGI_SS_HLOC && !(fstrm->flags & FCGI_SF_BLK_ANY) &&
               count && !htx_is_empty(htx)) {
                blk = htx_get_head_blk(htx);
                ALREADY_CHECKED(blk);