Changeset 4548


Ignore:
Timestamp:
Jun 28, 2013 9:25:17 AM (11 years ago)
Author:
bennylp
Message:

Fixed #1684 (Failed assertion when scheduling timer in the registration client):

  • There is a potential race condition in pjsip_regc_set_delay_before_refresh() because it calls schedule_registration() without mutex protection
  • Check if the timer is active and cancel it in schedule_registration() as precaution
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c

    r4537 r4548  
    793793        pj_time_val delay = { 0, 0}; 
    794794 
     795        pj_timer_heap_cancel_if_active(pjsip_endpt_get_timer_heap(regc->endpt), 
     796                                       &regc->timer, 0); 
     797 
    795798        delay.sec = expiration - regc->delay_before_refresh; 
    796799        if (regc->expires != PJSIP_REGC_EXPIRATION_NOT_SPECIFIED &&  
     
    838841        return PJ_ETOOBIG; 
    839842 
     843    pj_lock_acquire(regc->lock); 
     844 
    840845    if (regc->delay_before_refresh != delay) 
    841846    { 
     
    851856        } 
    852857    } 
     858 
     859    pj_lock_release(regc->lock); 
    853860 
    854861    return PJ_SUCCESS; 
Note: See TracChangeset for help on using the changeset viewer.