]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
ftmod_libpri: Reset timer parameters in lpwrap_run_expired() before invoking the...
authorStefan Knoblich <stkn@openisdn.net>
Tue, 4 Sep 2012 22:13:18 +0000 (00:13 +0200)
committerStefan Knoblich <stkn@openisdn.net>
Tue, 4 Sep 2012 22:42:32 +0000 (00:42 +0200)
Allowing us to restart the timer from the callback with lpwrap_start_timer().

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
libs/freetdm/src/ftmod/ftmod_libpri/lpwrap_pri.c

index 7cbcc7cd41b15d6bf3e8b8c25d94960f7d40e79e..fb478901b3dad4413490bbdcc9adf5ff87e0fd33 100644 (file)
@@ -275,15 +275,17 @@ static int lpwrap_run_expired(struct lpwrap_pri *spri, ftdm_time_t now_ms)
 
        /* fire callbacks */
        while ((cur = expired_list)) {
+               timeout_handler handler = cur->callback;
                expired_list = cur->next;
-               if (cur->callback)
-                       cur->callback(spri, cur);
-               /* stop timer */
+
+               /* Stop timer */
                cur->next     = NULL;
                cur->timeout  = 0;
                cur->callback = NULL;
-       }
 
+               if (handler)
+                       handler(spri, cur);
+       }
        return 0;
 }