Changeset 3110 for pjproject/trunk/pjsip/src/pjsip/sip_transport.c
- Timestamp:
- Feb 25, 2010 11:58:19 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r3106 r3110 867 867 * Register to hash table (see Trac ticket #42). 868 868 */ 869 key_len = sizeof(tp->key.type) + sizeof(tp->key.hname) +tp->addr_len;869 key_len = sizeof(tp->key.type) + tp->addr_len; 870 870 pj_lock_acquire(mgr->lock); 871 871 … … 917 917 * Unregister from hash table (see Trac ticket #42). 918 918 */ 919 key_len = sizeof(tp->key.type) + sizeof(tp->key.hname) +tp->addr_len;919 key_len = sizeof(tp->key.type) + tp->addr_len; 920 920 hval = 0; 921 921 entry = pj_hash_get(mgr->table, &tp->key, key_len, &hval); … … 1592 1592 pjsip_transport *transport; 1593 1593 1594 /*1595 * Find factory that can create such transport.1596 */1597 factory = mgr->factory_list.next;1598 while (factory != &mgr->factory_list) {1599 if (factory->type == type)1600 break;1601 factory = factory->next;1602 }1603 if (factory == &mgr->factory_list)1604 factory = NULL;1605 1606 1594 pj_bzero(&key, sizeof(key)); 1607 key_len = sizeof(key.type) + sizeof(key.hname) +addr_len;1595 key_len = sizeof(key.type) + addr_len; 1608 1596 1609 1597 /* First try to get exact destination. */ 1610 1598 key.type = type; 1611 1599 pj_memcpy(&key.rem_addr, remote, addr_len); 1612 if (factory && factory->create_transport2 &&1613 tdata && tdata->dest_info.name.slen)1614 {1615 /* Only include hostname hash in the key when the factory support1616 * create_transport2() and tdata is supplied.1617 */1618 key.hname = pj_hash_calc_tolower(0,1619 (char*)tdata->dest_info.name.ptr,1620 &tdata->dest_info.name);1621 }1622 1600 1623 1601 transport = (pjsip_transport*) … … 1636 1614 1637 1615 pj_bzero(addr, addr_len); 1638 key_len = sizeof(key.type) + sizeof(key.hname) +addr_len;1616 key_len = sizeof(key.type) + addr_len; 1639 1617 transport = (pjsip_transport*) 1640 1618 pj_hash_get(mgr->table, &key, key_len, NULL); … … 1649 1627 addr->addr.sa_family = remote_addr->addr.sa_family; 1650 1628 1651 key_len = sizeof(key.type) + sizeof(key.hname) +addr_len;1629 key_len = sizeof(key.type) + addr_len; 1652 1630 transport = (pjsip_transport*) 1653 1631 pj_hash_get(mgr->table, &key, key_len, NULL); … … 1669 1647 /* 1670 1648 * Transport not found! 1649 * Find factory that can create such transport. 1671 1650 */ 1672 if (NULL == factory) { 1651 factory = mgr->factory_list.next; 1652 while (factory != &mgr->factory_list) { 1653 if (factory->type == type) 1654 break; 1655 factory = factory->next; 1656 } 1657 1658 if (factory == &mgr->factory_list) { 1673 1659 /* No factory can create the transport! */ 1674 1660 pj_lock_release(mgr->lock); … … 1678 1664 } 1679 1665 1680 1681 1666 TRACE_((THIS_FILE, "Creating new transport from factory")); 1682 1667
Note: See TracChangeset
for help on using the changeset viewer.