Changeset 5997
- Timestamp:
- May 22, 2019 12:39:46 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/stun_sock.c
r5983 r5997 62 62 pj_ioqueue_op_key_t send_key; /* Default send key for app */ 63 63 pj_ioqueue_op_key_t int_send_key; /* Send key for internal */ 64 pj_status_t last_err; /* Last error status */ 64 65 65 66 pj_uint16_t tsx_id[6]; /* .. to match STUN msg */ … … 423 424 opt = PJ_DNS_SRV_FALLBACK_A; 424 425 426 stun_sock->last_err = PJ_SUCCESS; 425 427 status = pj_dns_srv_resolve(domain, &res_name, default_port, 426 428 stun_sock->pool, resolver, opt, … … 430 432 PJ_PERROR(4,(stun_sock->obj_name, status, 431 433 "Failed in pj_dns_srv_resolve()")); 434 } else { 435 /* DNS SRV callback may have been called here, such as when 436 * the result is cached, so we need to check the last error 437 * status. If the callback hasn't been called, processing 438 * will resume later. 439 */ 440 status = stun_sock->last_err; 441 if (stun_sock->last_err != PJ_SUCCESS) { 442 PJ_PERROR(4,(stun_sock->obj_name, status, 443 "Failed in sending Binding request (2)")); 444 } 432 445 } 433 434 /* Processing will resume when the DNS SRV callback is called */435 446 436 447 } else { … … 578 589 /* Handle error */ 579 590 if (status != PJ_SUCCESS) { 591 stun_sock->last_err = status; 580 592 sess_fail(stun_sock, PJ_STUN_SOCK_DNS_OP, status); 581 593 pj_grp_lock_release(stun_sock->grp_lock); … … 599 611 600 612 /* Start sending Binding request */ 601 get_mapped_addr(stun_sock);613 stun_sock->last_err = get_mapped_addr(stun_sock); 602 614 603 615 pj_grp_lock_release(stun_sock->grp_lock);
Note: See TracChangeset
for help on using the changeset viewer.