[Freeswitch-svn] [commit] r11860 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib

FreeSWITCH SVN mikej at freeswitch.org
Wed Feb 11 09:20:26 PST 2009


Author: mikej
Date: Wed Feb 11 11:20:26 2009
New Revision: 11860

Log:
Wed Jan 28 12:31:06 CST 2009  Mikhail Zabaluev <mikhail.zabaluev at nokia.com>
  * su-glib/su_source.c: improved the deferrable timeout calculation
  


Modified:
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua-glib/su-glib/su_source.c

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:20:26 2009
@@ -386,7 +386,7 @@
     return TRUE;
   }
 
-  if (self->sup_base->sup_timers) {
+  if (self->sup_base->sup_timers || self->sup_base->sup_deferrable) {
     su_time_t now;
     GTimeVal  gtimeval;
 
@@ -395,10 +395,18 @@
     now.tv_usec = gtimeval.tv_usec;
 
     tout = su_timer_next_expires(&self->sup_base->sup_timers, now);
-  }
-  if (self->sup_base->sup_deferrable) {
-    if (tout > self->sup_base->sup_max_defer)
-      tout = self->sup_base->sup_max_defer;
+
+    if (self->sup_base->sup_deferrable) {
+      su_duration_t tout_defer;
+
+      tout_defer = su_timer_next_expires(&self->sup_base->sup_deferrable, now);
+
+      if (tout_defer < self->sup_base->sup_max_defer)
+        tout_defer = self->sup_base->sup_max_defer;
+
+      if (tout > tout_defer)
+        tout = tout_defer;
+    }
   }
 
   *return_tout = (tout >= 0 && tout <= (su_duration_t)G_MAXINT)?



More information about the Freeswitch-svn mailing list