]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
allow event consumer to supply size as optional arg
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 14 Jun 2012 16:31:46 +0000 (11:31 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 14 Jun 2012 16:31:46 +0000 (11:31 -0500)
src/include/switch_cpp.h
src/switch_cpp.cpp

index 44e85185a6c6bafbb7b0e7e327a2b66f518525db..83adac6867dae9bb5f7ddb736c1e3ad644139d6e 100644 (file)
@@ -186,7 +186,7 @@ SWITCH_DECLARE(bool) email(char *to, char *from, char *headers = NULL, char *bod
                 switch_event_node_t *enodes[SWITCH_EVENT_ALL + 1];
                 uint32_t node_index;
 
-                SWITCH_DECLARE_CONSTRUCTOR EventConsumer(const char *event_name = NULL, const char *subclass_name = "");
+                SWITCH_DECLARE_CONSTRUCTOR EventConsumer(const char *event_name = NULL, const char *subclass_name = "", int len = 5000);
                 SWITCH_DECLARE_CONSTRUCTOR ~ EventConsumer();
                 SWITCH_DECLARE(int) bind(const char *event_name, const char *subclass_name = "");
                 SWITCH_DECLARE(Event *) pop(int block = 0, int timeout = 0);
index 5408edb828598aa5ac027bc445bca6bdbfb9ec87..0f7a52066b3029024eec44a902ee0a8469d9bd5b 100644 (file)
@@ -50,11 +50,11 @@ static void event_handler(switch_event_t *event)
 
 }
 
-SWITCH_DECLARE_CONSTRUCTOR EventConsumer::EventConsumer(const char *event_name, const char *subclass_name)
+SWITCH_DECLARE_CONSTRUCTOR EventConsumer::EventConsumer(const char *event_name, const char *subclass_name, int len)
 {
 
        switch_core_new_memory_pool(&pool);     
-       switch_queue_create(&events, 5000, pool);
+       switch_queue_create(&events, len, pool);
        node_index = 0;
        
        if (!zstr(event_name)) {