From: Christopher Faulet Date: Fri, 19 Apr 2019 13:03:19 +0000 (+0200) Subject: BUG/MEDIUM: stream: Don't request a server connection if a shutw was scheduled X-Git-Tag: v2.0-dev3~209 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c54e4b053d46a2ee80da261bc48858165cbe2aaf;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stream: Don't request a server connection if a shutw was scheduled If a shutdown for writes was performed on the client side (CF_SHUTW is set on the request channel) while the server connection is still unestablished (the stream-int is in the state SI_ST_INI), then it is aborted. It must also be aborted when the shudown for write is pending (only CF_SHUTW_NOW is set). Otherwise, some errors on the request channel can be ignored, leaving the stream in an undefined state. This patch must be backported to 1.9. It may probably be backported to all suported versions, but it is unclear if the bug is visbile for older versions than 1.9. So it is probably safer to wait bug reports on these versions to backport this patch. --- diff --git a/src/stream.c b/src/stream.c index 3762f1bbdb..7740289452 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2267,7 +2267,7 @@ redo: * - the CF_AUTO_CONNECT flag is set (active connection) */ if (si_b->state == SI_ST_INI) { - if (!(req->flags & CF_SHUTW)) { + if (!(req->flags & (CF_SHUTW|CF_SHUTW_NOW))) { if ((req->flags & CF_AUTO_CONNECT) || !channel_is_empty(req)) { /* If we have an appctx, there is no connect method, so we * immediately switch to the connected state, otherwise we