Ignore:
Timestamp:
May 11, 2015 5:57:50 AM (7 years ago)
Author:
ming
Message:

Fixed #1851: Runtime configuration of TCP and TLS keep alive intervals

Thanks to Michele Cicciotti for the patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c

    r5000 r5090  
    12821282    } else { 
    12831283        /* Start keep-alive timer */ 
    1284         if (PJSIP_TLS_KEEP_ALIVE_INTERVAL) { 
    1285             pj_time_val delay = {PJSIP_TLS_KEEP_ALIVE_INTERVAL, 0}; 
     1284        if (pjsip_cfg()->tls.keep_alive_interval) { 
     1285            pj_time_val delay = {pjsip_cfg()->tls.keep_alive_interval, 0}; 
    12861286            pjsip_endpt_schedule_timer(listener->endpt,  
    12871287                                       &tls->ka_timer,  
     
    17481748 
    17491749    /* Start keep-alive timer */ 
    1750     if (PJSIP_TLS_KEEP_ALIVE_INTERVAL) { 
    1751         pj_time_val delay = { PJSIP_TLS_KEEP_ALIVE_INTERVAL, 0 }; 
     1750    if (pjsip_cfg()->tls.keep_alive_interval) { 
     1751        pj_time_val delay = { pjsip_cfg()->tls.keep_alive_interval, 0 }; 
    17521752        pjsip_endpt_schedule_timer(tls->base.endpt, &tls->ka_timer,  
    17531753                                   &delay); 
     
    17811781    PJ_TIME_VAL_SUB(now, tls->last_activity); 
    17821782 
    1783     if (now.sec > 0 && now.sec < PJSIP_TLS_KEEP_ALIVE_INTERVAL) { 
     1783    if (now.sec > 0 && now.sec < pjsip_cfg()->tls.keep_alive_interval) { 
    17841784        /* There has been activity, so don't send keep-alive */ 
    1785         delay.sec = PJSIP_TLS_KEEP_ALIVE_INTERVAL - now.sec; 
     1785        delay.sec = pjsip_cfg()->tls.keep_alive_interval - now.sec; 
    17861786        delay.msec = 0; 
    17871787 
     
    18111811 
    18121812    /* Register next keep-alive */ 
    1813     delay.sec = PJSIP_TLS_KEEP_ALIVE_INTERVAL; 
     1813    delay.sec = pjsip_cfg()->tls.keep_alive_interval; 
    18141814    delay.msec = 0; 
    18151815 
Note: See TracChangeset for help on using the changeset viewer.