]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: compression: pass the channel to http_compression_buffer_end()
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Jun 2018 05:15:47 +0000 (07:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Jul 2018 14:23:39 +0000 (16:23 +0200)
This will be needed to access the output data count from the channel
after the buffer/channel changes.

src/flt_http_comp.c

index 99a767c926c663a788991860a04946bc37575c9f..ca2ab7cde2fa0f0a465d5a7024db0a92c58abc2f 100644 (file)
@@ -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;