Changeset 1655


Ignore:
Timestamp:
Jan 2, 2008 8:27:03 AM (16 years ago)
Author:
bennylp
Message:

Related to ticket #437: optimize the stack usage of pjsua-lib

Location:
pjproject/trunk/pjsip/src/pjsua-lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r1622 r1655  
    865865    pjsua_acc *acc; 
    866866    pj_str_t contact; 
    867     char contact_buf[1024]; 
    868867    pj_pool_t *pool; 
    869868    pj_status_t status; 
     
    894893    } 
    895894 
    896     pool = pj_pool_create_on_buf(NULL, contact_buf, sizeof(contact_buf)); 
     895    pool = pjsua_pool_create("tmpregc", 512, 512); 
    897896    status = pjsua_acc_create_uac_contact( pool, &contact, 
    898897                                           acc_id, &acc->cfg.reg_uri); 
     
    902901                     status); 
    903902        pjsip_regc_destroy(acc->regc); 
     903        pj_pool_release(pool); 
    904904        acc->regc = NULL; 
    905905        return status; 
     
    917917                     status); 
    918918        pjsip_regc_destroy(acc->regc); 
     919        pj_pool_release(pool); 
    919920        acc->regc = NULL; 
    920921        return status; 
     
    953954        pjsip_generic_string_hdr *h; 
    954955 
    955         pool = pj_pool_create_on_buf(NULL, contact_buf, sizeof(contact_buf)); 
    956956        pj_list_init(&hdr_list); 
    957957 
     
    962962        pjsip_regc_add_headers(acc->regc, &hdr_list); 
    963963    } 
     964 
     965    pj_pool_release(pool); 
    964966 
    965967    return PJ_SUCCESS; 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c

    r1615 r1655  
    15011501    pjsua_call *dest_call; 
    15021502    pjsip_dialog *dest_dlg; 
    1503     char str_dest_buf[512]; 
     1503    char str_dest_buf[PJSIP_MAX_URL_SIZE*2]; 
    15041504    pj_str_t str_dest; 
    15051505    int len; 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r1639 r1655  
    221221    pj_sockaddr_in mapped_addr[2]; 
    222222    pj_status_t status = PJ_SUCCESS; 
    223     char addr_buf[80]; 
     223    char addr_buf[PJ_INET6_ADDRSTRLEN+2]; 
    224224    pj_sock_t sock[2]; 
    225225 
     
    625625        pjmedia_ice_cb ice_cb; 
    626626        int next_port; 
     627        char name[32]; 
    627628#if PJMEDIA_ADVERTISE_RTCP 
    628629        enum { COMP_CNT=2 }; 
     
    634635        ice_cb.on_ice_complete = &on_ice_complete; 
    635636 
    636         status = pjmedia_ice_create(pjsua_var.med_endpt, NULL, COMP_CNT, 
     637        pj_ansi_snprintf(name, sizeof(name), "icetp%02d", i); 
     638                          
     639        status = pjmedia_ice_create(pjsua_var.med_endpt, name, COMP_CNT, 
    637640                                    &pjsua_var.stun_cfg, &ice_cb, 
    638641                                    &pjsua_var.calls[i].med_tp); 
     
    891894    pjmedia_stream_info *si = NULL; 
    892895    pjmedia_port *media_port; 
    893     pj_str_t port_name; 
    894     char tmp[PJSIP_MAX_URL_SIZE]; 
    895896    pj_status_t status; 
    896897 
     
    953954 
    954955    } else { 
    955  
    956956        /* Start ICE */ 
    957957        if (pjsua_var.media_cfg.enable_ice) { 
     
    10131013         * Add the call to conference bridge. 
    10141014         */ 
    1015         port_name.ptr = tmp; 
    1016         port_name.slen = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, 
    1017                                          call->inv->dlg->remote.info->uri, 
    1018                                          tmp, sizeof(tmp)); 
    1019         if (port_name.slen < 1) { 
    1020             port_name = pj_str("call"); 
    1021         } 
    1022         status = pjmedia_conf_add_port( pjsua_var.mconf, call->inv->pool, 
    1023                                         media_port,  
    1024                                         &port_name, 
    1025                                         (unsigned*)&call->conf_slot); 
    1026         if (status != PJ_SUCCESS) { 
    1027             return status; 
     1015        { 
     1016            char tmp[PJSIP_MAX_URL_SIZE]; 
     1017            pj_str_t port_name; 
     1018 
     1019            port_name.ptr = tmp; 
     1020            port_name.slen = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, 
     1021                                             call->inv->dlg->remote.info->uri, 
     1022                                             tmp, sizeof(tmp)); 
     1023            if (port_name.slen < 1) { 
     1024                port_name = pj_str("call"); 
     1025            } 
     1026            status = pjmedia_conf_add_port( pjsua_var.mconf, call->inv->pool, 
     1027                                            media_port,  
     1028                                            &port_name, 
     1029                                            (unsigned*)&call->conf_slot); 
     1030            if (status != PJ_SUCCESS) { 
     1031                return status; 
     1032            } 
    10281033        } 
    10291034 
     
    10901095PJ_DEF(unsigned) pjsua_conf_get_active_ports(void) 
    10911096{ 
    1092     unsigned ports[256]; 
     1097    unsigned ports[PJSUA_MAX_CONF_PORTS]; 
    10931098    unsigned count = PJ_ARRAY_SIZE(ports); 
    10941099    pj_status_t status; 
Note: See TracChangeset for help on using the changeset viewer.