]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-ana: Reset response flags when 1xx messages are handled
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 3 Sep 2019 13:23:54 +0000 (15:23 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 4 Sep 2019 08:29:55 +0000 (10:29 +0200)
Otherwise, the following final response could inherit of some of these
flags. For instance, because informational responses have no body, the flag
HTTP_MSGF_BODYLESS is set for 1xx messages. If it is not reset, this flag will
be kept for the final response.

One of visible effect of this bug concerns the HTTP compression. When the final
response is preceded by an 1xx message, the compression is not performed. This
was reported in github issue #229.

This patch must be backported to 2.0 and 1.9. Note that the file http_ana.c does
not exist for these branches, the patch must be applied on proto_htx.c instead.

src/http_ana.c

index b2069e3ead59e7bcde45ac76a1c6b0b6b5fb3882..eef0c09cacb7194a965c9f2c8f22cd8908c1921c 100644 (file)
@@ -1582,7 +1582,6 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
         * response which at least looks like HTTP. We have an indicator
         * of each header's length, so we can parse them quickly.
         */
-
        msg->msg_state = HTTP_MSG_BODY;
        BUG_ON(htx_get_first_type(htx) != HTX_BLK_RES_SL);
        sl = http_get_stline(htx);
@@ -1658,6 +1657,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
                FLT_STRM_CB(s, flt_http_reset(s, msg));
                htx->first = channel_htx_fwd_headers(rep, htx);
                msg->msg_state = HTTP_MSG_RPBEFORE;
+               msg->flags = 0;
                txn->status = 0;
                s->logs.t_data = -1; /* was not a response yet */
                goto next_one;