mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-20 00:10:41 -05:00
CLEANUP: compression: Remove unused static buffers
Since the legacy HTTP code was removed, the global and thread-local buffers, tmpbuf and zbuf, are no longer used. So let's removed them. This could be backported, theorically to all supported versions. But at least it could be good to do so as far as 3.2 as it saves 2 buffers per-thread.
This commit is contained in:
parent
829002d459
commit
b248b1c021
1 changed files with 0 additions and 24 deletions
|
|
@ -44,9 +44,6 @@ struct comp_state {
|
|||
/* Pools used to allocate comp_state structs */
|
||||
DECLARE_STATIC_TYPED_POOL(pool_head_comp_state, "comp_state", struct comp_state);
|
||||
|
||||
static THREAD_LOCAL struct buffer tmpbuf;
|
||||
static THREAD_LOCAL struct buffer zbuf;
|
||||
|
||||
static int select_compression_request_header(struct comp_state *st,
|
||||
struct stream *s,
|
||||
struct http_msg *msg);
|
||||
|
|
@ -70,25 +67,6 @@ comp_flt_init(struct proxy *px, struct flt_conf *fconf)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
comp_flt_init_per_thread(struct proxy *px, struct flt_conf *fconf)
|
||||
{
|
||||
if (b_alloc(&tmpbuf, DB_PERMANENT) == NULL)
|
||||
return -1;
|
||||
if (b_alloc(&zbuf, DB_PERMANENT) == NULL)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
comp_flt_deinit_per_thread(struct proxy *px, struct flt_conf *fconf)
|
||||
{
|
||||
if (tmpbuf.size)
|
||||
b_free(&tmpbuf);
|
||||
if (zbuf.size)
|
||||
b_free(&zbuf);
|
||||
}
|
||||
|
||||
static int
|
||||
comp_strm_init(struct stream *s, struct filter *filter)
|
||||
{
|
||||
|
|
@ -789,8 +767,6 @@ htx_compression_buffer_end(struct comp_state *st, struct buffer *out, int end, i
|
|||
/***********************************************************************/
|
||||
struct flt_ops comp_ops = {
|
||||
.init = comp_flt_init,
|
||||
.init_per_thread = comp_flt_init_per_thread,
|
||||
.deinit_per_thread = comp_flt_deinit_per_thread,
|
||||
|
||||
.attach = comp_strm_init,
|
||||
.detach = comp_strm_deinit,
|
||||
|
|
|
|||
Loading…
Reference in a new issue