Changeset 866 for pjproject/trunk
- Timestamp:
- Dec 26, 2006 3:56:29 AM (18 years ago)
- Location:
- pjproject/trunk/pjsip/src/pjsip
- Files:
-
- 2 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); -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
r808 r866 1222 1222 1223 1223 /* Socket error. */ 1224 PJ_LOG(4,(tcp->base.obj_name, "TCP connection reset")); 1224 1225 1225 1226 /* We can not destroy the transport since high level objects may … … 1263 1264 } else { 1264 1265 /* Socket error */ 1266 PJ_LOG(4,(tcp->base.obj_name, "TCP connection reset")); 1265 1267 1266 1268 /* We can not destroy the transport since high level objects may
Note: See TracChangeset
for help on using the changeset viewer.