From 4d452384a37f8fc2919a58f3134938df53e93ae8 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 6 Jun 2018 07:15:47 +0200 Subject: [PATCH] MINOR: compression: pass the channel to http_compression_buffer_end() This will be needed to access the output data count from the channel after the buffer/channel changes. --- src/flt_http_comp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index 99a767c92..ca2ab7cde 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -61,7 +61,7 @@ static int http_compression_buffer_add_data(struct comp_state *st, struct buffer *in, struct buffer *out, int sz); static int http_compression_buffer_end(struct comp_state *st, struct stream *s, - struct buffer **in, struct buffer **out, + struct channel *chn, struct buffer **out, int end); /***********************************************************************/ @@ -306,7 +306,7 @@ comp_http_forward_data(struct stream *s, struct filter *filter, st->consumed = len - st->hdrs_len - st->tlrs_len; b_adv(msg->chn->buf, flt_rsp_fwd(filter) + st->hdrs_len); - ret = http_compression_buffer_end(st, s, &msg->chn->buf, &zbuf, msg->msg_state >= HTTP_MSG_TRAILERS); + ret = http_compression_buffer_end(st, s, msg->chn, &zbuf, msg->msg_state >= HTTP_MSG_TRAILERS); b_rew(msg->chn->buf, flt_rsp_fwd(filter) + st->hdrs_len); if (ret < 0) return ret; @@ -666,10 +666,10 @@ http_compression_buffer_add_data(struct comp_state *st, struct buffer *in, */ static int http_compression_buffer_end(struct comp_state *st, struct stream *s, - struct buffer **in, struct buffer **out, + struct channel *chn, struct buffer **out, int end) { - struct buffer *ib = *in, *ob = *out; + struct buffer *ib = chn->buf, *ob = *out; char *tail; int to_forward, left; @@ -774,7 +774,7 @@ http_compression_buffer_end(struct comp_state *st, struct stream *s, } /* swap the buffers */ - *in = ob; + chn->buf = ob; *out = ib;