From: Willy Tarreau Date: Wed, 29 Dec 2010 13:03:02 +0000 (+0100) Subject: [CRITICAL] session: correctly leave turn-around and queue states on abort X-Git-Tag: v1.5-dev8~340 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32d3ee99eebe296a7addeb311e3e008f66803769;p=thirdparty%2Fhaproxy.git [CRITICAL] session: correctly leave turn-around and queue states on abort When a client connection aborts while the server-side connection is in turn-around after a failed connection attempt, the turn-around timeout is reset in shutw() but the state is not changed. The session then remains stuck in this state forever. Change the QUE and TAR states to DIS just as we do for CER to fix this. This patch should be backported to 1.4. --- diff --git a/src/stream_interface.c b/src/stream_interface.c index aae602ec54..e93048e8db 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -226,6 +226,8 @@ void stream_int_shutw(struct stream_interface *si) /* fall through */ case SI_ST_CON: case SI_ST_CER: + case SI_ST_QUE: + case SI_ST_TAR: si->state = SI_ST_DIS; /* fall through */ diff --git a/src/stream_sock.c b/src/stream_sock.c index b9b55b7406..25573cb6f6 100644 --- a/src/stream_sock.c +++ b/src/stream_sock.c @@ -873,6 +873,8 @@ void stream_sock_shutw(struct stream_interface *si) fd_delete(si->fd); /* fall through */ case SI_ST_CER: + case SI_ST_QUE: + case SI_ST_TAR: si->state = SI_ST_DIS; default: si->flags &= ~SI_FL_WAIT_ROOM;