BUG/MINOR: mux-fcgi: Set conn state to RECORD_P when skipping the record padding
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 15 Jul 2020 13:55:52 +0000 (15:55 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 17 Jul 2020 08:27:57 +0000 (10:27 +0200)
When the padding of a "stream" record (STDOUT or STDERR) is skipped, we must set
the connection state to RECORD_P. It is especially important if the padding is
not fully received.

This patch must be backported as far as 2.1.

(cherry picked from commit 6c99d3baeabef9aa3a798b2251215f1026b48751)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 82cffcd95ae7dc81387344e69432c1776d02102c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

src/mux_fcgi.c

index 30cefa7..57cfdf8 100644 (file)
@@ -2312,6 +2312,7 @@ static int fcgi_strm_handle_stdout(struct fcgi_conn *fconn, struct fcgi_strm *fs
                goto fail;
 
   end_transfer:
+       fconn->state = FCGI_CS_RECORD_P;
        fconn->drl += fconn->drp;
        fconn->drp = 0;
        ret = MIN(b_data(&fconn->dbuf), fconn->drl);
@@ -2396,6 +2397,7 @@ static int fcgi_strm_handle_stderr(struct fcgi_conn *fconn, struct fcgi_strm *fs
                goto fail;
 
   end_transfer:
+       fconn->state = FCGI_CS_RECORD_P;
        fconn->drl += fconn->drp;
        fconn->drp = 0;
        ret = MIN(b_data(&fconn->dbuf), fconn->drl);