]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-ana: Don't wait to send 1xx responses generated by HAProxy
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 25 Jun 2020 13:55:11 +0000 (15:55 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 25 Jun 2020 19:50:20 +0000 (21:50 +0200)
When an informational response (1xx) is returned by HAProxy, we must be sure to
send it ASAP. To do so, CF_SEND_DONTWAIT flag must be set on the response
channel to instruct the stream-interface to not set the CO_SFL_MSG_MORE flag on
the transport layer. Otherwise the response delivery may be delayed, because of
the commit 8945bb6c0 ("BUG/MEDIUM: stream-int: fix loss of CO_SFL_MSG_MORE flag
in forwarding").

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 844da4995a4d256b4703fd0bab93f1ff245d3b85..28377d6f37e733b15206cb1043c660d6b0abd573 100644 (file)
@@ -4575,6 +4575,12 @@ int http_forward_proxy_resp(struct stream *s, int final)
                channel_shutr_now(res);
                res->flags |= CF_EOI; /* The response is terminated, add EOI */
        }
+       else {
+               /* Send ASAP informational messages. Rely on CF_EOI for final
+                * response.
+                */
+               res->flags |= CF_SEND_DONTWAIT;
+       }
 
        data = htx->data - co_data(res);
        c_adv(res, data);