Another take at fixing 64bit problems. PJ_MAX_OBJ_NAME is increased to 32 chars (from 16), and check all those sprintf's especially the ones with "%p" format.
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@635 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
53c367748e
commit
e85bc4114b
|
@ -279,7 +279,7 @@ typedef int pj_exception_id_t;
|
||||||
/**
|
/**
|
||||||
* Length of object names.
|
* Length of object names.
|
||||||
*/
|
*/
|
||||||
#define PJ_MAX_OBJ_NAME 16
|
#define PJ_MAX_OBJ_NAME 32
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -126,7 +126,8 @@ PJ_DEF(const char*) pj_exception_id_name(pj_exception_id_t id)
|
||||||
PJ_ASSERT_RETURN(id>0 && id<PJ_MAX_EXCEPTION_ID, "<Invalid ID>");
|
PJ_ASSERT_RETURN(id>0 && id<PJ_MAX_EXCEPTION_ID, "<Invalid ID>");
|
||||||
|
|
||||||
if (exception_id_names[id] == NULL) {
|
if (exception_id_names[id] == NULL) {
|
||||||
pj_ansi_sprintf(unknown_name, "exception %d", id);
|
pj_ansi_snprintf(unknown_name, sizeof(unknown_name),
|
||||||
|
"exception %d", id);
|
||||||
return unknown_name;
|
return unknown_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,9 @@ PJ_DEF(pj_str_t*) pj_generate_unique_string(pj_str_t *str)
|
||||||
{
|
{
|
||||||
static int guid_initialized;
|
static int guid_initialized;
|
||||||
static unsigned pid;
|
static unsigned pid;
|
||||||
static char str_pid[5];
|
static char str_pid[32];
|
||||||
static unsigned char mac_addr[6];
|
static unsigned char mac_addr[32];
|
||||||
static char str_mac_addr[16];
|
static char str_mac_addr[32];
|
||||||
static unsigned clock_seq;
|
static unsigned clock_seq;
|
||||||
|
|
||||||
PJ_CHECK_STACK();
|
PJ_CHECK_STACK();
|
||||||
|
|
|
@ -138,8 +138,10 @@ static void thread_initialize( pj_thread_t *thread )
|
||||||
/* initialise termination flag */
|
/* initialise termination flag */
|
||||||
thread->terminate = 0;
|
thread->terminate = 0;
|
||||||
|
|
||||||
/* set name of this process (max 15 chars + 0 !) */
|
/* set name of this process (making sure obj_name is null
|
||||||
thread->obj_name[15] = '\0';
|
* terminated first)
|
||||||
|
*/
|
||||||
|
thread->obj_name[PJ_MAX_OBJ_NAME-1] = '\0';
|
||||||
sprintf(current->comm, thread->obj_name);
|
sprintf(current->comm, thread->obj_name);
|
||||||
|
|
||||||
/* tell the creator that we are ready and let him continue */
|
/* tell the creator that we are ready and let him continue */
|
||||||
|
@ -266,7 +268,8 @@ PJ_DEF(pj_status_t) pj_thread_register ( const char *cstr_thread_name,
|
||||||
if(cstr_thread_name && pj_strlen(&thread_name) < sizeof(thread->obj_name)-1)
|
if(cstr_thread_name && pj_strlen(&thread_name) < sizeof(thread->obj_name)-1)
|
||||||
pj_sprintf(thread->obj_name, cstr_thread_name, thread->thread);
|
pj_sprintf(thread->obj_name, cstr_thread_name, thread->thread);
|
||||||
else
|
else
|
||||||
pj_sprintf(thread->obj_name, "thr%p", (void*)thread->thread);
|
pj_snprintf(thread->obj_name, sizeof(thread->obj_name),
|
||||||
|
"thr%p", (void*)thread->thread);
|
||||||
|
|
||||||
/* Initialize. */
|
/* Initialize. */
|
||||||
thread_initialize(thread);
|
thread_initialize(thread);
|
||||||
|
|
|
@ -210,9 +210,11 @@ PJ_DEF(pj_status_t) pj_thread_register ( const char *cstr_thread_name,
|
||||||
thread->thread = pthread_self();
|
thread->thread = pthread_self();
|
||||||
|
|
||||||
if(cstr_thread_name && pj_strlen(&thread_name) < sizeof(thread->obj_name)-1)
|
if(cstr_thread_name && pj_strlen(&thread_name) < sizeof(thread->obj_name)-1)
|
||||||
pj_ansi_sprintf(thread->obj_name, cstr_thread_name, thread->thread);
|
pj_ansi_snprintf(thread->obj_name, sizeof(thread->obj_name),
|
||||||
|
cstr_thread_name, thread->thread);
|
||||||
else
|
else
|
||||||
pj_ansi_sprintf(thread->obj_name, "thr%p", (void*)thread->thread);
|
pj_ansi_snprintf(thread->obj_name, sizeof(thread->obj_name),
|
||||||
|
"thr%p", (void*)thread->thread);
|
||||||
|
|
||||||
rc = pj_thread_local_set(thread_tls_id, thread);
|
rc = pj_thread_local_set(thread_tls_id, thread);
|
||||||
if (rc != PJ_SUCCESS)
|
if (rc != PJ_SUCCESS)
|
||||||
|
|
|
@ -228,9 +228,11 @@ PJ_DEF(pj_status_t) pj_thread_register ( const char *cstr_thread_name,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (cstr_thread_name && pj_strlen(&thread_name) < sizeof(thread->obj_name)-1)
|
if (cstr_thread_name && pj_strlen(&thread_name) < sizeof(thread->obj_name)-1)
|
||||||
pj_ansi_sprintf(thread->obj_name, cstr_thread_name, thread->idthread);
|
pj_ansi_snprintf(thread->obj_name, sizeof(thread->obj_name),
|
||||||
|
cstr_thread_name, thread->idthread);
|
||||||
else
|
else
|
||||||
pj_ansi_sprintf(thread->obj_name, "thr%p", (void*)thread->idthread);
|
pj_ansi_snprintf(thread->obj_name, sizeof(thread->obj_name),
|
||||||
|
"thr%p", (void*)thread->idthread);
|
||||||
|
|
||||||
rc = pj_thread_local_set(thread_tls_id, thread);
|
rc = pj_thread_local_set(thread_tls_id, thread);
|
||||||
if (rc != PJ_SUCCESS)
|
if (rc != PJ_SUCCESS)
|
||||||
|
|
|
@ -57,14 +57,14 @@ PJ_DEF(void) pj_set_netos_error(pj_status_t code)
|
||||||
int platform_strerror( pj_os_err_type os_errcode,
|
int platform_strerror( pj_os_err_type os_errcode,
|
||||||
char *buf, pj_size_t bufsize)
|
char *buf, pj_size_t bufsize)
|
||||||
{
|
{
|
||||||
char errmsg[32];
|
char errmsg[PJ_ERR_MSG_SIZE];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
/* Handle EINVAL as special case so that it'll pass errno test. */
|
/* Handle EINVAL as special case so that it'll pass errno test. */
|
||||||
if (os_errcode==EINVAL)
|
if (os_errcode==EINVAL)
|
||||||
strcpy(errmsg, "Invalid value");
|
strcpy(errmsg, "Invalid value");
|
||||||
else
|
else
|
||||||
sprintf(errmsg, "errno=%d", os_errcode);
|
snprintf(errmsg, sizeof(errmsg), "errno=%d", os_errcode);
|
||||||
|
|
||||||
len = strlen(errmsg);
|
len = strlen(errmsg);
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,8 @@ PJ_DEF(void) pj_pool_init_int( pj_pool_t *pool,
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
if (strchr(name, '%') != NULL) {
|
if (strchr(name, '%') != NULL) {
|
||||||
pj_ansi_sprintf(pool->obj_name, name, pool);
|
pj_ansi_snprintf(pool->obj_name, sizeof(pool->obj_name),
|
||||||
|
name, pool);
|
||||||
} else {
|
} else {
|
||||||
pj_ansi_strncpy(pool->obj_name, name, PJ_MAX_OBJ_NAME);
|
pj_ansi_strncpy(pool->obj_name, name, PJ_MAX_OBJ_NAME);
|
||||||
}
|
}
|
||||||
|
|
|
@ -698,8 +698,8 @@ PJ_DEF(pj_status_t) pjmedia_conf_add_passive_port( pjmedia_conf *conf,
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
name = &tmp;
|
name = &tmp;
|
||||||
|
|
||||||
tmp.ptr = pj_pool_alloc(pool, 20);
|
tmp.ptr = pj_pool_alloc(pool, 32);
|
||||||
tmp.slen = pj_ansi_sprintf(tmp.ptr, "ConfPort#%d", index);
|
tmp.slen = pj_ansi_snprintf(tmp.ptr, 32, "ConfPort#%d", index);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create and initialize the media port structure. */
|
/* Create and initialize the media port structure. */
|
||||||
|
|
|
@ -470,7 +470,7 @@ PJ_DEF(pj_status_t) pjmedia_endpt_dump(pjmedia_endpt *endpt)
|
||||||
for (i=0; i<count; ++i) {
|
for (i=0; i<count; ++i) {
|
||||||
const char *type;
|
const char *type;
|
||||||
pjmedia_codec_param param;
|
pjmedia_codec_param param;
|
||||||
char bps[16];
|
char bps[32];
|
||||||
|
|
||||||
switch (codec_info[i].type) {
|
switch (codec_info[i].type) {
|
||||||
case PJMEDIA_TYPE_AUDIO:
|
case PJMEDIA_TYPE_AUDIO:
|
||||||
|
|
|
@ -912,6 +912,7 @@ PJ_DEF(pj_status_t) pjmedia_stream_create( pjmedia_endpt *endpt,
|
||||||
pjmedia_stream **p_stream)
|
pjmedia_stream **p_stream)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
enum { M = 32 };
|
||||||
pjmedia_stream *stream;
|
pjmedia_stream *stream;
|
||||||
pj_str_t name;
|
pj_str_t name;
|
||||||
unsigned jb_init, jb_max, jb_min_pre, jb_max_pre;
|
unsigned jb_init, jb_max, jb_min_pre, jb_max_pre;
|
||||||
|
@ -926,8 +927,8 @@ PJ_DEF(pj_status_t) pjmedia_stream_create( pjmedia_endpt *endpt,
|
||||||
PJ_ASSERT_RETURN(stream != NULL, PJ_ENOMEM);
|
PJ_ASSERT_RETURN(stream != NULL, PJ_ENOMEM);
|
||||||
|
|
||||||
/* Init stream/port name */
|
/* Init stream/port name */
|
||||||
name.ptr = pj_pool_alloc(pool, 24);
|
name.ptr = pj_pool_alloc(pool, M);
|
||||||
name.slen = pj_ansi_snprintf(name.ptr, 24, "strm%p", stream);
|
name.slen = pj_ansi_snprintf(name.ptr, M, "strm%p", stream);
|
||||||
|
|
||||||
|
|
||||||
/* Init some port-info. Some parts of the info will be set later
|
/* Init some port-info. Some parts of the info will be set later
|
||||||
|
|
|
@ -141,7 +141,7 @@ typedef struct
|
||||||
static pj_status_t sine_get_frame( pjmedia_port *port,
|
static pj_status_t sine_get_frame( pjmedia_port *port,
|
||||||
pjmedia_frame *frame)
|
pjmedia_frame *frame)
|
||||||
{
|
{
|
||||||
port_data *sine = port->user_data;
|
port_data *sine = port->port_data.pdata;
|
||||||
pj_int16_t *samples = frame->buf;
|
pj_int16_t *samples = frame->buf;
|
||||||
unsigned i, count, left, right;
|
unsigned i, count, left, right;
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ static pj_status_t create_sine_port(pj_pool_t *pool,
|
||||||
port->get_frame = &sine_get_frame;
|
port->get_frame = &sine_get_frame;
|
||||||
|
|
||||||
/* Create sine port data */
|
/* Create sine port data */
|
||||||
port->user_data = sine = pj_pool_zalloc(pool, sizeof(port_data));
|
port->port_data.pdata = sine = pj_pool_zalloc(pool, sizeof(port_data));
|
||||||
|
|
||||||
/* Create samples */
|
/* Create samples */
|
||||||
count = port->info.samples_per_frame / channel_count;
|
count = port->info.samples_per_frame / channel_count;
|
||||||
|
|
|
@ -80,7 +80,7 @@ typedef struct
|
||||||
static pj_status_t sine_get_frame( pjmedia_port *port,
|
static pj_status_t sine_get_frame( pjmedia_port *port,
|
||||||
pjmedia_frame *frame)
|
pjmedia_frame *frame)
|
||||||
{
|
{
|
||||||
port_data *sine = port->user_data;
|
port_data *sine = port->port_data.pdata;
|
||||||
pj_int16_t *samples = frame->buf;
|
pj_int16_t *samples = frame->buf;
|
||||||
unsigned i, count, left, right;
|
unsigned i, count, left, right;
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ static pj_status_t create_sine_port(pj_pool_t *pool,
|
||||||
port->get_frame = &sine_get_frame;
|
port->get_frame = &sine_get_frame;
|
||||||
|
|
||||||
/* Create sine port data */
|
/* Create sine port data */
|
||||||
port->user_data = sine = pj_pool_zalloc(pool, sizeof(port_data));
|
port->port_data.pdata = sine = pj_pool_zalloc(pool, sizeof(port_data));
|
||||||
|
|
||||||
/* Create samples */
|
/* Create samples */
|
||||||
count = port->info.samples_per_frame / channel_count;
|
count = port->info.samples_per_frame / channel_count;
|
||||||
|
|
|
@ -73,7 +73,7 @@ static pj_status_t create_dialog( pjsip_user_agent *ua,
|
||||||
PJ_ASSERT_RETURN(dlg != NULL, PJ_ENOMEM);
|
PJ_ASSERT_RETURN(dlg != NULL, PJ_ENOMEM);
|
||||||
|
|
||||||
dlg->pool = pool;
|
dlg->pool = pool;
|
||||||
pj_ansi_sprintf(dlg->obj_name, "dlg%p", dlg);
|
pj_ansi_snprintf(dlg->obj_name, sizeof(dlg->obj_name), "dlg%p", dlg);
|
||||||
dlg->ua = ua;
|
dlg->ua = ua;
|
||||||
dlg->endpt = endpt;
|
dlg->endpt = endpt;
|
||||||
dlg->state = PJSIP_DIALOG_STATE_NULL;
|
dlg->state = PJSIP_DIALOG_STATE_NULL;
|
||||||
|
|
|
@ -892,7 +892,8 @@ static pj_status_t tsx_create( pjsip_module *tsx_user,
|
||||||
tsx->tsx_user = tsx_user;
|
tsx->tsx_user = tsx_user;
|
||||||
tsx->endpt = mod_tsx_layer.endpt;
|
tsx->endpt = mod_tsx_layer.endpt;
|
||||||
|
|
||||||
pj_ansi_sprintf(tsx->obj_name, "tsx%p", tsx);
|
pj_ansi_snprintf(tsx->obj_name, sizeof(tsx->obj_name),
|
||||||
|
"tsx%p", tsx);
|
||||||
|
|
||||||
tsx->handle_200resp = 1;
|
tsx->handle_200resp = 1;
|
||||||
tsx->retransmit_timer.id = TSX_TIMER_RETRANSMISSION;
|
tsx->retransmit_timer.id = TSX_TIMER_RETRANSMISSION;
|
||||||
|
|
|
@ -373,7 +373,7 @@ PJ_DEF(char*) pjsip_tx_data_get_info( pjsip_tx_data *tdata )
|
||||||
|
|
||||||
PJ_DEF(char*) pjsip_rx_data_get_info(pjsip_rx_data *rdata)
|
PJ_DEF(char*) pjsip_rx_data_get_info(pjsip_rx_data *rdata)
|
||||||
{
|
{
|
||||||
char obj_name[16];
|
char obj_name[PJ_MAX_OBJ_NAME];
|
||||||
|
|
||||||
PJ_ASSERT_RETURN(rdata->msg_info.msg, "INVALID MSG");
|
PJ_ASSERT_RETURN(rdata->msg_info.msg, "INVALID MSG");
|
||||||
|
|
||||||
|
@ -381,7 +381,7 @@ PJ_DEF(char*) pjsip_rx_data_get_info(pjsip_rx_data *rdata)
|
||||||
return rdata->msg_info.info;
|
return rdata->msg_info.info;
|
||||||
|
|
||||||
pj_ansi_strcpy(obj_name, "rdata");
|
pj_ansi_strcpy(obj_name, "rdata");
|
||||||
pj_ansi_sprintf(obj_name+5, "%p", rdata);
|
pj_ansi_snprintf(obj_name+5, sizeof(obj_name)-5, "%p", rdata);
|
||||||
|
|
||||||
rdata->msg_info.info = get_msg_info(rdata->tp_info.pool, obj_name,
|
rdata->msg_info.info = get_msg_info(rdata->tp_info.pool, obj_name,
|
||||||
rdata->msg_info.msg);
|
rdata->msg_info.msg);
|
||||||
|
|
|
@ -359,7 +359,8 @@ PJ_DEF(pj_status_t) pjsip_loop_start( pjsip_endpoint *endpt,
|
||||||
loop = pj_pool_zalloc(pool, sizeof(struct loop_transport));
|
loop = pj_pool_zalloc(pool, sizeof(struct loop_transport));
|
||||||
|
|
||||||
/* Initialize transport properties. */
|
/* Initialize transport properties. */
|
||||||
pj_ansi_sprintf(loop->base.obj_name, "loop%p", loop);
|
pj_ansi_snprintf(loop->base.obj_name, sizeof(loop->base.obj_name),
|
||||||
|
"loop%p", loop);
|
||||||
loop->base.pool = pool;
|
loop->base.pool = pool;
|
||||||
status = pj_atomic_create(pool, 0, &loop->base.ref_cnt);
|
status = pj_atomic_create(pool, 0, &loop->base.ref_cnt);
|
||||||
if (status != PJ_SUCCESS)
|
if (status != PJ_SUCCESS)
|
||||||
|
|
|
@ -167,8 +167,9 @@ static void sockaddr_to_host_port( pj_pool_t *pool,
|
||||||
pjsip_host_port *host_port,
|
pjsip_host_port *host_port,
|
||||||
const pj_sockaddr_in *addr )
|
const pj_sockaddr_in *addr )
|
||||||
{
|
{
|
||||||
host_port->host.ptr = pj_pool_alloc(pool, 48);
|
enum { M = 48 };
|
||||||
host_port->host.slen = pj_ansi_sprintf( host_port->host.ptr, "%s",
|
host_port->host.ptr = pj_pool_alloc(pool, M);
|
||||||
|
host_port->host.slen = pj_ansi_snprintf( host_port->host.ptr, M, "%s",
|
||||||
pj_inet_ntoa(addr->sin_addr));
|
pj_inet_ntoa(addr->sin_addr));
|
||||||
host_port->port = pj_ntohs(addr->sin_port);
|
host_port->port = pj_ntohs(addr->sin_port);
|
||||||
}
|
}
|
||||||
|
@ -259,8 +260,8 @@ PJ_DEF(pj_status_t) pjsip_tcp_transport_start( pjsip_endpoint *endpt,
|
||||||
listener_addr->sin_addr = *(pj_in_addr*)he.h_addr;
|
listener_addr->sin_addr = *(pj_in_addr*)he.h_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
pj_ansi_sprintf(listener->obj_name, "tcp:%d",
|
pj_ansi_snprintf(listener->obj_name, sizeof(listener->obj_name),
|
||||||
(int)pj_ntohs(listener_addr->sin_port));
|
"tcp:%d", (int)pj_ntohs(listener_addr->sin_port));
|
||||||
|
|
||||||
/* Save the address name */
|
/* Save the address name */
|
||||||
sockaddr_to_host_port(listener->factory.pool,
|
sockaddr_to_host_port(listener->factory.pool,
|
||||||
|
|
|
@ -403,6 +403,7 @@ PJ_DEF(pj_status_t) pjsip_udp_transport_attach( pjsip_endpoint *endpt,
|
||||||
unsigned async_cnt,
|
unsigned async_cnt,
|
||||||
pjsip_transport **p_transport)
|
pjsip_transport **p_transport)
|
||||||
{
|
{
|
||||||
|
enum { M = 80 };
|
||||||
pj_pool_t *pool;
|
pj_pool_t *pool;
|
||||||
struct udp_transport *tp;
|
struct udp_transport *tp;
|
||||||
pj_ioqueue_t *ioqueue;
|
pj_ioqueue_t *ioqueue;
|
||||||
|
@ -450,7 +451,8 @@ PJ_DEF(pj_status_t) pjsip_udp_transport_attach( pjsip_endpoint *endpt,
|
||||||
tp->base.pool = pool;
|
tp->base.pool = pool;
|
||||||
|
|
||||||
/* Object name. */
|
/* Object name. */
|
||||||
pj_ansi_sprintf(tp->base.obj_name, "udp%p", tp);
|
pj_ansi_snprintf(tp->base.obj_name, sizeof(tp->base.obj_name),
|
||||||
|
"udp%p", tp);
|
||||||
|
|
||||||
/* Init reference counter. */
|
/* Init reference counter. */
|
||||||
status = pj_atomic_create(pool, 0, &tp->base.ref_cnt);
|
status = pj_atomic_create(pool, 0, &tp->base.ref_cnt);
|
||||||
|
@ -493,9 +495,9 @@ PJ_DEF(pj_status_t) pjsip_udp_transport_attach( pjsip_endpoint *endpt,
|
||||||
tp->base.remote_name.port = 0;
|
tp->base.remote_name.port = 0;
|
||||||
|
|
||||||
/* Transport info. */
|
/* Transport info. */
|
||||||
tp->base.info = pj_pool_alloc(pool, 80);
|
tp->base.info = pj_pool_alloc(pool, M);
|
||||||
pj_ansi_sprintf(
|
pj_ansi_snprintf(
|
||||||
tp->base.info, "udp %s:%d [published as %s:%d]",
|
tp->base.info, M, "udp %s:%d [published as %s:%d]",
|
||||||
pj_inet_ntoa(((pj_sockaddr_in*)&tp->base.local_addr)->sin_addr),
|
pj_inet_ntoa(((pj_sockaddr_in*)&tp->base.local_addr)->sin_addr),
|
||||||
pj_ntohs(((pj_sockaddr_in*)&tp->base.local_addr)->sin_port),
|
pj_ntohs(((pj_sockaddr_in*)&tp->base.local_addr)->sin_port),
|
||||||
tp->base.local_name.host.ptr,
|
tp->base.local_name.host.ptr,
|
||||||
|
|
|
@ -289,7 +289,7 @@ PJ_DEF(pj_status_t) pjsua_acc_add_local( pjsua_transport_id tid,
|
||||||
{
|
{
|
||||||
pjsua_acc_config cfg;
|
pjsua_acc_config cfg;
|
||||||
struct transport_data *t = &pjsua_var.tpdata[tid];
|
struct transport_data *t = &pjsua_var.tpdata[tid];
|
||||||
char uri[62];
|
char uri[PJSIP_MAX_URL_SIZE];
|
||||||
|
|
||||||
/* ID must be valid */
|
/* ID must be valid */
|
||||||
PJ_ASSERT_RETURN(tid>=0 && tid<PJ_ARRAY_SIZE(pjsua_var.tpdata), PJ_EINVAL);
|
PJ_ASSERT_RETURN(tid>=0 && tid<PJ_ARRAY_SIZE(pjsua_var.tpdata), PJ_EINVAL);
|
||||||
|
@ -300,11 +300,12 @@ PJ_DEF(pj_status_t) pjsua_acc_add_local( pjsua_transport_id tid,
|
||||||
pjsua_acc_config_default(&cfg);
|
pjsua_acc_config_default(&cfg);
|
||||||
|
|
||||||
/* Build URI for the account */
|
/* Build URI for the account */
|
||||||
pj_ansi_sprintf(uri, "<sip:%.*s:%d;transport=%s>",
|
pj_ansi_snprintf(uri, PJSIP_MAX_URL_SIZE,
|
||||||
(int)t->local_name.host.slen,
|
"<sip:%.*s:%d;transport=%s>",
|
||||||
t->local_name.host.ptr,
|
(int)t->local_name.host.slen,
|
||||||
t->local_name.port,
|
t->local_name.host.ptr,
|
||||||
pjsip_transport_get_type_name(t->type));
|
t->local_name.port,
|
||||||
|
pjsip_transport_get_type_name(t->type));
|
||||||
|
|
||||||
cfg.id = pj_str(uri);
|
cfg.id = pj_str(uri);
|
||||||
|
|
||||||
|
|
|
@ -1275,8 +1275,8 @@ static void dump_media_session(const char *indent,
|
||||||
const char *rem_addr;
|
const char *rem_addr;
|
||||||
int rem_port;
|
int rem_port;
|
||||||
const char *dir;
|
const char *dir;
|
||||||
char last_update[40];
|
char last_update[64];
|
||||||
char packets[16], bytes[16], ipbytes[16];
|
char packets[32], bytes[32], ipbytes[32];
|
||||||
pj_time_val now;
|
pj_time_val now;
|
||||||
|
|
||||||
pjmedia_session_get_stream_stat(session, i, &stat);
|
pjmedia_session_get_stream_stat(session, i, &stat);
|
||||||
|
|
|
@ -34,7 +34,7 @@ int transport_tcp_test(void)
|
||||||
pjsip_transport *tcp;
|
pjsip_transport *tcp;
|
||||||
pj_sockaddr_in rem_addr;
|
pj_sockaddr_in rem_addr;
|
||||||
pj_status_t status;
|
pj_status_t status;
|
||||||
char url[64];
|
char url[PJSIP_MAX_URL_SIZE];
|
||||||
int rtt[SEND_RECV_LOOP], min_rtt;
|
int rtt[SEND_RECV_LOOP], min_rtt;
|
||||||
int i, pkt_lost;
|
int i, pkt_lost;
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
#define THIS_FILE "tsx_basic_test.c"
|
#define THIS_FILE "tsx_basic_test.c"
|
||||||
|
|
||||||
static char TARGET_URI[128];
|
static char TARGET_URI[PJSIP_MAX_URL_SIZE];
|
||||||
static char FROM_URI[128];
|
static char FROM_URI[PJSIP_MAX_URL_SIZE];
|
||||||
|
|
||||||
|
|
||||||
/* Test transaction layer. */
|
/* Test transaction layer. */
|
||||||
|
|
Loading…
Reference in New Issue