Changeset 2180


Ignore:
Timestamp:
Jul 28, 2008 8:17:04 PM (11 years ago)
Author:
bennylp
Message:

Ticket #538: Closed TCP connection should be removed from the hash table immediately

Location:
pjproject/trunk/pjsip/src/pjsip
Files:
3 edited

Legend:

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

    r2039 r2180  
    937937        tp->is_shutdown = PJ_TRUE; 
    938938 
     939    /* If transport reference count is zero, start timer count-down */ 
     940    if (pj_atomic_get(tp->ref_cnt) == 0) { 
     941        pjsip_transport_add_ref(tp); 
     942        pjsip_transport_dec_ref(tp); 
     943    } 
     944 
    939945    pj_lock_release(tp->lock); 
    940946    pj_lock_release(mgr->lock); 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c

    r2131 r2180  
    10681068    tdata_op_key->tdata = NULL; 
    10691069 
    1070     /* Check for error/closure */ 
    1071     if (bytes_sent <= 0) { 
    1072         pj_status_t status; 
    1073  
    1074         PJ_LOG(5,(tcp->base.obj_name, "TCP send() error, sent=%d",  
    1075                   bytes_sent)); 
    1076  
    1077         status = (bytes_sent == 0) ? PJ_RETURN_OS_ERROR(OSERR_ENOTCONN) : 
    1078                                      -bytes_sent; 
    1079         if (tcp->close_reason==PJ_SUCCESS) tcp->close_reason = status; 
    1080         pjsip_transport_shutdown(&tcp->base); 
    1081     } 
    1082  
    10831070    if (tdata_op_key->callback) { 
    10841071        /* 
     
    10931080        pj_gettimeofday(&tcp->last_activity); 
    10941081    } 
     1082 
     1083    /* Check for error/closure */ 
     1084    if (bytes_sent <= 0) { 
     1085        pj_status_t status; 
     1086 
     1087        PJ_LOG(5,(tcp->base.obj_name, "TCP send() error, sent=%d",  
     1088                  bytes_sent)); 
     1089 
     1090        status = (bytes_sent == 0) ? PJ_RETURN_OS_ERROR(OSERR_ENOTCONN) : 
     1091                                     -bytes_sent; 
     1092        if (tcp->close_reason==PJ_SUCCESS) tcp->close_reason = status; 
     1093        pjsip_transport_shutdown(&tcp->base); 
     1094    } 
     1095 
    10951096} 
    10961097 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c

    r2131 r2180  
    18401840    tdata_op_key->tdata = NULL; 
    18411841 
     1842    if (tdata_op_key->callback) { 
     1843        /* 
     1844         * Notify sip_transport.c that packet has been sent. 
     1845         */ 
     1846        if (bytes_sent == 0) 
     1847            bytes_sent = -PJ_RETURN_OS_ERROR(OSERR_ENOTCONN); 
     1848 
     1849        tdata_op_key->callback(&tls->base, tdata_op_key->token, bytes_sent); 
     1850    } 
     1851 
    18421852    /* Check for error/closure */ 
    18431853    if (bytes_sent <= 0) { 
     
    18541864        /* Mark last activity */ 
    18551865        pj_gettimeofday(&tls->last_activity); 
    1856     } 
    1857  
    1858     if (tdata_op_key->callback) { 
    1859         /* 
    1860          * Notify sip_transport.c that packet has been sent. 
    1861          */ 
    1862         if (bytes_sent == 0) 
    1863             bytes_sent = -PJ_RETURN_OS_ERROR(OSERR_ENOTCONN); 
    1864  
    1865         tdata_op_key->callback(&tls->base, tdata_op_key->token, bytes_sent); 
    18661866    } 
    18671867} 
Note: See TracChangeset for help on using the changeset viewer.