CLEANUP: http: don't try to deinitialize http compression if it fails before init

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>
This commit is contained in:
Willy Tarreau 2013-01-24 15:58:42 +01:00
parent 8dc21faaf7
commit 192e59fb07

View 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;
}