Changeset 5583


Ignore:
Timestamp:
Apr 19, 2017 4:07:23 AM (8 years ago)
Author:
nanang
Message:

Re #2009: Avoid premature destroy in TURN session by incrementing group lock ref before performing async DNS resolution.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/turn_session.c

    r5534 r5583  
    629629        } 
    630630 
     631        /* Add reference before async DNS resolution */ 
     632        pj_grp_lock_add_ref(sess->grp_lock); 
     633 
    631634        status = pj_dns_srv_resolve(domain, &res_name, default_port,  
    632635                                    sess->pool, resolver, opt, sess,  
     
    634637        if (status != PJ_SUCCESS) { 
    635638            set_state(sess, PJ_TURN_STATE_NULL); 
     639            pj_grp_lock_dec_ref(sess->grp_lock); 
    636640            goto on_return; 
    637641        } 
     
    17261730        set_state(sess, PJ_TURN_STATE_DESTROYING); 
    17271731        sess_shutdown(sess, status); 
     1732        pj_grp_lock_dec_ref(sess->grp_lock); 
    17281733        return; 
    17291734    } 
     
    17791784            on_session_fail(sess, PJ_STUN_ALLOCATE_METHOD, status, NULL); 
    17801785    } 
     1786 
     1787    pj_grp_lock_dec_ref(sess->grp_lock); 
    17811788} 
    17821789 
Note: See TracChangeset for help on using the changeset viewer.