Changeset 5485 for pjproject


Ignore:
Timestamp:
Nov 17, 2016 4:38:25 AM (8 years ago)
Author:
ming
Message:

Fixed #1979: Add support to parse address string with scope ID

Location:
pjproject/trunk/pjlib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj/compat/os_auto.h.in

    r5480 r5485  
    182182     /* Disable local host resolution in pj_gethostip() (see ticket #1342) */ 
    183183#    define PJ_GETHOSTIP_DISABLE_LOCAL_RESOLUTION 1 
     184     /* Use pj_getaddrinfo() (instead of pj_inet_pton()) in 
     185      * pj_sockaddr_set_str_addr() 
     186      */ 
     187#    define PJ_SOCKADDR_USE_GETADDRINFO 1 
    184188 
    185189#    include "TargetConditionals.h" 
  • pjproject/trunk/pjlib/src/pj/sock_common.c

    r5444 r5485  
    173173 
    174174    if (str_addr && str_addr->slen) { 
     175#if defined(PJ_SOCKADDR_USE_GETADDRINFO) && PJ_SOCKADDR_USE_GETADDRINFO!=0 
     176        if (1) { 
     177#else 
    175178        status = pj_inet_pton(PJ_AF_INET6, str_addr, &addr->ipv6.sin6_addr); 
    176179        if (status != PJ_SUCCESS) { 
     180#endif 
    177181            pj_addrinfo ai; 
    178182            unsigned count = 1; 
     
    182186                pj_memcpy(&addr->ipv6.sin6_addr, &ai.ai_addr.ipv6.sin6_addr, 
    183187                          sizeof(addr->ipv6.sin6_addr)); 
     188                addr->ipv6.sin6_scope_id = ai.ai_addr.ipv6.sin6_scope_id; 
    184189            } 
    185190        } 
Note: See TracChangeset for help on using the changeset viewer.