]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10084 [mod_v8] If the value passed is negative, block until event is received
authorNicholas Blasgen <nicholas@blasgen.com>
Sun, 12 Mar 2017 18:20:11 +0000 (18:20 +0000)
committerMike Jerris <mike@jerris.com>
Tue, 6 Jun 2017 18:52:17 +0000 (13:52 -0500)
src/mod/languages/mod_v8/src/fseventhandler.cpp

index f72cf2bb97c3f41487849a91b015761f226a5c73..03f2f2bab76da08362d2df96c44c0a82a965ab29 100644 (file)
@@ -336,6 +336,10 @@ JS_EVENTHANDLER_FUNCTION_IMPL(GetEvent)
                if (switch_queue_pop_timeout(_event_queue, &pop, (switch_interval_time_t) timeout * 1000) == SWITCH_STATUS_SUCCESS && pop) {
                        pevent = (switch_event_t *) pop;
                }
+       } else if (timeout < 0) {
+               if (switch_queue_pop(_event_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
+                       pevent = (switch_event_t *) pop;
+               }
        } else {
                if (switch_queue_trypop(_event_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
                        pevent = (switch_event_t *) pop;