]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http: don't process abortonclose when request was sent
authorWilly Tarreau <w@1wt.eu>
Sat, 29 Dec 2012 23:50:35 +0000 (00:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 29 Dec 2012 23:50:35 +0000 (00:50 +0100)
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.

src/session.c

index 02632bf8b3f4e4e8efb6cabaf19dff241bd2c15e..fbb130bad10bd6ef0983e708c318e199c8454e7b 100644 (file)
@@ -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)))) {