From: Willy Tarreau Date: Sat, 29 Dec 2012 23:50:35 +0000 (+0100) Subject: BUG/MINOR: http: don't process abortonclose when request was sent X-Git-Tag: v1.5-dev18~138 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a7a7ebc38280d7a04192bf95e6852222f4bd8140;p=thirdparty%2Fhaproxy.git BUG/MINOR: http: don't process abortonclose when request was sent option abortonclose may cause a valid connection to be aborted just after the request has been sent. This is because we check for it during the session establishment sequence before checking for write activity. So if the abort and the connect complete at the same time, the abort is still considered. Let's check for an explicity partial write before aborting. This fix should be backported to 1.4 too. --- diff --git a/src/session.c b/src/session.c index 02632bf8b3..fbb130bad1 100644 --- a/src/session.c +++ b/src/session.c @@ -815,7 +815,8 @@ static int sess_update_st_con_tcp(struct session *s, struct stream_interface *si } /* OK, maybe we want to abort */ - if (unlikely((rep->flags & CF_SHUTW) || + if (!(req->flags & CF_WRITE_PARTIAL) && + unlikely((rep->flags & CF_SHUTW) || ((req->flags & CF_SHUTW_NOW) && /* FIXME: this should not prevent a connection from establishing */ ((!(req->flags & CF_WRITE_ACTIVITY) && channel_is_empty(req)) || s->be->options & PR_O_ABRT_CLOSE)))) {