]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Remove some code we don't use
authorAndrew Thompson <andrew@hijacked.us>
Mon, 23 Aug 2010 00:22:46 +0000 (20:22 -0400)
committerAndrew Thompson <andrew@hijacked.us>
Mon, 23 Aug 2010 00:58:48 +0000 (20:58 -0400)
src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c
src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h

index 25d4cf44537bba1804ac4960dcdcb848b84c851a..79a5d64878b260d4b333cb1b323e7ca7e2e29d42 100644 (file)
@@ -86,23 +86,6 @@ static switch_status_t socket_logger(const switch_log_node_t *node, switch_log_l
 }
 
 
-static void expire_listener(listener_t ** listener)
-{
-       void *pop;
-
-       switch_thread_rwlock_unlock((*listener)->rwlock);
-       switch_core_hash_destroy(&(*listener)->event_hash);
-       switch_core_destroy_memory_pool(&(*listener)->pool);
-
-       while (switch_queue_trypop((*listener)->event_queue, &pop) == SWITCH_STATUS_SUCCESS) {
-               switch_event_t *pevent = (switch_event_t *) pop;
-               switch_event_destroy(&pevent);
-       }
-
-       *listener = NULL;
-}
-
-
 static void remove_binding(listener_t *listener, erlang_pid * pid)
 {
        struct erlang_binding *ptr, *lst = NULL;
@@ -211,13 +194,6 @@ static void event_handler(switch_event_t *event)
                        continue;
                }
 
-               if (switch_test_flag(l, LFLAG_STATEFUL) && l->timeout && switch_epoch_time_now(NULL) - l->last_flush > l->timeout) {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Stateful Listener %u has expired\n", l->id);
-                       remove_listener(l);
-                       expire_listener(&l);
-                       continue;
-               }
-
                if (l->event_list[SWITCH_EVENT_ALL]) {
                        send = 1;
                } else if ((l->event_list[event->event_id])) {
index acea53f1d4ff9eb3e5033ac2f0f03177ff9711a7..248e66b056eb53fca5c42c50575ffb40393bf9d6 100644 (file)
@@ -134,8 +134,6 @@ struct listener {
        switch_hash_t *sessions;
        int lost_events;
        int lost_logs;
-       time_t last_flush;
-       uint32_t timeout;
        uint32_t id;
        char remote_ip[50];
        /*switch_port_t remote_port; */
@@ -166,6 +164,7 @@ struct globals_struct {
        switch_event_node_t *node;
        switch_mutex_t *ref_mutex;
        switch_mutex_t *fetch_reply_mutex;
+       switch_mutex_t *listener_count_mutex;
        switch_hash_t *fetch_reply_hash;
        unsigned int reference0;
        unsigned int reference1;