From: Mathieu Rene Date: Mon, 16 Aug 2010 14:41:04 +0000 (-0400) Subject: Attempt at MODAPP-446 X-Git-Tag: v1.2-rc1~526^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cdd3e2a2e4677b061b9fbb9ee516fae9601cd16;p=thirdparty%2Ffreeswitch.git Attempt at MODAPP-446 --- 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));