tls: fix session state update on accept
Only set state to ready if session is not already closing.
Type: fix
Change-Id: Ic95667f43ed09d693f1cf7c9f1c16f7f995ea2d8
Signed-off-by: Florin Coras <fcoras@cisco.com>
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index 6129b09..5f00e6e 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -501,7 +501,6 @@
ctx->c_s_index = SESSION_INVALID_INDEX;
ctx->c_thread_index = ts->thread_index;
ctx->tls_ctx_handle = ctx_handle;
- ts->session_state = SESSION_STATE_READY;
ts->opaque = ctx_handle;
ctx->tls_session_handle = session_handle (ts);
ctx->listener_ctx_index = tls_listener->opaque;
@@ -518,6 +517,9 @@
tls_disconnect_transport (ctx);
}
+ if (ts->session_state < SESSION_STATE_READY)
+ ts->session_state = SESSION_STATE_READY;
+
return 0;
}