Changeset 4572


Ignore:
Timestamp:
Jul 22, 2013 9:17:30 AM (11 years ago)
Author:
nanang
Message:

Misc (re #1630): Add randomizing interval for subscription refresh.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-simple/evsub.c

    r4447 r4572  
    3333#include <pj/os.h> 
    3434#include <pj/pool.h> 
     35#include <pj/rand.h> 
    3536#include <pj/string.h> 
    3637 
     
    17501751                    sub->expires->ivalue - TIME_UAC_REFRESH : sub->expires->ivalue; 
    17511752 
     1753                /* Reduce timeout by about 1 - 10 secs (randomized) */ 
     1754                if (timeout > 10) 
     1755                    timeout += -10 + (pj_rand() % 10); 
     1756 
    17521757                PJ_LOG(5,(sub->obj_name, "Will refresh in %d seconds",  
    17531758                          timeout)); 
Note: See TracChangeset for help on using the changeset viewer.