static void close_socket(int *sock)
#endif
{
- switch_mutex_lock(listen_list.sock_mutex);
if (*sock) {
#ifdef WIN32
shutdown(*sock, SD_BOTH);
#endif
sock = NULL;
}
- switch_mutex_unlock(listen_list.sock_mutex);
}
if (!p->reply) {
p->state = reply_timeout;
switch_mutex_unlock(globals.fetch_reply_mutex);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Timed out after %d milliseconds when waiting for XML fetch response\n", (int) (switch_micro_time_now() - now) / 1000);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Timed out after %d milliseconds when waiting for XML fetch response for %s\n", (int) (switch_micro_time_now() - now) / 1000, uuid_str);
goto cleanup;
}
ei_decode_string_or_binary(rep->buff, &rep->index, size, xmlstr);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "got data %s after %d milliseconds from %s!\n", xmlstr, (int) (switch_micro_time_now() - now) / 1000, p->winner);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "got data %s after %d milliseconds from %s for %s!\n", xmlstr, (int) (switch_micro_time_now() - now) / 1000, p->winner, uuid_str);
if (zstr(xmlstr)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n");
ei_x_encode_tuple_header(&lbuf, 2);
ei_x_encode_atom(&lbuf, "call");
ei_encode_switch_event(&lbuf, call_event);
- switch_mutex_lock(listener->sock_mutex);
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(session_element->uuid_str), SWITCH_LOG_DEBUG, "Sending initial call event for %s\n",
session_element->uuid_str);
- result = ei_sendto(listener->ec, listener->sockfd, &session_element->process, &lbuf);
+ switch_mutex_lock(listener->sock_mutex);
+ result = ei_sendto(listener->ec, listener->sockfd, &session_element->process, &lbuf);
switch_mutex_unlock(listener->sock_mutex);
if (result) {
return SWITCH_STATUS_TERM;
}
- switch_mutex_init(&listen_list.sock_mutex, SWITCH_MUTEX_NESTED, pool);
-
/* zero out the struct before we use it */
memset(&server_addr, 0, sizeof(server_addr));