Ignore:
Timestamp:
Apr 23, 2019 8:42:45 AM (20 months ago)
Author:
nanang
Message:

Fixed #2191:

  • Stricter double timer entry scheduling prevention.
  • Integrate group lock in SIP transport, e.g: for add/dec ref, for timer scheduling.


File:
1 edited

Legend:

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

    r5936 r5971  
    164164                              const pj_str_t *remote_name, 
    165165                              struct tls_transport **p_tls); 
     166 
     167 
     168/* Clean up TLS resources */ 
     169static void tls_on_destroy(void *arg); 
    166170 
    167171 
     
    894898 
    895899on_error: 
    896     tls_destroy(&tls->base, status); 
     900    if (tls->grp_lock && pj_grp_lock_get_ref(tls->grp_lock)) 
     901        tls_destroy(&tls->base, status); 
     902    else 
     903        tls_on_destroy(tls); 
     904 
    897905    return status; 
    898906} 
     
    10491057        pj_grp_lock_dec_ref(grp_lock); 
    10501058        /* Transport may have been deleted at this point */ 
    1051     } else { 
    1052         tls_on_destroy(tls); 
    10531059    } 
    10541060 
     
    12361242 
    12371243    /* Set up the group lock */ 
    1238     tls->grp_lock = glock; 
     1244    tls->grp_lock = tls->base.grp_lock = glock; 
    12391245    pj_grp_lock_add_ref(tls->grp_lock); 
    12401246    pj_grp_lock_add_handler(tls->grp_lock, pool, tls, &tls_on_destroy); 
Note: See TracChangeset for help on using the changeset viewer.