Ignore:
Timestamp:
Jan 2, 2008 8:28:33 AM (12 years ago)
Author:
bennylp
Message:

Related to ticket #437: reduce the stack usage of ICE media transport

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c

    r1559 r1656  
    9494    &pjmedia_ice_destroy 
    9595}; 
     96 
     97static const pj_str_t STR_CANDIDATE = {"candidate", 9}; 
     98static const pj_str_t STR_ICE_LITE = {"ice-lite", 8}; 
     99static const pj_str_t STR_ICE_MISMATCH = {"ice-mismatch", 12}; 
    96100 
    97101 
     
    468472    const pjmedia_sdp_attr *attr; 
    469473    unsigned i, cand_cnt; 
    470     pj_ice_sess_cand cand[PJ_ICE_MAX_CAND]; 
     474    pj_ice_sess_cand *cand; 
    471475    const pjmedia_sdp_media *sdp_med; 
    472476    pj_bool_t remote_is_lite = PJ_FALSE; 
     
    475479    pj_sockaddr conn_addr; 
    476480    pj_bool_t conn_found_in_candidate = PJ_FALSE; 
    477     const pj_str_t STR_CANDIDATE = {"candidate", 9}; 
    478     const pj_str_t STR_ICE_LITE = {"ice-lite", 8}; 
    479     const pj_str_t STR_ICE_MISMATCH = {"ice-mismatch", 12}; 
    480481    pj_str_t uname, pass; 
    481482    pj_status_t status; 
     
    530531    pass = attr->value; 
    531532 
     533    /* Allocate candidate array */ 
     534    cand = (pj_ice_sess_cand*) 
     535           pj_pool_calloc(pool, PJ_ICE_MAX_CAND, sizeof(pj_ice_sess_cand)); 
     536 
    532537    /* Get all candidates in the media */ 
    533538    cand_cnt = 0; 
    534     for (i=0; i<sdp_med->attr_count; ++i) { 
     539    for (i=0; i<sdp_med->attr_count && cand_cnt < PJ_ICE_MAX_CAND; ++i) { 
    535540        pjmedia_sdp_attr *attr; 
    536541 
Note: See TracChangeset for help on using the changeset viewer.