Ignore:
Timestamp:
Jul 18, 2006 12:10:53 AM (18 years ago)
Author:
bennylp
Message:

Fixed several bugs related to TCP:

File:
1 edited

Legend:

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

    r605 r610  
    12411241    tcp = pj_ioqueue_get_user_data(key); 
    12421242 
     1243    /* Mark that pending connect() operation has completed. */ 
     1244    tcp->has_pending_connect = PJ_FALSE; 
     1245 
     1246    /* Check connect() status */ 
     1247    if (status != PJ_SUCCESS) { 
     1248 
     1249        tcp_perror(tcp->base.obj_name, "TCP connect() error", status); 
     1250 
     1251        /* Cancel all delayed transmits */ 
     1252        while (!pj_list_empty(&tcp->delayed_list)) { 
     1253            struct delayed_tdata *pending_tx; 
     1254            pj_ioqueue_op_key_t *op_key; 
     1255 
     1256            pending_tx = tcp->delayed_list.next; 
     1257            pj_list_erase(pending_tx); 
     1258 
     1259            op_key = (pj_ioqueue_op_key_t*)pending_tx->tdata_op_key; 
     1260 
     1261            on_write_complete(tcp->key, op_key, -status); 
     1262        } 
     1263 
     1264        /* We can not destroy the transport since high level objects may 
     1265         * still keep reference to this transport. So we can only  
     1266         * instruct transport manager to gracefully start the shutdown 
     1267         * procedure for this transport. 
     1268         */ 
     1269        if (tcp->close_reason==PJ_SUCCESS) tcp->close_reason = status; 
     1270        pjsip_transport_shutdown(&tcp->base); 
     1271        return; 
     1272    } 
     1273 
    12431274    PJ_LOG(4,(tcp->base.obj_name,  
    12441275              "TCP transport %.*s:%d is connected to %.*s:%d", 
     
    12501281              tcp->base.remote_name.port)); 
    12511282 
    1252     /* Mark that pending connect() operation has completed. */ 
    1253     tcp->has_pending_connect = PJ_FALSE; 
    1254  
    1255     /* Check connect() status */ 
    1256     if (status != PJ_SUCCESS) { 
    1257  
    1258         tcp_perror(tcp->base.obj_name, "TCP connect() error", status); 
    1259  
    1260         /* We can not destroy the transport since high level objects may 
    1261          * still keep reference to this transport. So we can only  
    1262          * instruct transport manager to gracefully start the shutdown 
    1263          * procedure for this transport. 
    1264          */ 
    1265         if (tcp->close_reason==PJ_SUCCESS) tcp->close_reason = status; 
    1266         pjsip_transport_shutdown(&tcp->base); 
    1267         return; 
    1268     } 
    12691283 
    12701284    /* Update (again) local address, just in case local address currently 
Note: See TracChangeset for help on using the changeset viewer.