Changeset 1101 for pjproject/trunk/pjnath/src/pjnath/ice_stream_transport.c
- Timestamp:
- Mar 24, 2007 1:00:30 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/ice_stream_transport.c
r1099 r1101 365 365 366 366 /* 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); 368 368 369 369 /* First component ID must be 1, second must be 2, etc., and … … 371 371 */ 372 372 PJ_ASSERT_RETURN(ice_st->comps[comp_id-1] == ice_st->comp_cnt, 373 PJ _EICEINCOMPID);373 PJNATH_EICEINCOMPID); 374 374 375 375 /* All in order, add the component. */ … … 408 408 409 409 /* 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); 411 411 412 412 /* Can't add new interface while ICE is running */ … … 579 579 /* Create! */ 580 580 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); 582 583 if (status != PJ_SUCCESS) 583 584 return status; … … 585 586 /* Associate user data */ 586 587 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 }594 588 595 589 /* Add candidates */ … … 627 621 unsigned i, cnt; 628 622 pj_ice_cand *pcand; 629 pj_status_t status;630 623 631 624 PJ_ASSERT_RETURN(ice_st && count && cand, PJ_EINVAL); 632 625 PJ_ASSERT_RETURN(ice_st->ice, PJ_EINVALIDOP); 633 626 634 cnt = pj_ice_get_cand_cnt(ice_st->ice);627 cnt = ice_st->ice->lcand_cnt; 635 628 cnt = (cnt > *count) ? *count : cnt; 636 629 *count = 0; 637 630 638 631 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]; 643 633 pj_memcpy(&cand[i], pcand, sizeof(pj_ice_cand)); 644 634 } … … 689 679 { 690 680 if (!ice_st->ice) 691 return PJ _ENOICE;681 return PJNATH_ENOICE; 692 682 693 683 return pj_ice_send_data(ice_st->ice, comp_id, data, data_len); … … 753 743 } 754 744 if (is == NULL) { 755 return PJ _EICEINCANDID;745 return PJNATH_EICEINCANDID; 756 746 } 757 747
Note: See TracChangeset
for help on using the changeset viewer.