]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG: stream_sock: si->release was not called upon shutw()
authorWilly Tarreau <w@1wt.eu>
Sat, 10 Mar 2012 12:42:32 +0000 (13:42 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 10 Mar 2012 12:42:32 +0000 (13:42 +0100)
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

index 8c9f765e53f7a6653db275df0e32865678fc9848..44d9e113a1df1217deac369ba4790e1d20424260 100644 (file)
@@ -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);
 }
 
 /*