From 3499f62b59eb9ce0adeb17e6ceffc57a43893ae9 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 3 Sep 2019 15:23:54 +0200 Subject: [PATCH] BUG/MINOR: http-ana: Reset response flags when 1xx messages are handled 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http_ana.c b/src/http_ana.c index b2069e3ea..eef0c09ca 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -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;