Changeset 866 for pjproject/trunk/pjsip/src/pjsip/sip_transport.c
- Timestamp:
- Dec 26, 2006 3:56:29 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r861 r866 639 639 { 640 640 int key_len; 641 pj_uint32_t hval; 642 void *entry; 641 643 642 644 /* Init. */ … … 647 649 648 650 /* 649 * Register to hash table .651 * Register to hash table (see Trac ticket #42). 650 652 */ 651 653 key_len = sizeof(tp->key.type) + tp->addr_len; 652 654 pj_lock_acquire(mgr->lock); 653 pj_hash_set(tp->pool, mgr->table, &tp->key, key_len, 0, tp); 655 656 /* If entry already occupied, unregister previous entry */ 657 hval = 0; 658 entry = pj_hash_get(mgr->table, &tp->key, key_len, &hval); 659 if (entry != NULL) 660 pj_hash_set(NULL, mgr->table, &tp->key, key_len, hval, NULL); 661 662 /* Register new entry */ 663 pj_hash_set(tp->pool, mgr->table, &tp->key, key_len, hval, tp); 664 654 665 pj_lock_release(mgr->lock); 655 666 … … 668 679 { 669 680 int key_len; 681 pj_uint32_t hval; 682 void *entry; 670 683 671 684 TRACE_((THIS_FILE, "Transport %s is being destroyed", tp->obj_name)); … … 684 697 685 698 /* 686 * Unregister from hash table .699 * Unregister from hash table (see Trac ticket #42). 687 700 */ 688 701 key_len = sizeof(tp->key.type) + tp->addr_len; 689 pj_assert(pj_hash_get(mgr->table, &tp->key, key_len, NULL) != NULL); 690 pj_hash_set(tp->pool, mgr->table, &tp->key, key_len, 0, NULL); 702 hval = 0; 703 entry = pj_hash_get(mgr->table, &tp->key, key_len, &hval); 704 if (entry == (void*)tp) 705 pj_hash_set(NULL, mgr->table, &tp->key, key_len, hval, NULL); 691 706 692 707 pj_lock_release(mgr->lock);
Note: See TracChangeset
for help on using the changeset viewer.