From 1a9db7c0d76b53d82144915ded6733d84d1756fa Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 25 Jun 2020 15:36:45 +0200 Subject: [PATCH] BUG/MINOR: http-ana: Set CF_EOI on response channel for generated responses 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/http_ana.c b/src/http_ana.c index 7c362933e..844da4995 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -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); -- 2.47.3