mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
FS-10167: Fixed some issues that appeared primarily under windows testing, committing to determine if a specific read access violation occurs under linux as well.
This commit is contained in:
@@ -523,7 +523,7 @@ ks_status_t blade_module_wss_listen(blade_module_wss_t *bm_wss, ks_sockaddr_t *a
|
||||
sizeof(struct pollfd) * bm_wss->listeners_count);
|
||||
ks_assert(bm_wss->listeners_poll);
|
||||
bm_wss->listeners_poll[listener_index].fd = listener;
|
||||
bm_wss->listeners_poll[listener_index].events = POLLIN | POLLERR;
|
||||
bm_wss->listeners_poll[listener_index].events = POLLIN; // | POLLERR;
|
||||
|
||||
ks_log(KS_LOG_DEBUG, "Bound %s on port %d at index %d\n", ks_addr_get_host(addr), ks_addr_get_port(addr), listener_index);
|
||||
|
||||
@@ -784,7 +784,7 @@ ks_status_t blade_transport_wss_on_send(blade_connection_t *bc, cJSON *json)
|
||||
ks_status_t blade_transport_wss_read(blade_transport_wss_t *bt_wss, cJSON **json)
|
||||
{
|
||||
// @todo get exact timeout from service config?
|
||||
int32_t poll_flags = ks_wait_sock(bt_wss->sock, 100, KS_POLL_READ | KS_POLL_ERROR);
|
||||
int32_t poll_flags = ks_wait_sock(bt_wss->sock, 100, KS_POLL_READ); // | KS_POLL_ERROR);
|
||||
|
||||
*json = NULL;
|
||||
|
||||
@@ -836,7 +836,7 @@ ks_status_t blade_transport_wss_rpc_error_send(blade_connection_t *bc, const cha
|
||||
cJSON *json = NULL;
|
||||
|
||||
ks_assert(bc);
|
||||
ks_assert(id);
|
||||
//ks_assert(id);
|
||||
ks_assert(message);
|
||||
|
||||
bt_wss = (blade_transport_wss_t *)blade_connection_transport_get(bc);
|
||||
|
||||
@@ -236,14 +236,14 @@ KS_DECLARE(ks_status_t) blade_rpc_error_create(ks_pool_t *pool, cJSON **json, cJ
|
||||
|
||||
ks_assert(pool);
|
||||
ks_assert(json);
|
||||
ks_assert(id);
|
||||
//ks_assert(id);
|
||||
ks_assert(message);
|
||||
|
||||
root = cJSON_CreateObject();
|
||||
|
||||
cJSON_AddStringToObject(root, "jsonrpc", "2.0");
|
||||
|
||||
cJSON_AddStringToObject(root, "id", id);
|
||||
if (id) cJSON_AddStringToObject(root, "id", id);
|
||||
|
||||
e = cJSON_CreateObject();
|
||||
cJSON_AddNumberToObject(e, "code", code);
|
||||
|
||||
@@ -324,13 +324,6 @@ KS_DECLARE(ks_status_t) blade_handle_shutdown(blade_handle_t *bh)
|
||||
|
||||
ks_assert(bh);
|
||||
|
||||
if (bh->worker_thread) {
|
||||
bh->shutdown = KS_TRUE;
|
||||
ks_thread_join(bh->worker_thread);
|
||||
ks_pool_free(bh->pool, &bh->worker_thread);
|
||||
bh->shutdown = KS_FALSE;
|
||||
}
|
||||
|
||||
while ((it = ks_hash_first(bh->requests, KS_UNLOCKED))) {
|
||||
void *key = NULL;
|
||||
blade_request_t *value = NULL;
|
||||
@@ -346,7 +339,6 @@ KS_DECLARE(ks_status_t) blade_handle_shutdown(blade_handle_t *bh)
|
||||
blade_session_t *value = NULL;
|
||||
|
||||
ks_hash_this(it, (const void **)&key, NULL, (void **)&value);
|
||||
//ks_hash_remove(bh->sessions, key);
|
||||
|
||||
blade_session_hangup(value);
|
||||
}
|
||||
@@ -375,6 +367,13 @@ KS_DECLARE(ks_status_t) blade_handle_shutdown(blade_handle_t *bh)
|
||||
|
||||
if (blade_handle_datastore_available(bh)) blade_datastore_destroy(&bh->datastore);
|
||||
|
||||
if (bh->worker_thread) {
|
||||
bh->shutdown = KS_TRUE;
|
||||
ks_thread_join(bh->worker_thread);
|
||||
ks_pool_free(bh->pool, &bh->worker_thread);
|
||||
bh->shutdown = KS_FALSE;
|
||||
}
|
||||
|
||||
return KS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user