git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11033 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-12-31 19:07:20 +00:00
parent 6ba873e0a1
commit 863c576784
2 changed files with 7 additions and 7 deletions

View File

@ -473,6 +473,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_socket_shutdown)
}
switch_mutex_unlock(globals.listener_mutex);
switch_yield(1000000);
return SWITCH_STATUS_SUCCESS;
@ -821,6 +822,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_event_socket_load)
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 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even
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 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime)
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);

View File

@ -122,6 +122,7 @@ SWITCH_DECLARE(switch_log_level_t) switch_log_str2level(const char *str)
if (!LEVELS[x]) {
break;
}
if (!strcasecmp(LEVELS[x], str)) {
level = (switch_log_level_t) x;
break;