Changeset 5471
- Timestamp:
- Oct 27, 2016 5:47:06 AM (8 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/src/pjlib-util/resolver.c
r5464 r5471 857 857 struct res_key key; 858 858 struct cached_res *cache; 859 pj_dns_async_query *q ;859 pj_dns_async_query *q, *p_q = NULL; 860 860 pj_uint32_t hval; 861 861 pj_status_t status = PJ_SUCCESS; … … 870 870 /* Check type */ 871 871 PJ_ASSERT_RETURN(type > 0 && type < 0xFFFF, PJ_EINVAL); 872 873 if (p_query)874 *p_query = NULL;875 872 876 873 /* Build resource key for looking up hash tables */ … … 992 989 0, q->hbufkey, q); 993 990 991 p_q = q; 992 993 on_return: 994 994 if (p_query) 995 *p_query = q; 996 997 on_return: 995 *p_query = p_q; 996 998 997 pj_mutex_unlock(resolver->mutex); 999 998 return status; -
pjproject/trunk/pjlib-util/src/pjlib-util/srv_resolver.c
r5349 r5471 188 188 } 189 189 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 } 191 195 srv->q_aaaa = NULL; 192 has_pending = PJ_TRUE;193 196 } 194 197 } … … 486 489 srv->common_aaaa.type = PJ_DNS_TYPE_AAAA; 487 490 srv->parent = query_job; 491 srv->q_a = NULL; 492 srv->q_aaaa = NULL; 488 493 489 494 status = PJ_SUCCESS; … … 492 497 if ((query_job->option & PJ_DNS_SRV_RESOLVE_AAAA_ONLY) == 0) 493 498 { 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 } 494 507 status = pj_dns_resolver_start_query(query_job->resolver, 495 508 &srv->target_name, -
pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
r5425 r5471 454 454 455 455 /* Resolve DNS AAAA record if address family is not fixed to IPv4 */ 456 if (af != pj_AF_INET() ) {456 if (af != pj_AF_INET() && status == PJ_SUCCESS) { 457 457 status = pj_dns_resolver_start_query(resolver->res, 458 458 &query->naptr[0].name, … … 532 532 ++srv->count; 533 533 } 534 535 } else {536 534 } 535 536 if (status != PJ_SUCCESS) { 537 537 char errmsg[PJ_ERR_MSG_SIZE]; 538 538 … … 595 595 ++srv->count; 596 596 } 597 598 } else {599 597 } 598 599 if (status != PJ_SUCCESS) { 600 600 char errmsg[PJ_ERR_MSG_SIZE]; 601 601
Note: See TracChangeset
for help on using the changeset viewer.