]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-ana: Set CF_EOI on response channel for generated responses
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 25 Jun 2020 13:36:45 +0000 (15:36 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 25 Jun 2020 19:50:20 +0000 (21:50 +0200)
To be consistent with other processings on the channels, when HAProxy generates
a final response, the CF_EOI flag must be set on the response channel. This flag
is used to know that a full message was pushed into the channel (HTX messages
with an EOM block). It is used in conjunction with other channel's flags in
stream-interface functions. Especially when si_cs_send() is called, to know if
we must set or not the CO_SFL_MSG_MORE flag. Without CF_EOI, the CO_SFL_MSG_MORE
flag is always set and the message forwarding is delayed.

This patch may be backported as far as 1.9, for HTX part only. But this part has
changed in the 2.2, so it may be a bit tricky. Note it does not fix any known
bug on previous versions because the CO_SFL_MSG_MORE flag is ignored by the h1
mux.

src/http_ana.c

index 7c362933ecd422f1d572a4d33cb2d7bec1acc717..844da4995a4d256b4703fd0bab93f1ff245d3b85 100644 (file)
@@ -4573,6 +4573,7 @@ int http_forward_proxy_resp(struct stream *s, int final)
                channel_auto_read(res);
                channel_auto_close(res);
                channel_shutr_now(res);
+               res->flags |= CF_EOI; /* The response is terminated, add EOI */
        }
 
        data = htx->data - co_data(res);