Ignore:
Timestamp:
Mar 24, 2007 1:00:30 PM (17 years ago)
Author:
bennylp
Message:

ICE (work in progress): implement error codes

File:
1 edited

Legend:

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

    r1099 r1101  
    365365 
    366366    /* Component ID must be valid */ 
    367     PJ_ASSERT_RETURN(comp_id <= PJ_ICE_MAX_COMP, PJ_EICEINCOMPID); 
     367    PJ_ASSERT_RETURN(comp_id <= PJ_ICE_MAX_COMP, PJNATH_EICEINCOMPID); 
    368368 
    369369    /* First component ID must be 1, second must be 2, etc., and  
     
    371371     */ 
    372372    PJ_ASSERT_RETURN(ice_st->comps[comp_id-1] == ice_st->comp_cnt,  
    373                      PJ_EICEINCOMPID); 
     373                     PJNATH_EICEINCOMPID); 
    374374 
    375375    /* All in order, add the component. */ 
     
    408408 
    409409    /* Check that component ID present */ 
    410     PJ_ASSERT_RETURN(comp_id <= ice_st->comp_cnt, PJ_EICEINCOMPID); 
     410    PJ_ASSERT_RETURN(comp_id <= ice_st->comp_cnt, PJNATH_EICEINCOMPID); 
    411411 
    412412    /* Can't add new interface while ICE is running */ 
     
    579579    /* Create! */ 
    580580    status = pj_ice_create(&ice_st->stun_cfg, ice_st->obj_name, role,  
    581                            &ice_cb, local_ufrag, local_passwd, &ice_st->ice); 
     581                           ice_st->comp_cnt, &ice_cb,  
     582                           local_ufrag, local_passwd, &ice_st->ice); 
    582583    if (status != PJ_SUCCESS) 
    583584        return status; 
     
    585586    /* Associate user data */ 
    586587    ice_st->ice->user_data = (void*)ice_st; 
    587  
    588     /* Add components */ 
    589     for (i=0; i<ice_st->comp_cnt; ++i) { 
    590         status = pj_ice_add_comp(ice_st->ice, ice_st->comps[i]); 
    591         if (status != PJ_SUCCESS) 
    592             goto on_error; 
    593     } 
    594588 
    595589    /* Add candidates */ 
     
    627621    unsigned i, cnt; 
    628622    pj_ice_cand *pcand; 
    629     pj_status_t status; 
    630623 
    631624    PJ_ASSERT_RETURN(ice_st && count && cand, PJ_EINVAL); 
    632625    PJ_ASSERT_RETURN(ice_st->ice, PJ_EINVALIDOP); 
    633626 
    634     cnt = pj_ice_get_cand_cnt(ice_st->ice); 
     627    cnt = ice_st->ice->lcand_cnt; 
    635628    cnt = (cnt > *count) ? *count : cnt; 
    636629    *count = 0; 
    637630 
    638631    for (i=0; i<cnt; ++i) { 
    639         status = pj_ice_get_cand(ice_st->ice, i, &pcand); 
    640         if (status != PJ_SUCCESS) 
    641             return status; 
    642  
     632        pcand = &ice_st->ice->lcand[i]; 
    643633        pj_memcpy(&cand[i], pcand, sizeof(pj_ice_cand)); 
    644634    } 
     
    689679{ 
    690680    if (!ice_st->ice) 
    691         return PJ_ENOICE; 
     681        return PJNATH_ENOICE; 
    692682 
    693683    return pj_ice_send_data(ice_st->ice, comp_id, data, data_len); 
     
    753743    } 
    754744    if (is == NULL) { 
    755         return PJ_EICEINCANDID; 
     745        return PJNATH_EICEINCANDID; 
    756746    } 
    757747 
Note: See TracChangeset for help on using the changeset viewer.