[Freeswitch-svn] [commit] r11855 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua-glib/su-glib libsofia-sip-ua/su
FreeSWITCH SVN
mikej at freeswitch.org
Wed Feb 11 09:18:37 PST 2009
Author: mikej
Date: Wed Feb 11 11:18:37 2009
New Revision: 11855
Log:
Wed Jan 28 12:09:00 CST 2009 Pekka Pessi <first.last at nokia.com>
* su_port.h, su_timer.c: refactored su_timer_next_expires()
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_port.h
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_timer.c
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Wed Feb 11 11:18:37 2009
@@ -1 +1 @@
-Wed Feb 11 11:18:06 CST 2009
+Wed Feb 11 11:18:29 CST 2009
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c Wed Feb 11 11:18:37 2009
@@ -394,7 +394,7 @@
now.tv_sec = gtimeval.tv_sec + 2208988800UL;
now.tv_usec = gtimeval.tv_usec;
- tout = su_timer_next_expires(self->sup_base->sup_timers, now);
+ tout = su_timer_next_expires(&self->sup_base->sup_timers, now);
*return_tout = (tout < 0 || tout > (su_duration_t)G_MAXINT)?
-1 : (gint)tout;
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_port.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_port.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_port.h Wed Feb 11 11:18:37 2009
@@ -166,7 +166,7 @@
/* Extension from >= 1.12.5 */
SOFIAPUBFUN void su_msg_delivery_report(su_msg_r msg);
-SOFIAPUBFUN su_duration_t su_timer_next_expires(su_timer_t const * t,
+SOFIAPUBFUN su_duration_t su_timer_next_expires(su_timer_queue_t const *timers,
su_time_t now);
SOFIAPUBFUN su_root_t *su_root_create_with_port(su_root_magic_t *magic,
su_port_t *port)
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_timer.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_timer.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_timer.c Wed Feb 11 11:18:37 2009
@@ -581,25 +581,22 @@
/** Calculate duration in milliseconds until next timer expires. */
-su_duration_t su_timer_next_expires(su_timer_t const * t, su_time_t now)
+su_duration_t su_timer_next_expires(su_timer_queue_t const *timers,
+ su_time_t now)
{
- su_timer_queue_t *timers;
+ su_duration_t next = SU_DURATION_MAX;
- su_duration_t tout;
+ su_timer_t const *t;
- if (!t)
- return SU_DURATION_MAX;
+ t = timers ? timers_get(timers[0], 1) : NULL;
- timers = su_task_timers(t->sut_task);
-
- t = timers ? timers_get(timers[0], 1) : NULL;
-
- if (!t)
- return SU_DURATION_MAX;
-
- tout = su_duration(t->sut_when, now);
+ if (t) {
+ next = su_duration(t->sut_when, now);
+ if (next < 0)
+ next = 0;
+ }
- return tout > 0 ? tout : 0 ;
+ return next;
}
/**
More information about the Freeswitch-svn
mailing list