summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/session/session.c3
-rw-r--r--src/vnet/tls/tls.c12
2 files changed, 12 insertions, 3 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 97c9789f76f..14cd1f6507a 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -863,7 +863,8 @@ session_transport_delete_notify (transport_connection_t * tc)
/* Session was created but accept notification was not yet sent to the
* app. Cleanup everything. */
session_lookup_del_session (s);
- session_free_w_fifos (s);
+ segment_manager_dealloc_fifos (s->rx_fifo, s->tx_fifo);
+ session_free (s);
break;
case SESSION_STATE_ACCEPTING:
case SESSION_STATE_TRANSPORT_CLOSING:
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index 67807d36cc7..f2243e677b7 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -358,10 +358,18 @@ void
tls_session_reset_callback (session_t * s)
{
tls_ctx_t *ctx;
+ transport_connection_t *tc;
+ session_t *app_session;
ctx = tls_ctx_get (s->opaque);
- session_transport_reset_notify (&ctx->connection);
- session_transport_closed_notify (&ctx->connection);
+ tc = &ctx->connection;
+ if (tls_ctx_handshake_is_over (ctx))
+ {
+ session_transport_reset_notify (tc);
+ session_transport_closed_notify (tc);
+ }
+ else if ((app_session = session_get (tc->s_index, tc->thread_index)))
+ session_free (app_session);
tls_disconnect_transport (ctx);
}