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/pjmedia/src/pjmedia/transport_ice.c

    r1099 r1101  
    198198 
    199199    /* Add all candidates (to media level) */ 
    200     cand_cnt = pj_ice_get_cand_cnt(tp_ice->ice_st->ice); 
     200    cand_cnt = tp_ice->ice_st->ice->lcand_cnt; 
    201201    for (i=0; i<cand_cnt; ++i) { 
    202202        pj_ice_cand *cand; 
     
    204204        int len; 
    205205 
    206         pj_ice_get_cand(tp_ice->ice_st->ice, i, &cand); 
     206        cand = &tp_ice->ice_st->ice->lcand[i]; 
    207207 
    208208        len = pj_ansi_snprintf( buffer, MAXLEN, 
     
    266266    char *token, *host; 
    267267    pj_str_t s; 
    268     pj_status_t status = PJ_EICEINCANDSDP; 
     268    pj_status_t status = PJNATH_EICEINCANDSDP; 
    269269 
    270270    pj_bzero(cand, sizeof(*cand)); 
     
    342342on_return: 
    343343    return status; 
     344} 
     345 
     346static void set_no_ice(struct transport_ice *tp_ice) 
     347{ 
     348    PJ_LOG(4,(tp_ice->ice_st->obj_name,  
     349              "Remote does not support ICE, disabling local ICE")); 
     350    pjmedia_ice_stop_ice(&tp_ice->base); 
    344351} 
    345352 
     
    359366    attr = pjmedia_sdp_attr_find2(rem_sdp->attr_count, rem_sdp->attr, 
    360367                                  "ice-ufrag", NULL); 
    361     if (attr == NULL) 
    362         return PJ_EICEMISSINGSDP; 
     368    if (attr == NULL) { 
     369        set_no_ice(tp_ice); 
     370        return PJ_SUCCESS; 
     371    } 
    363372    uname = attr->value; 
    364373 
     
    366375    attr = pjmedia_sdp_attr_find2(rem_sdp->attr_count, rem_sdp->attr, 
    367376                                  "ice-pwd", NULL); 
    368     if (attr == NULL) 
    369         return PJ_EICEMISSINGSDP; 
     377    if (attr == NULL) { 
     378        set_no_ice(tp_ice); 
     379        return PJ_SUCCESS; 
     380    } 
    370381    pass = attr->value; 
    371382 
     
    547558    PJ_TIME_VAL_SUB(end_ice, tp_ice->start_ice); 
    548559 
    549     check = &ice_st->ice->clist.checks[ice_st->ice->valid_list[0]]; 
     560    check = &ice_st->ice->valid_list.checks[0]; 
    550561     
    551562    lcand = check->lcand; 
Note: See TracChangeset for help on using the changeset viewer.