]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[CRITICAL] session: correctly leave turn-around and queue states on abort
authorWilly Tarreau <w@1wt.eu>
Wed, 29 Dec 2010 13:03:02 +0000 (14:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 29 Dec 2010 13:38:15 +0000 (14:38 +0100)
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.

src/stream_interface.c
src/stream_sock.c

index aae602ec54908efcf9b41357f1b9194a90dc8a1f..e93048e8db528496153dd844b9f4a058642ddba8 100644 (file)
@@ -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 */
 
index b9b55b740616845f33a5ec91f1cea446896c3a10..25573cb6f6c24e0b293312d356be1ff2cdb27a6b 100644 (file)
@@ -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;