]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: filters/http: Forward remaining data when a channel has no "data" filters
authorChristopher Faulet <cfaulet@qualys.com>
Tue, 15 Dec 2015 09:41:47 +0000 (10:41 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 9 Feb 2016 13:53:15 +0000 (14:53 +0100)
This is an improvement, especially when the message body is big. Before this
patch, remaining data were forwarded when there is no filter on the stream. Now,
the forwarding is triggered when there is no "data" filter on the channel. When
no filter is used, there is no difference, but when at least one filter is used,
it can be really significative.

src/proto_http.c

index cd3d406086c1d48254e70762fb88d92f4d4c96dc..fbed31e093061a661c4c7025bef22f52f45b9297 100644 (file)
@@ -6845,7 +6845,7 @@ http_msg_forward_body(struct stream *s, struct http_msg *msg)
        msg->next -= ret;
        if (!(chn->flags & CF_WROTE_DATA) || msg->sov > 0)
                msg->sov -= ret;
-       if (!HAS_FILTERS(s))
+       if (!HAS_DATA_FILTERS(s, chn))
                msg->chunk_len -= channel_forward(chn, msg->chunk_len);
   waiting:
        return 0;
@@ -6959,7 +6959,7 @@ http_msg_forward_chunked_body(struct stream *s, struct http_msg *msg)
        msg->next -= ret;
        if (!(chn->flags & CF_WROTE_DATA) || msg->sov > 0)
                msg->sov -= ret;
-       if (!HAS_FILTERS(s))
+       if (!HAS_DATA_FILTERS(s, chn))
                msg->chunk_len -= channel_forward(chn, msg->chunk_len);
   waiting:
        return 0;