]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: http: don't try to deinitialize http compression if it fails before init
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2013 14:58:42 +0000 (15:58 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Jan 2013 15:19:19 +0000 (16:19 +0100)
In select_compression_response_header(), some tests are rather confusing
as the "fail" label is used to deinitialize the compression context for
the session while it's branched only before initialization succeeds. The
test is always false here and the dereferencing of the comp_algo pointer
which might be null is also confusing. Remove that code which is not needed
anymore since commit ec3e3890 got rid of the latest issues.

Reported-by: Dinko Korunic <dkorunic@reflected.net>
src/proto_http.c

index 3d68da89dde941b83f2f88b9b27ade0b60219ad7..da3935c3e371ecc9e0c86dc2e8a24aef32dcb463 100644 (file)
@@ -2028,7 +2028,6 @@ int select_compression_request_header(struct session *s, struct buffer *req)
        }
 
        s->comp_algo = NULL;
-
        return 0;
 }
 
@@ -2138,14 +2137,10 @@ int select_compression_response_header(struct session *s, struct buffer *res)
                trash.str[trash.len] = '\0';
                http_header_add_tail2(&txn->rsp, &txn->hdr_idx, trash.str, trash.len);
        }
-
        return 1;
 
 fail:
-       if (s->flags & SN_COMP_READY)
-               s->comp_algo->end(&s->comp_ctx);
        s->comp_algo = NULL;
-       s->flags &= ~SN_COMP_READY;
        return 0;
 }