Ignore:
Timestamp:
Aug 16, 2018 2:56:52 AM (4 years ago)
Author:
nanang
Message:

Fix #2138:

  • Updated ICE STUN & host candidates generation to be more forgiving on errors, i.e: continue gathering candidates using any available data instead of returning error.
  • Added more logs for debugging.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/stun_sock.c

    r5678 r5861  
    427427                                    stun_sock, &dns_srv_resolver_cb,  
    428428                                    &stun_sock->q); 
     429        if (status != PJ_SUCCESS) { 
     430            PJ_PERROR(4,(stun_sock->obj_name, status, 
     431                         "Failed in pj_dns_srv_resolve()")); 
     432        } 
    429433 
    430434        /* Processing will resume when the DNS SRV callback is called */ 
     
    441445 
    442446            if (status != PJ_SUCCESS) { 
     447                PJ_PERROR(4,(stun_sock->obj_name, status, 
     448                             "Failed in pj_getaddrinfo()")); 
    443449                pj_grp_lock_release(stun_sock->grp_lock); 
    444450                return status; 
     
    452458        /* Start sending Binding request */ 
    453459        status = get_mapped_addr(stun_sock); 
     460        if (status != PJ_SUCCESS) { 
     461            PJ_PERROR(4,(stun_sock->obj_name, status, 
     462                         "Failed in sending Binding request")); 
     463        } 
    454464    } 
    455465 
     
    667677        status = pj_gethostip(stun_sock->af, &def_addr); 
    668678        if (status != PJ_SUCCESS) { 
     679            PJ_PERROR(4,(stun_sock->obj_name, status, 
     680                         "Failed in getting default address for STUN info")); 
    669681            pj_grp_lock_release(stun_sock->grp_lock); 
    670682            return status; 
     
    678690                                      info->aliases); 
    679691        if (status != PJ_SUCCESS) { 
    680             pj_grp_lock_release(stun_sock->grp_lock); 
    681             return status; 
     692            /* If enumeration fails, just return the default address */ 
     693            PJ_PERROR(4,(stun_sock->obj_name, status, 
     694                         "Failed in enumerating interfaces for STUN info, " 
     695                         "returning default address only")); 
     696            info->alias_cnt = 1; 
     697            pj_sockaddr_cp(&info->aliases[0], &def_addr); 
    682698        } 
    683699 
Note: See TracChangeset for help on using the changeset viewer.