Ignore:
Timestamp:
Mar 19, 2015 5:07:01 AM (9 years ago)
Author:
riza
Message:

Misc (re #1782): Check if the transport being shutdown in on_accept_complete and on_connect_complete callback

File:
1 edited

Legend:

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

    r4862 r5000  
    10961096    PJ_ASSERT_RETURN(sock != PJ_INVALID_SOCKET, PJ_TRUE); 
    10971097 
     1098    if (!listener->is_registered) 
     1099        return PJ_FALSE; 
     1100 
    10981101    PJ_LOG(4,(listener->factory.obj_name,  
    10991102              "TCP listener %.*s:%d: got incoming TCP connection " 
     
    11341137            tcp_destroy(&tcp->base, status); 
    11351138        } else { 
     1139            if (tcp->base.is_shutdown || tcp->base.is_destroying) { 
     1140                return PJ_TRUE; 
     1141            } 
    11361142            /* Start keep-alive timer */ 
    11371143            if (PJSIP_TCP_KEEP_ALIVE_INTERVAL) { 
     
    11431149                pj_gettimeofday(&tcp->last_activity); 
    11441150            } 
    1145  
    11461151            /* Notify application of transport state accepted */ 
    11471152            state_cb = pjsip_tpmgr_get_state_cb(tcp->base.tpmgr); 
    11481153            if (state_cb) { 
    11491154                pjsip_transport_state_info state_info; 
    1150              
     1155 
    11511156                pj_bzero(&state_info, sizeof(state_info)); 
    11521157                (*state_cb)(&tcp->base, PJSIP_TP_STATE_CONNECTED, &state_info); 
     
    14231428    tcp->has_pending_connect = PJ_FALSE; 
    14241429 
     1430    if (tcp->base.is_shutdown || tcp->base.is_destroying)  
     1431        return PJ_FALSE; 
     1432 
    14251433    /* Check connect() status */ 
    14261434    if (status != PJ_SUCCESS) { 
     
    14831491    if (state_cb) { 
    14841492        pjsip_transport_state_info state_info; 
    1485      
     1493         
    14861494        pj_bzero(&state_info, sizeof(state_info)); 
    14871495        (*state_cb)(&tcp->base, PJSIP_TP_STATE_CONNECTED, &state_info); 
Note: See TracChangeset for help on using the changeset viewer.