Changeset 5564


Ignore:
Timestamp:
Mar 8, 2017 4:33:47 AM (8 years ago)
Author:
riza
Message:

Re #1994 (misc): Add IPv6 transport type support in pjsip_transport_register_type().
Thanks to Joshua Colp for the patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_transport.c

    r5559 r5564  
    254254{ 
    255255    unsigned i; 
     256    pjsip_transport_type_e parent = 0; 
    256257 
    257258    PJ_ASSERT_RETURN(tp_flag && tp_name && def_port, PJ_EINVAL); 
     
    261262 
    262263    for (i=1; i<PJ_ARRAY_SIZE(transport_names); ++i) { 
     264        if (tp_flag & PJSIP_TRANSPORT_IPV6 &&  
     265            pj_stricmp2(&transport_names[i].name, tp_name) == 0) 
     266        { 
     267            parent = transport_names[i].type; 
     268        } 
    263269        if (transport_names[i].type == 0) 
    264270            break; 
     
    268274        return PJ_ETOOMANY; 
    269275 
    270     transport_names[i].type = (pjsip_transport_type_e)i; 
     276    if (tp_flag & PJSIP_TRANSPORT_IPV6 && parent) { 
     277        transport_names[i].type = parent | PJSIP_TRANSPORT_IPV6; 
     278    } else { 
     279        transport_names[i].type = (pjsip_transport_type_e)i; 
     280    } 
     281 
    271282    transport_names[i].port = (pj_uint16_t)def_port; 
    272283    pj_ansi_strcpy(transport_names[i].name_buf, tp_name); 
     
    275286 
    276287    if (p_tp_type) 
    277         *p_tp_type = i; 
     288        *p_tp_type = transport_names[i].type; 
    278289 
    279290    return PJ_SUCCESS; 
Note: See TracChangeset for help on using the changeset viewer.