From 6cdd3e2a2e4677b061b9fbb9ee516fae9601cd16 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Mon, 16 Aug 2010 10:41:04 -0400 Subject: [PATCH] Attempt at MODAPP-446 --- src/mod/applications/mod_hash/mod_hash.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mod/applications/mod_hash/mod_hash.c b/src/mod/applications/mod_hash/mod_hash.c index a13a1874ae..3a65528ea3 100644 --- a/src/mod/applications/mod_hash/mod_hash.c +++ b/src/mod/applications/mod_hash/mod_hash.c @@ -766,10 +766,14 @@ static void *SWITCH_THREAD_FUNC limit_remote_thread(switch_thread_t *thread, voi remote->name, remote->host, remote->port); remote->state = REMOTE_UP; + } else { + esl_disconnect(&remote->handle); + memset(&remote->handle, 0, sizeof(remote->handle)); } } else { if (esl_send_recv_timed(&remote->handle, "api hash_dump limit", 5000) != ESL_SUCCESS) { esl_disconnect(&remote->handle); + memset(&remote->handle, 0, sizeof(remote->handle)); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Disconnected from remote FreeSWITCH (%s) at %s:%d\n", remote->name, remote->host, remote->port); memset(&remote->handle, 0, sizeof(remote->handle));