]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http: deinitialize compression after a parsing error
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Apr 2014 09:00:13 +0000 (11:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Apr 2014 21:15:28 +0000 (23:15 +0200)
When a parsing error was encountered in a chunked response, we failed
to properly deinitialize the compression context. There was no impact
till now since compression of chunked responses was disabled. No backport
is needed.

src/proto_http.c

index 8c54433927b4fcdd0445f2f722d6de0599b1e79c..ff0a6620302c4968ae54bd6de487d86ba26f01cb 100644 (file)
@@ -6414,6 +6414,11 @@ int http_response_forward_body(struct session *s, struct channel *res, int an_bi
                objt_server(s->target)->counters.failed_resp++;
 
  return_bad_res_stats_ok:
+       if (unlikely(compressing)) {
+               http_compression_buffer_end(s, &res->buf, &tmpbuf, 0);
+               compressing = 0;
+       }
+
        txn->rsp.msg_state = HTTP_MSG_ERROR;
        /* don't send any error message as we're in the body */
        stream_int_retnclose(res->cons, NULL);