[vlc-devel] [PATCH] sap: fix implicit timeout calculation

Santiago Gimeno santiago.gimeno at gmail.com
Mon Nov 17 14:48:58 CET 2014


- RFC2974 states in Section 4:
      "If a session announcement message has not been received for ten times the
       announcement period, or one hour, whichever is the greater, then the
       session is deleted from the receiver's session cache."
  But the session was being deleted after three times the announcement period.
---
 modules/services_discovery/sap.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c
index 5477924..54c7650 100644
--- a/modules/services_discovery/sap.c
+++ b/modules/services_discovery/sap.c
@@ -582,9 +582,9 @@ static void *Run( void *data )
             mtime_t i_last_period = now - p_announce->i_last;
 
             /* Remove the announcement, if the last announcement was 1 hour ago
-             * or if the last packet emitted was 3 times the average time
+             * or if the last packet emitted was 10 times the average time
              * between two packets */
-            if( ( p_announce->i_period_trust > 5 && i_last_period > 3 * p_announce->i_period ) ||
+            if( ( p_announce->i_period_trust > 5 && i_last_period > 10 * p_announce->i_period ) ||
                 i_last_period > i_timeout )
             {
                 RemoveAnnounce( p_sd, p_announce );
-- 
1.7.10.4




More information about the vlc-devel mailing list