Ignore:
Timestamp:
Oct 27, 2016 5:47:06 AM (8 years ago)
Author:
ming
Message:

Fixed #1974: Various fixes for DNS IPv6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util/srv_resolver.c

    r5349 r5471  
    188188        } 
    189189        if (srv->q_aaaa) { 
    190             pj_dns_resolver_cancel_query(srv->q_aaaa, PJ_FALSE); 
     190            /* Check if it is a dummy query. */ 
     191            if (srv->q_aaaa != (pj_dns_async_query*)0x1) { 
     192                pj_dns_resolver_cancel_query(srv->q_aaaa, PJ_FALSE); 
     193                has_pending = PJ_TRUE; 
     194            } 
    191195            srv->q_aaaa = NULL; 
    192             has_pending = PJ_TRUE; 
    193196        } 
    194197    } 
     
    486489        srv->common_aaaa.type = PJ_DNS_TYPE_AAAA; 
    487490        srv->parent = query_job; 
     491        srv->q_a = NULL; 
     492        srv->q_aaaa = NULL; 
    488493 
    489494        status = PJ_SUCCESS; 
     
    492497        if ((query_job->option & PJ_DNS_SRV_RESOLVE_AAAA_ONLY) == 0) 
    493498        { 
     499            if ((query_job->option & PJ_DNS_SRV_RESOLVE_AAAA) != 0) { 
     500                /* If there will be DNS AAAA query too, let's setup 
     501                 * a dummy one here, otherwise app callback may be called 
     502                 * immediately (before DNS AAAA query is sent) when 
     503                 * DNS A record is available in the cache. 
     504                 */ 
     505                srv->q_aaaa = (pj_dns_async_query*)0x1; 
     506            } 
    494507            status = pj_dns_resolver_start_query(query_job->resolver, 
    495508                                                 &srv->target_name, 
Note: See TracChangeset for help on using the changeset viewer.