mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
BUG/MEDIUM: compression: release the zlib pools between keep-alive requests
There was a possible memory leak in the zlib code when the first response of a keep-alive session was compressed, because the next request would reset the compression algo, preventing a later call to session_free() from releasing it. The reason is that it is necessary to release the assigned resources in http_end_txn_clean_session().
This commit is contained in:
parent
ec3e3890f0
commit
543db62e1f
@ -4085,6 +4085,12 @@ void http_end_txn_clean_session(struct session *s)
|
||||
s->rep->flags &= ~(CF_SHUTR|CF_SHUTR_NOW|CF_READ_ATTACHED|CF_READ_ERROR|CF_READ_NOEXP|CF_STREAMER|CF_STREAMER_FAST|CF_WRITE_PARTIAL|CF_NEVER_WAIT);
|
||||
s->flags &= ~(SN_DIRECT|SN_ASSIGNED|SN_ADDR_SET|SN_BE_ASSIGNED|SN_FORCE_PRST|SN_IGNORE_PRST);
|
||||
s->flags &= ~(SN_CURR_SESS|SN_REDIRECTABLE);
|
||||
|
||||
if (s->flags & SN_COMP_READY)
|
||||
s->comp_algo->end(&s->comp_ctx);
|
||||
s->comp_algo = NULL;
|
||||
s->flags &= ~SN_COMP_READY;
|
||||
|
||||
s->txn.meth = 0;
|
||||
http_reset_txn(s);
|
||||
s->txn.flags |= TX_NOT_FIRST | TX_WAIT_NEXT_RQ;
|
||||
|
@ -565,11 +565,10 @@ static void session_free(struct session *s)
|
||||
sess_change_server(s, NULL);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (s->req->pipe)
|
||||
put_pipe(s->req->pipe);
|
||||
|
Loading…
x
Reference in New Issue
Block a user