]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG: compression: properly disable compression when content-type does not match
authorWilly Tarreau <w@1wt.eu>
Mon, 19 Nov 2012 13:55:02 +0000 (14:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 Nov 2012 13:55:02 +0000 (14:55 +0100)
Disabling compression based on the content-type was improperly done since the
introduction of the COMP_READY flag, sometimes resulting in truncated responses.

src/proto_http.c

index b2ae01cc1a989b18282639fd23585c108aecbfba..848e745c0d537698615ffdfac380fa76b3797c59 100644 (file)
@@ -2133,11 +2133,10 @@ int select_compression_response_header(struct session *s, struct buffer *res)
        return 1;
 
 fail:
-       if (s->flags & SN_COMP_READY) {
+       if (s->flags & SN_COMP_READY)
                s->comp_algo->end(&s->comp_ctx);
-               s->comp_algo = NULL;
-               s->flags &= ~SN_COMP_READY;
-       }
+       s->comp_algo = NULL;
+       s->flags &= ~SN_COMP_READY;
        return 0;
 }