diff options
author | Florin Coras <fcoras@cisco.com> | 2018-08-27 10:07:40 -0700 |
---|---|---|
committer | Marco Varlese <marco.varlese@suse.de> | 2018-08-28 08:24:50 +0000 |
commit | 57791ad4decd925bfe6c90f57ad628b1afbfcdac (patch) | |
tree | 530ec742621ddbaa91527b1bffd864df7e8c375f | |
parent | 070453d872b22b75182381c44817c9486d280ec4 (diff) |
tls: fix handling of failed connects
Change-Id: I48f32fdf1859420d2966dd8553f3a8f9a082e2ae
Signed-off-by: Florin Coras <fcoras@cisco.com>
-rw-r--r-- | src/vnet/tls/tls.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c index 7364ba33514..b576c00d4e9 100644 --- a/src/vnet/tls/tls.c +++ b/src/vnet/tls/tls.c @@ -391,23 +391,26 @@ int tls_session_connected_callback (u32 tls_app_index, u32 ho_ctx_index, stream_session_t * tls_session, u8 is_fail) { - int (*cb_fn) (u32, u32, stream_session_t *, u8); tls_ctx_t *ho_ctx, *ctx; - app_worker_t *app_wrk; - application_t *app; u32 ctx_handle; ho_ctx = tls_ctx_half_open_get (ho_ctx_index); - app_wrk = app_worker_get (ho_ctx->parent_app_index); - app = application_get (app_wrk->app_index); - cb_fn = app->cb_fns.session_connected_callback; if (is_fail) { + int (*cb_fn) (u32, u32, stream_session_t *, u8); + u32 wrk_index, api_context; + app_worker_t *app_wrk; + application_t *app; + + wrk_index = ho_ctx->parent_app_index; + api_context = ho_ctx->c_s_index; tls_ctx_half_open_reader_unlock (); tls_ctx_half_open_free (ho_ctx_index); - return cb_fn (ho_ctx->parent_app_index, ho_ctx->c_s_index, 0, - 1 /* failed */ ); + app_wrk = app_worker_get (ho_ctx->parent_app_index); + app = application_get (app_wrk->app_index); + cb_fn = app->cb_fns.session_connected_callback; + return cb_fn (wrk_index, api_context, 0, 1 /* failed */ ); } ctx_handle = tls_ctx_alloc (ho_ctx->tls_ctx_engine); |