- Timestamp:
- Apr 17, 2008 5:25:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/ice-turn07/pjnath/src/pjnath/ice_session.c
r1926 r1932 107 107 struct msg_data 108 108 { 109 pj_bool_t is_request; 109 pj_bool_t is_request; 110 unsigned cand_id; 110 111 111 112 union data { … … 115 116 unsigned ckid; 116 117 } req; 117 118 struct response_data {119 unsigned cand_id;120 } res;121 118 } data; 122 119 }; … … 1401 1398 * completes and on_stun_request_complete() callback is called. 1402 1399 */ 1403 msg_data = PJ_POOL_ZALLOC_T( check->tdata->pool, struct msg_data);1400 msg_data = PJ_POOL_ZALLOC_T(ice->pool, struct msg_data); 1404 1401 msg_data->is_request = PJ_TRUE; 1402 msg_data->cand_id = lcand - ice->lcand; 1405 1403 msg_data->data.req.ice = ice; 1406 1404 msg_data->data.req.clist = clist; … … 1668 1666 unsigned cand_id; 1669 1667 1670 if (msg_data->is_request) { 1671 pj_ice_sess_checklist *clist = msg_data->data.req.clist; 1672 pj_ice_sess_cand *lcand = clist->checks[msg_data->data.req.ckid].lcand; 1673 1674 cand_id = lcand - ice->lcand; 1675 1676 } else { 1677 cand_id = msg_data->data.res.cand_id; 1678 } 1668 cand_id = msg_data->cand_id; 1679 1669 1680 1670 return (*ice->cb.on_tx_pkt)(ice, sd->comp_id, cand_id, … … 1940 1930 { 1941 1931 stun_data *sd; 1942 unsigned *param_cand_id;1932 //unsigned *param_cand_id; 1943 1933 const pj_stun_msg *msg = rdata->msg; 1944 1934 struct msg_data *msg_data; … … 1962 1952 * whether to send packet using local socket or the relay. 1963 1953 */ 1964 param_cand_id = (unsigned*)token;1954 //param_cand_id = (unsigned*)token; 1965 1955 1966 1956 /* Reject any requests except Binding request */ … … 2073 2063 2074 2064 /* Create a msg_data to be associated with this response */ 2075 msg_data = PJ_POOL_ZALLOC_T( tdata->pool, struct msg_data);2065 msg_data = PJ_POOL_ZALLOC_T(ice->pool, struct msg_data); 2076 2066 msg_data->is_request = PJ_FALSE; 2077 msg_data-> data.res.cand_id = *param_cand_id;2067 msg_data->cand_id = ((struct msg_data*)token)->cand_id; 2078 2068 2079 2069 /* Send the response */ … … 2389 2379 pj_status_t status = PJ_SUCCESS; 2390 2380 pj_ice_sess_comp *comp; 2381 struct msg_data *msg_data; 2391 2382 pj_status_t stun_status; 2392 2383 … … 2401 2392 } 2402 2393 2394 msg_data = PJ_POOL_ZALLOC_T(ice->pool, struct msg_data); 2395 msg_data->is_request = PJ_FALSE; 2396 msg_data->cand_id = cand_id; 2397 2403 2398 stun_status = pj_stun_msg_check((const pj_uint8_t*)pkt, pkt_size, 2404 2399 PJ_STUN_IS_DATAGRAM); 2405 2400 if (stun_status == PJ_SUCCESS) { 2406 2401 status = pj_stun_session_on_rx_pkt(comp->stun_sess, pkt, pkt_size, 2407 PJ_STUN_IS_DATAGRAM, &cand_id,2402 PJ_STUN_IS_DATAGRAM, msg_data, 2408 2403 NULL, src_addr, src_addr_len); 2409 2404 if (status != PJ_SUCCESS) {
Note: See TracChangeset
for help on using the changeset viewer.