Changeset 119 for pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
- Timestamp:
- Jan 10, 2006 1:31:40 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r115 r119 500 500 * Register the transaction to the hash table. 501 501 */ 502 static voidmod_tsx_layer_register_tsx( pjsip_transaction *tsx)502 static pj_status_t mod_tsx_layer_register_tsx( pjsip_transaction *tsx) 503 503 { 504 504 pj_assert(tsx->transaction_key.slen != 0); 505 //pj_assert(tsx->state != PJSIP_TSX_STATE_NULL);506 505 507 506 /* Lock hash table mutex. */ 508 507 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 } 509 516 510 517 /* Register the transaction to the hash table. */ … … 514 521 /* Unlock mutex. */ 515 522 pj_mutex_unlock(mod_tsx_layer.mutex); 523 524 return PJ_SUCCESS; 516 525 } 517 526 … … 1051 1060 1052 1061 /* 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 } 1054 1068 1055 1069 … … 1160 1174 1161 1175 /* 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 } 1164 1181 1165 1182 /* Unlock transaction and return. */ … … 1541 1558 msec_time = (1 << (tsx->retransmit_count)) * PJSIP_T1_TIMEOUT; 1542 1559 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 } 1545 1570 1546 1571 timeout.sec = msec_time / 1000;
Note: See TracChangeset
for help on using the changeset viewer.