Changeset 5559


Ignore:
Timestamp:
Feb 20, 2017 2:11:46 AM (8 years ago)
Author:
riza
Message:

Re #1994 (misc): Don't try to resolve a DNS SRV query that is already considered resolved.
Thanks to Richard Mudgett for the patch.

Location:
pjproject/trunk
Files:
2 edited

Legend:

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

    r5536 r5559  
    408408        pj_in_addr addr; 
    409409        pj_in6_addr addr6; 
    410  
    411         if (query_job->srv[i].addr_cnt != 0) { 
     410        unsigned cnt = query_job->srv[i].addr_cnt; 
     411 
     412        if (cnt != 0) { 
    412413            /* IP address already resolved */ 
    413414            continue; 
     
    418419                         &addr) == PJ_SUCCESS) 
    419420        { 
    420             unsigned cnt = query_job->srv[i].addr_cnt; 
    421421            pj_sockaddr_init(pj_AF_INET(), &query_job->srv[i].addr[cnt], 
    422422                             NULL, query_job->srv[i].port); 
     
    428428                                &addr6) == PJ_SUCCESS) 
    429429        { 
    430             unsigned cnt = query_job->srv[i].addr_cnt; 
    431430            pj_sockaddr_init(pj_AF_INET6(), &query_job->srv[i].addr[cnt], 
    432431                             NULL, query_job->srv[i].port); 
     
    481480        struct srv_target *srv = &query_job->srv[i]; 
    482481 
     482        if (srv->addr_cnt != 0) { 
     483            /* 
     484             * This query is already counted as resolved because of the 
     485             * additional records in the SRV response or the target name 
     486             * is an IP address exception in build_server_entries(). 
     487             */ 
     488            continue; 
     489        } 
     490 
    483491        PJ_LOG(5, (query_job->objname,  
    484492                   "Starting async DNS A query_job for %.*s", 
     
    494502        status = PJ_SUCCESS; 
    495503 
    496         /* Start DNA A record query */ 
     504        /* Start DNS A record query */ 
    497505        if ((query_job->option & PJ_DNS_SRV_RESOLVE_AAAA_ONLY) == 0) 
    498506        { 
     
    512520        } 
    513521 
    514         /* Start DNA AAAA record query */ 
     522        /* Start DNS AAAA record query */ 
    515523        if (status == PJ_SUCCESS && 
    516524            (query_job->option & PJ_DNS_SRV_RESOLVE_AAAA) != 0) 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport.c

    r5556 r5559  
    423423    tdata->pool = pool; 
    424424    tdata->mgr = mgr; 
    425     pj_memcpy(tdata->obj_name, pool->obj_name, PJ_MAX_OBJ_NAME); 
     425    pj_ansi_snprintf(tdata->obj_name, sizeof(tdata->obj_name), "tdta%p", tdata); 
     426    pj_memcpy(pool->obj_name, tdata->obj_name, sizeof(pool->obj_name)); 
    426427 
    427428    status = pj_atomic_create(tdata->pool, 0, &tdata->ref_cnt); 
Note: See TracChangeset for help on using the changeset viewer.