[commit] r11033 - in freeswitch/trunk/src: . mod/event_handlers/mod_event_socket
Author: anthm Date: Wed Dec 31 14:07:20 2008 New Revision: 11033 Log: tweak Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c freeswitch/trunk/src/switch_log.c Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c ============================================================================== --- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original) +++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Wed Dec 31 14:07:20 2008 @@ -473,6 +473,7 @@ } switch_mutex_unlock(globals.listener_mutex); + switch_yield(1000000); return SWITCH_STATUS_SUCCESS; @@ -821,6 +822,9 @@ switch_mutex_init(&globals.listener_mutex, SWITCH_MUTEX_NESTED, pool); + memset(&listen_list, 0, sizeof(listen_list)); + switch_mutex_init(&listen_list.sock_mutex, SWITCH_MUTEX_NESTED, pool); + if (switch_event_bind_removable(modname, SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL, &globals.node) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n"); return SWITCH_STATUS_GENERR; @@ -1482,7 +1486,7 @@ ltype = switch_log_str2level(level_s); } - if (ltype && ltype != SWITCH_LOG_INVALID) { + if (ltype != SWITCH_LOG_INVALID) { listener->level = ltype; switch_set_flag(listener, LFLAG_LOG); switch_snprintf(reply, reply_len, "+OK log level %s [%d]", level_s, listener->level); @@ -1927,17 +1931,12 @@ listener_t *listener; uint32_t x = 0; - memset(&listen_list, 0, sizeof(listen_list)); - config(); - if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "OH OH no pool\n"); return SWITCH_STATUS_TERM; } - - switch_mutex_init(&listen_list.sock_mutex, SWITCH_MUTEX_NESTED, pool); - + config(); for (;;) { rv = switch_sockaddr_info_get(&sa, prefs.ip, SWITCH_INET, prefs.port, 0, pool); Modified: freeswitch/trunk/src/switch_log.c ============================================================================== --- freeswitch/trunk/src/switch_log.c (original) +++ freeswitch/trunk/src/switch_log.c Wed Dec 31 14:07:20 2008 @@ -122,6 +122,7 @@ if (!LEVELS[x]) { break; } + if (!strcasecmp(LEVELS[x], str)) { level = (switch_log_level_t) x; break;
participants (1)
-
FreeSWITCH SVN