From ad4cd589865d4f79d5ff1f068f40ff4c488077cd Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 10 Mar 2012 13:42:32 +0100 Subject: [PATCH] BUG: stream_sock: si->release was not called upon shutw() The ->release function of the stream interface is never called upon a shutw() because it's placed after a return statement. It is possible that it has impacted inter-process stick-table replication by preventing a full resync after certain sequences of connection breakage. Since this bug has been present since the introduction of the ->release() callback, it cannot have caused regressions, just possibly non-working situations. This was detected at Exceliance by Emeric Brun during a code review. It is 1.5-specific. --- src/stream_sock.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/stream_sock.c b/src/stream_sock.c index 8c9f765e53..44d9e113a1 100644 --- a/src/stream_sock.c +++ b/src/stream_sock.c @@ -885,16 +885,15 @@ void stream_sock_shutw(struct stream_interface *si) case SI_ST_QUE: case SI_ST_TAR: si->state = SI_ST_DIS; + + if (si->release) + si->release(si); default: si->flags &= ~SI_FL_WAIT_ROOM; si->ib->flags |= BF_SHUTR; si->ib->rex = TICK_ETERNITY; si->exp = TICK_ETERNITY; - return; } - - if (si->release) - si->release(si); } /* -- 2.39.5