summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/session/session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 67e7ee39001..32c987cc5d9 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1659,8 +1659,10 @@ session_transport_close (session_t * s)
{
if (s->session_state == SESSION_STATE_TRANSPORT_CLOSED)
session_set_state (s, SESSION_STATE_CLOSED);
- /* If transport is already deleted, just free the session */
- else if (s->session_state >= SESSION_STATE_TRANSPORT_DELETED)
+ /* If transport is already deleted, just free the session. Half-opens
+ * expected to be already cleaning up at this point */
+ else if (s->session_state >= SESSION_STATE_TRANSPORT_DELETED &&
+ !(s->flags & SESSION_F_HALF_OPEN))
session_program_cleanup (s);
return;
}