mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 17:22:21 +00:00
kill socket in esl_disconnect to prevent blocking
This commit is contained in:
parent
2f1c82ff36
commit
634d936a02
@ -1123,6 +1123,12 @@ ESL_DECLARE(esl_status_t) esl_disconnect(esl_handle_t *handle)
|
|||||||
return ESL_FAIL;
|
return ESL_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (handle->sock != ESL_SOCK_INVALID) {
|
||||||
|
closesocket(handle->sock);
|
||||||
|
handle->sock = ESL_SOCK_INVALID;
|
||||||
|
status = ESL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
if (mutex) {
|
if (mutex) {
|
||||||
esl_mutex_lock(mutex);
|
esl_mutex_lock(mutex);
|
||||||
}
|
}
|
||||||
@ -1145,12 +1151,6 @@ ESL_DECLARE(esl_status_t) esl_disconnect(esl_handle_t *handle)
|
|||||||
esl_event_safe_destroy(&handle->last_ievent);
|
esl_event_safe_destroy(&handle->last_ievent);
|
||||||
esl_event_safe_destroy(&handle->info_event);
|
esl_event_safe_destroy(&handle->info_event);
|
||||||
|
|
||||||
if (handle->sock != ESL_SOCK_INVALID) {
|
|
||||||
closesocket(handle->sock);
|
|
||||||
handle->sock = ESL_SOCK_INVALID;
|
|
||||||
status = ESL_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mutex) {
|
if (mutex) {
|
||||||
esl_mutex_unlock(mutex);
|
esl_mutex_unlock(mutex);
|
||||||
esl_mutex_lock(mutex);
|
esl_mutex_lock(mutex);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user