From a1fff59c2510c574a1caa6ebb8262229278ad8c1 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 18 Feb 2016 11:44:16 -0600 Subject: [PATCH] FS-7132 --- src/mod/endpoints/mod_verto/mod_verto.c | 5 +++++ src/mod/endpoints/mod_verto/mod_verto.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 24dc581e47..58fc3499cd 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -1113,6 +1113,7 @@ static void attach_jsock(jsock_t *jsock) switch_core_hash_delete(globals.jsock_hash, jsock->uuid_str); ws_write_json(jp, &msg, SWITCH_TRUE); cJSON_Delete(msg); + jp->nodelete = 1; jp->drop = 1; } } @@ -1126,6 +1127,10 @@ static void attach_jsock(jsock_t *jsock) static void detach_jsock(jsock_t *jsock) { + if (jsock->nodelete) { + return; + } + switch_mutex_lock(globals.jsock_mutex); switch_core_hash_delete(globals.jsock_hash, jsock->uuid_str); switch_mutex_unlock(globals.jsock_mutex); diff --git a/src/mod/endpoints/mod_verto/mod_verto.h b/src/mod/endpoints/mod_verto/mod_verto.h index eccd095369..b144e70a29 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.h +++ b/src/mod/endpoints/mod_verto/mod_verto.h @@ -112,7 +112,8 @@ struct jsock_s { struct passwd pw; #endif - int drop; + uint8_t drop; + uint8_t nodelete; ws_socket_t local_sock; SSL *ssl;