- Timestamp:
- Nov 3, 2007 10:44:14 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/nat_detect.c
r1526 r1546 103 103 pj_sockaddr_in ma; 104 104 pj_sockaddr_in ca; 105 pj_stun_tx_data *tdata; 105 106 } result[ST_MAX]; 106 107 … … 549 550 } 550 551 551 if (test_id == ST_TEST_1 && status == PJ_SUCCESS) { 552 /* Send Test 1B only when Test 2 completes. Must not send Test 1B 553 * before Test 2 completes to avoid creating mapping on the NAT. 554 */ 555 if (!sess->result[ST_TEST_1B].executed && 556 sess->result[ST_TEST_2].complete && 557 sess->result[ST_TEST_2].status != PJ_SUCCESS && 558 sess->result[ST_TEST_1].complete && 559 sess->result[ST_TEST_1].status == PJ_SUCCESS) 560 { 552 561 cmp = pj_memcmp(&sess->local_addr, &sess->result[ST_TEST_1].ma, 553 562 sizeof(pj_sockaddr_in)); 554 563 if (cmp != 0) 555 send_test(sess, ST_TEST_1B, &sess->result[ test_id].ca, 0);564 send_test(sess, ST_TEST_1B, &sess->result[ST_TEST_1].ca, 0); 556 565 } 557 566 … … 760 769 pj_uint32_t change_flag) 761 770 { 762 pj_stun_tx_data *tdata;763 771 pj_uint32_t magic, tsx_id[3]; 764 772 pj_status_t status; … … 778 786 status = pj_stun_session_create_req(sess->stun_sess, 779 787 PJ_STUN_BINDING_REQUEST, magic, 780 (pj_uint8_t*)tsx_id, &tdata); 788 (pj_uint8_t*)tsx_id, 789 &sess->result[test_id].tdata); 781 790 if (status != PJ_SUCCESS) 782 791 goto on_error; 783 792 784 793 /* Add CHANGE-REQUEST attribute */ 785 status = pj_stun_msg_add_uint_attr(sess->pool, tdata->msg, 794 status = pj_stun_msg_add_uint_attr(sess->pool, 795 sess->result[test_id].tdata->msg, 786 796 PJ_STUN_ATTR_CHANGE_REQUEST, 787 797 change_flag); … … 805 815 sess->cur_server, 806 816 sizeof(pj_sockaddr_in), 807 tdata);817 sess->result[test_id].tdata); 808 818 if (status != PJ_SUCCESS) 809 819 goto on_error;
Note: See TracChangeset
for help on using the changeset viewer.