Ignore:
Timestamp:
Apr 17, 2008 5:25:37 PM (14 years ago)
Author:
bennylp
Message:

SIPit ICE test: fixed crashed with ICE negotiation, fixed empty (0.0.0.0) srflx addr, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/ice-turn07/pjnath/src/pjnath/ice_session.c

    r1926 r1932  
    107107struct msg_data 
    108108{ 
    109     pj_bool_t                        is_request; 
     109    pj_bool_t   is_request; 
     110    unsigned    cand_id; 
    110111 
    111112    union data { 
     
    115116            unsigned                 ckid; 
    116117        } req; 
    117  
    118         struct response_data { 
    119             unsigned                 cand_id; 
    120         } res; 
    121118    } data; 
    122119}; 
     
    14011398     * completes and on_stun_request_complete() callback is called. 
    14021399     */ 
    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); 
    14041401    msg_data->is_request = PJ_TRUE; 
     1402    msg_data->cand_id = lcand - ice->lcand; 
    14051403    msg_data->data.req.ice = ice; 
    14061404    msg_data->data.req.clist = clist; 
     
    16681666    unsigned cand_id; 
    16691667     
    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; 
    16791669 
    16801670    return (*ice->cb.on_tx_pkt)(ice, sd->comp_id, cand_id, 
     
    19401930{ 
    19411931    stun_data *sd; 
    1942     unsigned *param_cand_id; 
     1932    //unsigned *param_cand_id; 
    19431933    const pj_stun_msg *msg = rdata->msg; 
    19441934    struct msg_data *msg_data; 
     
    19621952     *  whether to send packet using local socket or the relay. 
    19631953     */ 
    1964     param_cand_id = (unsigned*)token; 
     1954    //param_cand_id = (unsigned*)token; 
    19651955 
    19661956    /* Reject any requests except Binding request */ 
     
    20732063 
    20742064    /* 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); 
    20762066    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; 
    20782068 
    20792069    /* Send the response */ 
     
    23892379    pj_status_t status = PJ_SUCCESS; 
    23902380    pj_ice_sess_comp *comp; 
     2381    struct msg_data *msg_data; 
    23912382    pj_status_t stun_status; 
    23922383 
     
    24012392    } 
    24022393 
     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 
    24032398    stun_status = pj_stun_msg_check((const pj_uint8_t*)pkt, pkt_size,  
    24042399                                    PJ_STUN_IS_DATAGRAM); 
    24052400    if (stun_status == PJ_SUCCESS) { 
    24062401        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, 
    24082403                                           NULL, src_addr, src_addr_len); 
    24092404        if (status != PJ_SUCCESS) { 
Note: See TracChangeset for help on using the changeset viewer.