Changeset 5369


Ignore:
Timestamp:
Jun 29, 2016 9:19:01 AM (3 years ago)
Author:
nanang
Message:

Re #1926: Fixed bug of premature app callback invocation in DNS A+AAAA resolution when DNS A record is available in the cache.

File:
1 edited

Legend:

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

    r5349 r5369  
    218218     * explicitly set. 
    219219     */ 
     220#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6==1 
    220221    if ((ip_addr_ver == 6) || (type & PJSIP_TRANSPORT_IPV6)) 
    221222        af = pj_AF_INET6(); 
    222223    else if (ip_addr_ver == 4) 
    223224        af = pj_AF_INET(); 
     225#else 
     226    /* IPv6 is disabled, will resolving IPv6 address be useful? */ 
     227    af = pj_AF_INET(); 
     228#endif 
    224229 
    225230    /* Set the transport type if not explicitly specified.  
     
    431436        /* Resolve DNS A record if address family is not fixed to IPv6 */ 
    432437        if (af != pj_AF_INET6()) { 
     438 
     439            /* If there will be DNS AAAA query too, let's setup a dummy one 
     440             * here, otherwise app callback may be called immediately (before 
     441             * DNS AAAA query is sent) when DNS A record is available in the 
     442             * cache. 
     443             */ 
     444            if (af == pj_AF_UNSPEC()) 
     445                query->object6 = (pj_dns_async_query*)0x1; 
     446 
    433447            status = pj_dns_resolver_start_query(resolver->res,  
    434448                                                 &query->naptr[0].name, 
Note: See TracChangeset for help on using the changeset viewer.