Ignore:
Timestamp:
Jan 10, 2006 1:31:40 PM (18 years ago)
Author:
bennylp
Message:

Renamed pjsip_url to pjsip_sip_uri

File:
1 edited

Legend:

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

    r115 r119  
    500500 * Register the transaction to the hash table. 
    501501 */ 
    502 static void mod_tsx_layer_register_tsx( pjsip_transaction *tsx) 
     502static pj_status_t mod_tsx_layer_register_tsx( pjsip_transaction *tsx) 
    503503{ 
    504504    pj_assert(tsx->transaction_key.slen != 0); 
    505     //pj_assert(tsx->state != PJSIP_TSX_STATE_NULL); 
    506505 
    507506    /* Lock hash table mutex. */ 
    508507    pj_mutex_lock(mod_tsx_layer.mutex); 
     508 
     509    /* Check if no transaction with the same key exists. */ 
     510    if (pj_hash_get( mod_tsx_layer.htable, &tsx->transaction_key.ptr, 
     511                     tsx->transaction_key.slen) != NULL) 
     512    { 
     513        pj_mutex_unlock(mod_tsx_layer.mutex); 
     514        return PJ_EEXISTS; 
     515    } 
    509516 
    510517    /* Register the transaction to the hash table. */ 
     
    514521    /* Unlock mutex. */ 
    515522    pj_mutex_unlock(mod_tsx_layer.mutex); 
     523 
     524    return PJ_SUCCESS; 
    516525} 
    517526 
     
    10511060 
    10521061    /* Register transaction to hash table. */ 
    1053     mod_tsx_layer_register_tsx(tsx); 
     1062    status = mod_tsx_layer_register_tsx(tsx); 
     1063    if (status != PJ_SUCCESS) { 
     1064        pj_assert(!"Bug in branch_param generator (i.e. not unique)"); 
     1065        tsx_destroy(tsx); 
     1066        return status; 
     1067    } 
    10541068 
    10551069 
     
    11601174 
    11611175    /* Register the transaction. */ 
    1162     mod_tsx_layer_register_tsx(tsx); 
    1163  
     1176    status = mod_tsx_layer_register_tsx(tsx); 
     1177    if (status != PJ_SUCCESS) { 
     1178        tsx_destroy(tsx); 
     1179        return status; 
     1180    } 
    11641181 
    11651182    /* Unlock transaction and return. */ 
     
    15411558    msec_time = (1 << (tsx->retransmit_count)) * PJSIP_T1_TIMEOUT; 
    15421559 
    1543     if (msec_time>PJSIP_T2_TIMEOUT && tsx->method.id!=PJSIP_INVITE_METHOD) 
    1544         msec_time = PJSIP_T2_TIMEOUT; 
     1560    if (tsx->role == PJSIP_ROLE_UAC) { 
     1561        /* Retransmission for non-INVITE transaction caps-off at T2 */ 
     1562        if (msec_time>PJSIP_T2_TIMEOUT && tsx->method.id!=PJSIP_INVITE_METHOD) 
     1563            msec_time = PJSIP_T2_TIMEOUT; 
     1564    } else { 
     1565        /* Retransmission of INVITE final response also caps-off at T2 */ 
     1566        pj_assert(tsx->status_code >= 200); 
     1567        if (msec_time>PJSIP_T2_TIMEOUT) 
     1568            msec_time = PJSIP_T2_TIMEOUT; 
     1569    } 
    15451570 
    15461571    timeout.sec = msec_time / 1000; 
Note: See TracChangeset for help on using the changeset viewer.