Changeset 127 for pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
- Timestamp:
- Jan 30, 2006 6:40:05 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r123 r127 62 62 PJSIP_MOD_PRIORITY_TSX_LAYER, /* Priority. */ 63 63 NULL, /* User_data. */ 64 0, /* Methods count. */65 { NULL }, /* Array of methods. */66 64 mod_tsx_layer_load, /* load(). */ 67 65 mod_tsx_layer_start, /* start() */ … … 508 506 509 507 /* 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 } 508 PJ_ASSERT_ON_FAIL(pj_hash_get( mod_tsx_layer.htable, 509 &tsx->transaction_key.ptr, 510 tsx->transaction_key.slen, 511 &tsx->hashed_key) == NULL, 512 { 513 pj_mutex_unlock(mod_tsx_layer.mutex); 514 return PJ_EEXISTS; 515 } 516 ); 516 517 517 518 /* Register the transaction to the hash table. */ 518 519 pj_hash_set( tsx->pool, mod_tsx_layer.htable, tsx->transaction_key.ptr, 519 tsx->transaction_key.slen, tsx );520 tsx->transaction_key.slen, tsx->hashed_key, tsx); 520 521 521 522 /* Unlock mutex. */ … … 539 540 /* Register the transaction to the hash table. */ 540 541 pj_hash_set( NULL, mod_tsx_layer.htable, tsx->transaction_key.ptr, 541 tsx->transaction_key.slen, NULL);542 tsx->transaction_key.slen, tsx->hashed_key, NULL); 542 543 543 544 /* Unlock mutex. */ … … 555 556 556 557 pj_mutex_lock(mod_tsx_layer.mutex); 557 tsx = pj_hash_get( mod_tsx_layer.htable, key->ptr, key->slen );558 tsx = pj_hash_get( mod_tsx_layer.htable, key->ptr, key->slen, NULL ); 558 559 pj_mutex_unlock(mod_tsx_layer.mutex); 559 560 … … 649 650 pj_mutex_lock( mod_tsx_layer.mutex ); 650 651 651 tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen );652 tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, NULL ); 652 653 653 654 if (tsx == NULL || tsx->state == PJSIP_TSX_STATE_TERMINATED) { … … 690 691 pj_mutex_lock( mod_tsx_layer.mutex ); 691 692 692 tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen );693 tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, NULL ); 693 694 694 695 if (tsx == NULL || tsx->state == PJSIP_TSX_STATE_TERMINATED) { … … 1036 1037 &via->branch_param); 1037 1038 1039 /* Calculate hashed key value. */ 1040 tsx->hashed_key = pj_hash_calc(0, tsx->transaction_key.ptr, 1041 tsx->transaction_key.slen); 1042 1038 1043 PJ_LOG(6, (tsx->obj_name, "tsx_key=%.*s", tsx->transaction_key.slen, 1039 1044 tsx->transaction_key.ptr)); … … 1141 1146 } 1142 1147 1148 /* Calculate hashed key value. */ 1149 tsx->hashed_key = pj_hash_calc(0, tsx->transaction_key.ptr, 1150 tsx->transaction_key.slen); 1151 1143 1152 /* Duplicate branch parameter for transaction. */ 1144 1153 branch = &rdata->msg_info.via->branch_param; … … 1179 1188 return status; 1180 1189 } 1190 1191 /* Put this transaction in rdata's mod_data. */ 1192 rdata->endpt_info.mod_data[mod_tsx_layer.mod.id] = tsx; 1181 1193 1182 1194 /* Unlock transaction and return. */
Note: See TracChangeset
for help on using the changeset viewer.