Changeset 5170 for pjproject/trunk
- Timestamp:
- Aug 25, 2015 8:45:46 AM (9 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/src/pjlib-util-test/http_client.c
r4537 r5170 116 116 continue; 117 117 } else if (srv->action == ACTION_REPLY) { 118 pj_size_t send_ size= 0;118 pj_size_t send_len = 0; 119 119 unsigned ctr = 0; 120 120 pj_ansi_sprintf(pkt, "HTTP/1.0 200 OK\r\n"); … … 131 131 continue; 132 132 } 133 while (send_ size< srv->data_size) {134 pkt_len = srv->data_size - send_ size;133 while (send_len < srv->data_size) { 134 pkt_len = srv->data_size - send_len; 135 135 if (pkt_len > (signed)srv->buf_size) 136 136 pkt_len = srv->buf_size; 137 send_size+= pkt_len;137 send_len += pkt_len; 138 138 pj_create_random_string(pkt, pkt_len); 139 139 pj_ansi_sprintf(pkt, "\nPacket: %d", ++ctr); … … 419 419 420 420 { 421 pj_sockaddr_in addr ;422 int addr_len = sizeof(addr );423 sstatus = pj_sock_getsockname(g_server.sock, &addr , &addr_len);421 pj_sockaddr_in addr2; 422 int addr_len = sizeof(addr2); 423 sstatus = pj_sock_getsockname(g_server.sock, &addr2, &addr_len); 424 424 if (sstatus != PJ_SUCCESS) 425 425 return -44; 426 g_server.port = pj_sockaddr_in_get_port(&addr );426 g_server.port = pj_sockaddr_in_get_port(&addr2); 427 427 pj_ansi_snprintf(urlbuf, sizeof(urlbuf), 428 428 "http://127.0.0.1:%d/about-us/", … … 531 531 532 532 { 533 pj_sockaddr_in addr ;534 int addr_len = sizeof(addr );535 sstatus = pj_sock_getsockname(g_server.sock, &addr , &addr_len);533 pj_sockaddr_in addr2; 534 int addr_len = sizeof(addr2); 535 sstatus = pj_sock_getsockname(g_server.sock, &addr2, &addr_len); 536 536 if (sstatus != PJ_SUCCESS) 537 537 return -44; 538 g_server.port = pj_sockaddr_in_get_port(&addr );538 g_server.port = pj_sockaddr_in_get_port(&addr2); 539 539 pj_ansi_snprintf(urlbuf, sizeof(urlbuf), 540 540 "http://127.0.0.1:%d", … … 660 660 661 661 { 662 pj_sockaddr_in addr ;663 int addr_len = sizeof(addr );664 sstatus = pj_sock_getsockname(g_server.sock, &addr , &addr_len);662 pj_sockaddr_in addr2; 663 int addr_len = sizeof(addr2); 664 sstatus = pj_sock_getsockname(g_server.sock, &addr2, &addr_len); 665 665 if (sstatus != PJ_SUCCESS) 666 666 return -44; 667 g_server.port = pj_sockaddr_in_get_port(&addr );667 g_server.port = pj_sockaddr_in_get_port(&addr2); 668 668 pj_ansi_snprintf(urlbuf, sizeof(urlbuf), 669 669 "http://127.0.0.1:%d/test/test.txt", … … 763 763 764 764 { 765 pj_sockaddr_in addr ;766 int addr_len = sizeof(addr );767 sstatus = pj_sock_getsockname(g_server.sock, &addr , &addr_len);765 pj_sockaddr_in addr2; 766 int addr_len = sizeof(addr2); 767 sstatus = pj_sock_getsockname(g_server.sock, &addr2, &addr_len); 768 768 if (sstatus != PJ_SUCCESS) 769 769 return -44; 770 g_server.port = pj_sockaddr_in_get_port(&addr );770 g_server.port = pj_sockaddr_in_get_port(&addr2); 771 771 pj_ansi_snprintf(urlbuf, sizeof(urlbuf), 772 772 "http://127.0.0.1:%d/test/test2.txt", … … 858 858 859 859 { 860 pj_sockaddr_in addr ;861 int addr_len = sizeof(addr );862 sstatus = pj_sock_getsockname(g_server.sock, &addr , &addr_len);860 pj_sockaddr_in addr2; 861 int addr_len = sizeof(addr2); 862 sstatus = pj_sock_getsockname(g_server.sock, &addr2, &addr_len); 863 863 if (sstatus != PJ_SUCCESS) 864 864 return -44; 865 g_server.port = pj_sockaddr_in_get_port(&addr );865 g_server.port = pj_sockaddr_in_get_port(&addr2); 866 866 pj_ansi_snprintf(urlbuf, sizeof(urlbuf), 867 867 "http://127.0.0.1:%d/test/test2.txt", -
pjproject/trunk/pjlib-util/src/pjlib-util/cli_telnet.c
r5113 r5170 37 37 (defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0) 38 38 39 /* Undefine EADDRINUSE first, we want it equal to WSAEADDRINUSE, 40 * while WinSDK 10 defines it to another value. 41 */ 42 #undef EADDRINUSE 39 43 #define EADDRINUSE WSAEADDRINUSE 40 44 -
pjproject/trunk/pjlib-util/src/pjlib-util/resolver.c
r4649 r5170 1634 1634 PJ_LOG(3,(resolver->name.ptr, " Name servers:")); 1635 1635 for (i=0; i<resolver->ns_count; ++i) { 1636 const char *state_names[] = { "probing", "active", "bad"};1637 1636 struct nameserver *ns = &resolver->ns[i]; 1638 1637 -
pjproject/trunk/pjlib-util/src/pjlib-util/srv_resolver.c
r5115 r5170 617 617 for (i=0; i<query_job->srv_cnt; ++i) { 618 618 unsigned j; 619 struct srv_target *srv = &query_job->srv[i];620 621 srv_rec.entry[srv_rec.count].priority = srv ->priority;622 srv_rec.entry[srv_rec.count].weight = srv ->weight;623 srv_rec.entry[srv_rec.count].port = (pj_uint16_t)srv ->port ;624 625 srv_rec.entry[srv_rec.count].server.name = srv ->target_name;626 srv_rec.entry[srv_rec.count].server.alias = srv ->cname;619 struct srv_target *srv2 = &query_job->srv[i]; 620 621 srv_rec.entry[srv_rec.count].priority = srv2->priority; 622 srv_rec.entry[srv_rec.count].weight = srv2->weight; 623 srv_rec.entry[srv_rec.count].port = (pj_uint16_t)srv2->port ; 624 625 srv_rec.entry[srv_rec.count].server.name = srv2->target_name; 626 srv_rec.entry[srv_rec.count].server.alias = srv2->cname; 627 627 srv_rec.entry[srv_rec.count].server.addr_count = 0; 628 628 629 pj_assert(srv ->addr_cnt <= PJ_DNS_MAX_IP_IN_A_REC);630 631 for (j=0; j<srv ->addr_cnt; ++j) {629 pj_assert(srv2->addr_cnt <= PJ_DNS_MAX_IP_IN_A_REC); 630 631 for (j=0; j<srv2->addr_cnt; ++j) { 632 632 srv_rec.entry[srv_rec.count].server.addr[j].s_addr = 633 srv ->addr[j].s_addr;633 srv2->addr[j].s_addr; 634 634 ++srv_rec.entry[srv_rec.count].server.addr_count; 635 635 } 636 636 637 if (srv ->addr_cnt > 0) {637 if (srv2->addr_cnt > 0) { 638 638 ++srv_rec.count; 639 639 if (srv_rec.count == PJ_DNS_SRV_MAX_ADDR) -
pjproject/trunk/pjlib-util/src/pjlib-util/stun_simple.c
r3553 r5170 50 50 } 51 51 52 PJ_DEF(pj_status_t) pjstun_parse_msg( void *buf, pj_size_t len,53 52 PJ_DEF(pj_status_t) pjstun_parse_msg( void *buf, pj_size_t buf_len, 53 pjstun_msg *msg) 54 54 { 55 55 pj_uint16_t msg_type, msg_len; … … 75 75 76 76 msg_len = pj_ntohs(msg->hdr->length); 77 if (msg_len != len - sizeof(pjstun_msg_hdr)) {77 if (msg_len != buf_len - sizeof(pjstun_msg_hdr)) { 78 78 PJ_LOG(4,(THIS_FILE, "Error: invalid msg_len %d (expecting %d)", 79 msg_len, len - sizeof(pjstun_msg_hdr)));79 msg_len, buf_len - sizeof(pjstun_msg_hdr))); 80 80 return PJLIB_UTIL_ESTUNINMSGLEN; 81 81 } -
pjproject/trunk/pjlib/src/pj/errno.c
r4761 r5170 99 99 for (i=0; i<sizeof(err_str)/sizeof(err_str[0]); ++i) { 100 100 if (err_str[i].code == code) { 101 pj_size_t len =strlen(err_str[i].msg);102 if (len >= size) len= size-1;103 pj_memcpy(buf, err_str[i].msg, len );104 buf[len ] = '\0';105 return (int)len ;101 pj_size_t len2 = pj_ansi_strlen(err_str[i].msg); 102 if (len2 >= size) len2 = size-1; 103 pj_memcpy(buf, err_str[i].msg, len2); 104 buf[len2] = '\0'; 105 return (int)len2; 106 106 } 107 107 } -
pjproject/trunk/pjlib/src/pj/pool_caching.c
r4537 r5170 91 91 /* Delete all pool in free list */ 92 92 for (i=0; i < PJ_CACHING_POOL_ARRAY_SIZE; ++i) { 93 pj_pool_t *pool = (pj_pool_t*) cp->free_list[i].next;94 93 pj_pool_t *next; 94 pool = (pj_pool_t*) cp->free_list[i].next; 95 95 for (; pool != (void*)&cp->free_list[i]; pool = next) { 96 96 next = pool->next; -
pjproject/trunk/pjlib/src/pjlib-test/ioq_perf.c
r4537 r5170 85 85 86 86 if (bytes_read < 0) { 87 pj_status_t rc = (pj_status_t)-bytes_read;88 87 char errmsg[PJ_ERR_MSG_SIZE]; 89 88 89 rc = (pj_status_t)-bytes_read; 90 90 if (rc != last_error) { 91 91 //last_error = rc; -
pjproject/trunk/pjlib/src/pjlib-test/ioq_udp.c
r4537 r5170 264 264 // Poll if pending. 265 265 while (send_pending || recv_pending) { 266 int r c;266 int ret; 267 267 pj_time_val timeout = { 5, 0 }; 268 268 269 269 TRACE_("poll..."); 270 270 #ifdef PJ_SYMBIAN 271 r c= pj_symbianos_poll(-1, PJ_TIME_VAL_MSEC(timeout));271 ret = pj_symbianos_poll(-1, PJ_TIME_VAL_MSEC(timeout)); 272 272 #else 273 r c= pj_ioqueue_poll(ioque, &timeout);273 ret = pj_ioqueue_poll(ioque, &timeout); 274 274 #endif 275 275 276 if (r c== 0) {276 if (ret == 0) { 277 277 PJ_LOG(1,(THIS_FILE, "...ERROR: timed out...")); 278 278 status=-45; goto on_error; 279 } else if (r c< 0) {280 app_perror("...ERROR in ioqueue_poll()", -r c);279 } else if (ret < 0) { 280 app_perror("...ERROR in ioqueue_poll()", -ret); 281 281 status=-50; goto on_error; 282 282 } -
pjproject/trunk/pjlib/src/pjlib-test/pool.c
r4537 r5170 191 191 /* Drain the pool until there's nothing left. */ 192 192 while (freesize > 0) { 193 int size ;193 int size2; 194 194 195 195 if (freesize > 255) 196 size = ((pj_rand() & 0x000000FF) + PJ_POOL_ALIGNMENT) &196 size2 = ((pj_rand() & 0x000000FF) + PJ_POOL_ALIGNMENT) & 197 197 ~(PJ_POOL_ALIGNMENT - 1); 198 198 else 199 size = (int)freesize;200 201 p = pj_pool_alloc(pool, size );199 size2 = (int)freesize; 200 201 p = pj_pool_alloc(pool, size2); 202 202 if (!p) { 203 203 status=-20; goto on_error; 204 204 } 205 205 206 freesize -= size ;206 freesize -= size2; 207 207 } 208 208 -
pjproject/trunk/pjlib/src/pjlib-test/pool_perf.c
r3553 r5170 48 48 49 49 for (i=0; i<COUNT; ++i) { 50 char *p ;51 if ( (p =(char*)pj_pool_alloc(pool, sizes[i])) == NULL) {50 char *ptr; 51 if ( (ptr=(char*)pj_pool_alloc(pool, sizes[i])) == NULL) { 52 52 PJ_LOG(3,(THIS_FILE," error: pool failed to allocate %d bytes", 53 53 sizes[i])); … … 55 55 return -1; 56 56 } 57 *p = '\0';57 *ptr = '\0'; 58 58 } 59 59 -
pjproject/trunk/pjlib/src/pjlib-test/timer.c
r4537 r5170 59 59 pj_timer_heap_t *timer; 60 60 pj_time_val delay; 61 pj_status_t rc; int err=0; 61 pj_status_t status; 62 int err=0; 62 63 pj_size_t size; 63 64 unsigned count; … … 78 79 entry[i].cb = &timer_callback; 79 80 } 80 rc= pj_timer_heap_create(pool, MAX_COUNT, &timer);81 if ( rc!= PJ_SUCCESS) {82 app_perror("...error: unable to create timer heap", rc);81 status = pj_timer_heap_create(pool, MAX_COUNT, &timer); 82 if (status != PJ_SUCCESS) { 83 app_perror("...error: unable to create timer heap", status); 83 84 return -30; 84 85 } -
pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
r4537 r5170 37 37 }; 38 38 39 static void on_read_complete(pj_ioqueue_key_t * key,39 static void on_read_complete(pj_ioqueue_key_t *ioq_key, 40 40 pj_ioqueue_op_key_t *op_key, 41 41 pj_ssize_t bytes_received) … … 63 63 pj_memcpy(&send_rec->addr, &recv_rec->addr, recv_rec->addrlen); 64 64 send_rec->addrlen = recv_rec->addrlen; 65 rc = pj_ioqueue_sendto( key, &send_rec->op_key_,65 rc = pj_ioqueue_sendto(ioq_key, &send_rec->op_key_, 66 66 send_rec->buffer, &sent, 0, 67 67 &send_rec->addr, send_rec->addrlen); … … 76 76 if (!send_rec->is_pending) { 77 77 bytes_received = recv_rec->size; 78 rc = pj_ioqueue_recvfrom( key, &recv_rec->op_key_,78 rc = pj_ioqueue_recvfrom(ioq_key, &recv_rec->op_key_, 79 79 recv_rec->buffer, &bytes_received, 0, 80 80 &recv_rec->addr, &recv_rec->addrlen); … … 100 100 } 101 101 102 static void on_write_complete(pj_ioqueue_key_t * key,102 static void on_write_complete(pj_ioqueue_key_t *ioq_key, 103 103 pj_ioqueue_op_key_t *op_key, 104 104 pj_ssize_t bytes_sent) … … 115 115 116 116 send_rec->is_pending = 0; 117 on_read_complete( key, &send_rec->peer->op_key_, 0);117 on_read_complete(ioq_key, &send_rec->peer->op_key_, 0); 118 118 } 119 119 -
pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
r4890 r5170 485 485 enum { MAX_FMTP_STR_LEN = 160 }; 486 486 char buf[MAX_FMTP_STR_LEN]; 487 unsigned buf_len = 0, i ;487 unsigned buf_len = 0, ii; 488 488 pjmedia_codec_fmtp *dec_fmtp = &codec_param.setting.dec_fmtp; 489 489 … … 494 494 codec_info->pt); 495 495 496 for (i = 0; i < dec_fmtp->cnt; ++i) {496 for (ii = 0; ii < dec_fmtp->cnt; ++ii) { 497 497 pj_size_t test_len = 2; 498 498 499 499 /* Check if buf still available */ 500 test_len = dec_fmtp->param[i ].val.slen +501 dec_fmtp->param[i ].name.slen + 2;500 test_len = dec_fmtp->param[ii].val.slen + 501 dec_fmtp->param[ii].name.slen + 2; 502 502 if (test_len + buf_len >= MAX_FMTP_STR_LEN) 503 503 return PJ_ETOOBIG; … … 506 506 buf_len += pj_ansi_snprintf(&buf[buf_len], 507 507 MAX_FMTP_STR_LEN - buf_len, 508 (i == 0?" ":";"));508 (ii == 0?" ":";")); 509 509 510 510 /* Print an fmtp param */ 511 if (dec_fmtp->param[i ].name.slen)511 if (dec_fmtp->param[ii].name.slen) 512 512 buf_len += pj_ansi_snprintf( 513 513 &buf[buf_len], 514 514 MAX_FMTP_STR_LEN - buf_len, 515 515 "%.*s=%.*s", 516 (int)dec_fmtp->param[i ].name.slen,517 dec_fmtp->param[i ].name.ptr,518 (int)dec_fmtp->param[i ].val.slen,519 dec_fmtp->param[i ].val.ptr);516 (int)dec_fmtp->param[ii].name.slen, 517 dec_fmtp->param[ii].name.ptr, 518 (int)dec_fmtp->param[ii].val.slen, 519 dec_fmtp->param[ii].val.ptr); 520 520 else 521 521 buf_len += pj_ansi_snprintf(&buf[buf_len], 522 522 MAX_FMTP_STR_LEN - buf_len, 523 523 "%.*s", 524 (int)dec_fmtp->param[i ].val.slen,525 dec_fmtp->param[i ].val.ptr);524 (int)dec_fmtp->param[ii].val.slen, 525 dec_fmtp->param[ii].val.ptr); 526 526 } 527 527 -
pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
r5129 r5170 1177 1177 /* Match! */ 1178 1178 if (is_codec) { 1179 pjmedia_sdp_media *o , *a;1179 pjmedia_sdp_media *o_med, *a_med; 1180 1180 unsigned o_fmt_idx, a_fmt_idx; 1181 1181 1182 o = (pjmedia_sdp_media*)offer;1183 a = (pjmedia_sdp_media*)preanswer;1182 o_med = (pjmedia_sdp_media*)offer; 1183 a_med = (pjmedia_sdp_media*)preanswer; 1184 1184 o_fmt_idx = prefer_remote_codec_order? i:j; 1185 1185 a_fmt_idx = prefer_remote_codec_order? j:i; … … 1187 1187 /* Call custom format matching callbacks */ 1188 1188 if (custom_fmt_match(pool, &or_.enc_name, 1189 o , o_fmt_idx,1190 a , a_fmt_idx,1189 o_med, o_fmt_idx, 1190 a_med, a_fmt_idx, 1191 1191 ALLOW_MODIFY_ANSWER) != 1192 1192 PJ_SUCCESS) -
pjproject/trunk/pjmedia/src/pjmedia/tonegen.c
r4537 r5170 666 666 /* Fade in */ 667 667 short *samp = (dst - cnt); 668 short * end;668 short *samp_end; 669 669 670 670 if (cnt > tonegen->fade_in_len) 671 671 cnt = tonegen->fade_in_len; 672 end = samp + cnt;672 samp_end = samp + cnt; 673 673 if (cnt) { 674 674 const unsigned step = 0xFFFF / cnt; 675 675 unsigned scale = 0; 676 676 677 for (; samp < end; ++samp) {677 for (; samp < samp_end; ++samp) { 678 678 (*samp) = (short)(((*samp) * scale) >> 16); 679 679 scale += step; -
pjproject/trunk/pjmedia/src/pjmedia/wav_player.c
r4793 r5170 581 581 struct file_reader_port *fport = (struct file_reader_port*)this_port; 582 582 pj_size_t frame_size; 583 pj_status_t status ;583 pj_status_t status = PJ_SUCCESS; 584 584 585 585 pj_assert(fport->base.info.signature == SIGNATURE); … … 588 588 /* EOF is set and readpos already passed the eofpos */ 589 589 if (fport->eof && fport->readpos >= fport->eofpos) { 590 pj_status_t status = PJ_SUCCESS;591 592 590 PJ_LOG(5,(THIS_FILE, "File port %.*s EOF", 593 591 (int)fport->base.info.name.slen, -
pjproject/trunk/pjmedia/src/test/codec_vectors.c
r5058 r5170 160 160 pos = 0; 161 161 for (;;) { 162 pj_size_t count ;162 pj_size_t count2; 163 163 164 count = fread(in_frame.buf, encoded_frame_len, 1, fref);165 if (count != 1)164 count2 = fread(in_frame.buf, encoded_frame_len, 1, fref); 165 if (count2 != 1) 166 166 break; 167 167 168 count = fread(out_frame.buf, encoded_frame_len, 1, output);169 if (count != 1)168 count2 = fread(out_frame.buf, encoded_frame_len, 1, output); 169 if (count2 != 1) 170 170 break; 171 171 … … 381 381 pjmedia_frame in_frame[2]; 382 382 pj_timestamp ts; 383 unsigned count ;383 unsigned count2; 384 384 pj_bool_t has_frame; 385 385 … … 402 402 403 403 if (has_frame) { 404 count = 2;404 count2 = 2; 405 405 if (pjmedia_codec_parse(codec, pkt, encoded_len, &ts, 406 &count , in_frame) != PJ_SUCCESS)406 &count2, in_frame) != PJ_SUCCESS) 407 407 { 408 408 rc = -100; … … 410 410 } 411 411 412 if (count != 1) {412 if (count2 != 1) { 413 413 rc = -110; 414 414 goto on_return; … … 460 460 pos = 0; 461 461 for (;;) { 462 pj_size_t count ;462 pj_size_t count2; 463 463 464 count = fread(pkt, samples_per_frame*2, 1, fref);465 if (count != 1)464 count2 = fread(pkt, samples_per_frame*2, 1, fref); 465 if (count2 != 1) 466 466 break; 467 467 468 count = fread(out_frame.buf, samples_per_frame*2, 1, output);469 if (count != 1)468 count2 = fread(out_frame.buf, samples_per_frame*2, 1, output); 469 if (count2 != 1) 470 470 break; 471 471 -
pjproject/trunk/pjmedia/src/test/mips_test.c
r4335 r5170 2491 2491 }; 2492 2492 2493 unsigned i, c, k[3] = {K8, K16, K32}, clock_rates[3] = {8000, 16000, 32000};2493 unsigned i, c, clks[3] = {K8, K16, K32}, clock_rates[3] = {8000, 16000, 32000}; 2494 2494 2495 2495 PJ_LOG(3,(THIS_FILE, "MIPS test, with CPU=%dMhz, %6.1f MIPS", CPU_MHZ, CPU_IPS / 1000000)); … … 2510 2510 unsigned j, clock_rate = clock_rates[c]; 2511 2511 2512 if ((e->valid_clock_rate & k[c]) == 0)2512 if ((e->valid_clock_rate & clks[c]) == 0) 2513 2513 continue; 2514 2514 -
pjproject/trunk/pjnath/src/pjnath-test/server.c
r4537 r5170 425 425 pj_stun_username_attr *uname; 426 426 pj_activesock_cb alloc_sock_cb; 427 turn_allocation *alloc;427 ///turn_allocation *alloc; 428 428 429 429 /* Must be Allocate request */ -
pjproject/trunk/pjnath/src/pjnath-test/stun.c
r4910 r5170 693 693 if (PJ_STUN_IS_REQUEST(msg->hdr.type)) { 694 694 pj_stun_auth_cred cred; 695 pj_status_t status ;695 pj_status_t status2; 696 696 697 697 pj_bzero(&cred, sizeof(cred)); … … 702 702 cred.data.static_cred.nonce = pj_str(v->nonce); 703 703 704 status = pj_stun_authenticate_request(buf, (unsigned)len, msg,704 status2 = pj_stun_authenticate_request(buf, (unsigned)len, msg, 705 705 &cred, pool, NULL, NULL); 706 if (status != PJ_SUCCESS) {706 if (status2 != PJ_SUCCESS) { 707 707 char errmsg[PJ_ERR_MSG_SIZE]; 708 pj_strerror(status , errmsg, sizeof(errmsg));708 pj_strerror(status2, errmsg, sizeof(errmsg)); 709 709 PJ_LOG(1,(THIS_FILE, 710 710 " Request authentication failed: %s", … … 715 715 716 716 } else if (PJ_STUN_IS_RESPONSE(msg->hdr.type)) { 717 pj_status_t status ;718 status = pj_stun_authenticate_response(buf, (unsigned)len,717 pj_status_t status2; 718 status2 = pj_stun_authenticate_response(buf, (unsigned)len, 719 719 msg, &key); 720 if (status != PJ_SUCCESS) {720 if (status2 != PJ_SUCCESS) { 721 721 char errmsg[PJ_ERR_MSG_SIZE]; 722 pj_strerror(status , errmsg, sizeof(errmsg));722 pj_strerror(status2, errmsg, sizeof(errmsg)); 723 723 PJ_LOG(1,(THIS_FILE, 724 724 " Response authentication failed: %s", -
pjproject/trunk/pjnath/src/pjnath/ice_session.c
r5070 r5170 1601 1601 const pj_str_t *rem_ufrag, 1602 1602 const pj_str_t *rem_passwd, 1603 unsigned r cand_cnt,1604 const pj_ice_sess_cand r cand[])1603 unsigned rem_cand_cnt, 1604 const pj_ice_sess_cand rem_cand[]) 1605 1605 { 1606 1606 pj_ice_sess_checklist *clist; … … 1612 1612 pj_status_t status; 1613 1613 1614 PJ_ASSERT_RETURN(ice && rem_ufrag && rem_passwd && r cand_cnt && rcand,1615 PJ_EINVAL);1616 PJ_ASSERT_RETURN(r cand_cnt + ice->rcand_cnt <= PJ_ICE_MAX_CAND,1614 PJ_ASSERT_RETURN(ice && rem_ufrag && rem_passwd && rem_cand_cnt && 1615 rem_cand, PJ_EINVAL); 1616 PJ_ASSERT_RETURN(rem_cand_cnt + ice->rcand_cnt <= PJ_ICE_MAX_CAND, 1617 1617 PJ_ETOOMANY); 1618 1618 … … 1639 1639 /* Save remote candidates */ 1640 1640 ice->rcand_cnt = 0; 1641 for (i=0; i<r cand_cnt; ++i) {1641 for (i=0; i<rem_cand_cnt; ++i) { 1642 1642 pj_ice_sess_cand *cn = &ice->rcand[ice->rcand_cnt]; 1643 1643 1644 1644 /* Ignore candidate which has no matching component ID */ 1645 if (r cand[i].comp_id==0 || rcand[i].comp_id > ice->comp_cnt) {1645 if (rem_cand[i].comp_id==0 || rem_cand[i].comp_id > ice->comp_cnt) { 1646 1646 continue; 1647 1647 } 1648 1648 1649 if (r cand[i].comp_id > highest_comp)1650 highest_comp = r cand[i].comp_id;1651 1652 pj_memcpy(cn, &r cand[i], sizeof(pj_ice_sess_cand));1653 pj_strdup(ice->pool, &cn->foundation, &r cand[i].foundation);1649 if (rem_cand[i].comp_id > highest_comp) 1650 highest_comp = rem_cand[i].comp_id; 1651 1652 pj_memcpy(cn, &rem_cand[i], sizeof(pj_ice_sess_cand)); 1653 pj_strdup(ice->pool, &cn->foundation, &rem_cand[i].foundation); 1654 1654 ice->rcand_cnt++; 1655 1655 } -
pjproject/trunk/pjnath/src/pjnath/turn_session.c
r4606 r5170 1292 1292 const pj_stun_sockaddr_attr *mapped_attr; 1293 1293 pj_str_t s; 1294 pj_time_val timeout;1295 1294 1296 1295 /* Must have LIFETIME attribute */ … … 1397 1396 /* Start keep-alive timer once allocation succeeds */ 1398 1397 if (sess->state < PJ_TURN_STATE_DEALLOCATING) { 1398 pj_time_val timeout; 1399 1399 timeout.sec = sess->ka_interval; 1400 1400 timeout.msec = 0; … … 1772 1772 1773 1773 if (bind_channel) { 1774 pj_uint32_t hval = 0;1774 pj_uint32_t hval2 = 0; 1775 1775 /* Register by channel number */ 1776 1776 pj_assert(ch->num != PJ_TURN_INVALID_CHANNEL && ch->bound); 1777 1777 1778 1778 if (pj_hash_get(sess->ch_table, &ch->num, 1779 sizeof(ch->num), &hval )==0) {1779 sizeof(ch->num), &hval2)==0) { 1780 1780 pj_hash_set(sess->pool, sess->ch_table, &ch->num, 1781 sizeof(ch->num), hval , ch);1781 sizeof(ch->num), hval2, ch); 1782 1782 } 1783 1783 } -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r5149 r5170 139 139 { 140 140 pjsua_call_id call_id = entry->id; 141 pjsua_msg_data msg_data ;141 pjsua_msg_data msg_data_; 142 142 pjsip_generic_string_hdr warn; 143 143 pj_str_t hname = pj_str("Warning"); … … 152 152 153 153 /* Add warning header */ 154 pjsua_msg_data_init(&msg_data );154 pjsua_msg_data_init(&msg_data_); 155 155 pjsip_generic_string_hdr_init2(&warn, &hname, &hvalue); 156 pj_list_push_back(&msg_data .hdr_list, &warn);156 pj_list_push_back(&msg_data_.hdr_list, &warn); 157 157 158 158 /* Call duration has been exceeded; disconnect the call */ … … 161 161 app_config.duration, call_id)); 162 162 entry->id = PJSUA_INVALID_ID; 163 pjsua_call_hangup(call_id, 200, NULL, &msg_data );163 pjsua_call_hangup(call_id, 200, NULL, &msg_data_); 164 164 } 165 165 … … 294 294 295 295 if (app_config.auto_answer > 0) { 296 pjsua_call_setting call_opt;297 298 pjsua_call_setting_default(& call_opt);299 call_opt.aud_cnt = app_config.aud_cnt;300 call_opt.vid_cnt = app_config.vid.vid_cnt;301 302 pjsua_call_answer2(call_id, & call_opt, app_config.auto_answer, NULL,296 pjsua_call_setting opt; 297 298 pjsua_call_setting_default(&opt); 299 opt.aud_cnt = app_config.aud_cnt; 300 opt.vid_cnt = app_config.vid.vid_cnt; 301 302 pjsua_call_answer2(call_id, &opt, app_config.auto_answer, NULL, 303 303 NULL); 304 304 } … … 668 668 pjsip_status_code *code, 669 669 pj_str_t *reason, 670 pjsua_msg_data *msg_data )670 pjsua_msg_data *msg_data_) 671 671 { 672 672 /* Just accept the request (the default behavior) */ … … 678 678 PJ_UNUSED_ARG(code); 679 679 PJ_UNUSED_ARG(reason); 680 PJ_UNUSED_ARG(msg_data );680 PJ_UNUSED_ARG(msg_data_); 681 681 } 682 682 … … 1413 1413 char name[80]; 1414 1414 pj_str_t label; 1415 pj_status_t status ;1415 pj_status_t status2; 1416 1416 1417 1417 pj_ansi_snprintf(name, sizeof(name), "tone-%d,%d", … … 1419 1419 app_config.tones[i].freq2); 1420 1420 label = pj_str(name); 1421 status = pjmedia_tonegen_create2(app_config.pool, &label,1422 8000, 1, 160, 16,1423 PJMEDIA_TONEGEN_LOOP, &tport);1424 if (status != PJ_SUCCESS) {1421 status2 = pjmedia_tonegen_create2(app_config.pool, &label, 1422 8000, 1, 160, 16, 1423 PJMEDIA_TONEGEN_LOOP, &tport); 1424 if (status2 != PJ_SUCCESS) { 1425 1425 pjsua_perror(THIS_FILE, "Unable to create tone generator", status); 1426 1426 goto on_error; 1427 1427 } 1428 1428 1429 status = pjsua_conf_add_port(app_config.pool, tport,1429 status2 = pjsua_conf_add_port(app_config.pool, tport, 1430 1430 &app_config.tone_slots[i]); 1431 pj_assert(status == PJ_SUCCESS);1432 1433 status = pjmedia_tonegen_play(tport, 1, &app_config.tones[i], 0);1434 pj_assert(status == PJ_SUCCESS);1431 pj_assert(status2 == PJ_SUCCESS); 1432 1433 status2 = pjmedia_tonegen_play(tport, 1, &app_config.tones[i], 0); 1434 pj_assert(status2 == PJ_SUCCESS); 1435 1435 } 1436 1436 … … 1449 1449 /* Create ringback tones */ 1450 1450 if (app_config.no_tones == PJ_FALSE) { 1451 unsigned i,samples_per_frame;1451 unsigned samples_per_frame; 1452 1452 pjmedia_tone_desc tone[RING_CNT+RINGBACK_CNT]; 1453 1453 pj_str_t name; -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_cli.c
r4826 r5170 1749 1749 } 1750 1750 } else if (result.uri_result) { 1751 pj_str_t tmp ;1752 tmp = pj_str(result.uri_result);1753 pjsua_call_xfer( current_call, &tmp , &msg_data);1751 pj_str_t tmp2; 1752 tmp2 = pj_str(result.uri_result); 1753 pjsua_call_xfer( current_call, &tmp2, &msg_data); 1754 1754 } 1755 1755 } … … 1769 1769 pj_str_t STR_FALSE = { "false", 5 }; 1770 1770 pjsua_call_id ids[PJSUA_MAX_CALLS]; 1771 pjsua_msg_data msg_data ;1771 pjsua_msg_data msg_data_; 1772 1772 char buf[8] = {0}; 1773 1773 pj_str_t tmp = pj_str(buf); … … 1823 1823 } 1824 1824 1825 pjsua_msg_data_init(&msg_data );1825 pjsua_msg_data_init(&msg_data_); 1826 1826 if (app_config.no_refersub) { 1827 1827 /* Add Refer-Sub: false in outgoing REFER request */ 1828 1828 pjsip_generic_string_hdr_init2(&refer_sub, &STR_REFER_SUB, 1829 1829 &STR_FALSE); 1830 pj_list_push_back(&msg_data .hdr_list, &refer_sub);1830 pj_list_push_back(&msg_data_.hdr_list, &refer_sub); 1831 1831 } 1832 1832 1833 1833 pjsua_call_xfer_replaces(call, dst_call, 1834 1834 PJSUA_XFER_NO_REQUIRE_REPLACES, 1835 &msg_data );1835 &msg_data_); 1836 1836 } 1837 1837 return PJ_SUCCESS; … … 2662 2662 } 2663 2663 2664 static pj_status_t add_call_command(pj_cli_t *c li)2664 static pj_status_t add_call_command(pj_cli_t *c) 2665 2665 { 2666 2666 char* call_command = … … 2734 2734 2735 2735 pj_str_t xml = pj_str(call_command); 2736 return pj_cli_add_cmd_from_xml(c li, NULL,2736 return pj_cli_add_cmd_from_xml(c, NULL, 2737 2737 &xml, cmd_call_handler, 2738 2738 NULL, get_choice_value); 2739 2739 } 2740 2740 2741 static pj_status_t add_presence_command(pj_cli_t *c li)2741 static pj_status_t add_presence_command(pj_cli_t *c) 2742 2742 { 2743 2743 char* presence_command = … … 2790 2790 pj_str_t xml = pj_str(presence_command); 2791 2791 2792 return pj_cli_add_cmd_from_xml(c li, NULL,2792 return pj_cli_add_cmd_from_xml(c, NULL, 2793 2793 &xml, cmd_presence_handler, 2794 2794 NULL, get_choice_value); 2795 2795 } 2796 2796 2797 static pj_status_t add_account_command(pj_cli_t *c li)2797 static pj_status_t add_account_command(pj_cli_t *c) 2798 2798 { 2799 2799 char* account_command = … … 2835 2835 2836 2836 pj_str_t xml = pj_str(account_command); 2837 return pj_cli_add_cmd_from_xml(c li, NULL,2837 return pj_cli_add_cmd_from_xml(c, NULL, 2838 2838 &xml, cmd_account_handler, 2839 2839 NULL, get_choice_value); 2840 2840 } 2841 2841 2842 static pj_status_t add_media_command(pj_cli_t *c li)2842 static pj_status_t add_media_command(pj_cli_t *c) 2843 2843 { 2844 2844 char* media_command = … … 2870 2870 2871 2871 pj_str_t xml = pj_str(media_command); 2872 return pj_cli_add_cmd_from_xml(c li, NULL,2872 return pj_cli_add_cmd_from_xml(c, NULL, 2873 2873 &xml, cmd_media_handler, 2874 2874 NULL, get_choice_value); 2875 2875 } 2876 2876 2877 static pj_status_t add_config_command(pj_cli_t *c li)2877 static pj_status_t add_config_command(pj_cli_t *c) 2878 2878 { 2879 2879 char* config_command = … … 2891 2891 2892 2892 pj_str_t xml = pj_str(config_command); 2893 return pj_cli_add_cmd_from_xml(c li, NULL,2893 return pj_cli_add_cmd_from_xml(c, NULL, 2894 2894 &xml, cmd_config_handler, 2895 2895 NULL, get_choice_value); … … 3042 3042 #endif 3043 3043 3044 static pj_status_t add_other_command(pj_cli_t *c li)3044 static pj_status_t add_other_command(pj_cli_t *c) 3045 3045 { 3046 3046 char* sleep_command = … … 3069 3069 pj_str_t restart_xml = pj_str(restart_command); 3070 3070 3071 status = pj_cli_add_cmd_from_xml(c li, NULL,3071 status = pj_cli_add_cmd_from_xml(c, NULL, 3072 3072 &sleep_xml, cmd_sleep_handler, 3073 3073 NULL, NULL); … … 3075 3075 return status; 3076 3076 3077 status = pj_cli_add_cmd_from_xml(c li, NULL,3077 status = pj_cli_add_cmd_from_xml(c, NULL, 3078 3078 &network_xml, cmd_network_handler, 3079 3079 NULL, NULL); … … 3081 3081 return status; 3082 3082 3083 status = pj_cli_add_cmd_from_xml(c li, NULL,3083 status = pj_cli_add_cmd_from_xml(c, NULL, 3084 3084 &shutdown_xml, cmd_quit_handler, 3085 3085 NULL, NULL); … … 3088 3088 return status; 3089 3089 3090 status = pj_cli_add_cmd_from_xml(c li, NULL,3090 status = pj_cli_add_cmd_from_xml(c, NULL, 3091 3091 &restart_xml, cmd_restart_handler, 3092 3092 NULL, NULL); … … 3095 3095 } 3096 3096 3097 pj_status_t cli_setup_command(pj_cli_t *c li)3097 pj_status_t cli_setup_command(pj_cli_t *c) 3098 3098 { 3099 3099 pj_status_t status; 3100 3100 3101 status = add_call_command(c li);3101 status = add_call_command(c); 3102 3102 if (status != PJ_SUCCESS) 3103 3103 return status; 3104 3104 3105 status = add_presence_command(c li);3105 status = add_presence_command(c); 3106 3106 if (status != PJ_SUCCESS) 3107 3107 return status; 3108 3108 3109 status = add_account_command(c li);3109 status = add_account_command(c); 3110 3110 if (status != PJ_SUCCESS) 3111 3111 return status; 3112 3112 3113 status = add_media_command(c li);3113 status = add_media_command(c); 3114 3114 if (status != PJ_SUCCESS) 3115 3115 return status; 3116 3116 3117 status = add_config_command(c li);3117 status = add_config_command(c); 3118 3118 if (status != PJ_SUCCESS) 3119 3119 return status; 3120 3120 3121 3121 #if PJSUA_HAS_VIDEO 3122 status = add_video_command(c li);3122 status = add_video_command(c); 3123 3123 if (status != PJ_SUCCESS) 3124 3124 return status; 3125 3125 #endif 3126 3126 3127 status = add_other_command(c li);3127 status = add_other_command(c); 3128 3128 3129 3129 return status; -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_legacy.c
r5065 r5170 607 607 { 608 608 char buf[128]; 609 pjsua_msg_data msg_data ;609 pjsua_msg_data msg_data_; 610 610 input_result result; 611 611 pj_str_t tmp; … … 632 632 } 633 633 634 pjsua_msg_data_init(&msg_data );635 TEST_MULTIPART(&msg_data );634 pjsua_msg_data_init(&msg_data_); 635 TEST_MULTIPART(&msg_data_); 636 636 pjsua_call_make_call(current_acc, &tmp, &call_opt, NULL, 637 &msg_data , ¤t_call);637 &msg_data_, ¤t_call); 638 638 } 639 639 … … 758 758 pjsua_call_info call_info; 759 759 char buf[128]; 760 pjsua_msg_data msg_data ;760 pjsua_msg_data msg_data_; 761 761 762 762 if (current_call != -1) { … … 790 790 return; 791 791 792 pjsua_msg_data_init(&msg_data );792 pjsua_msg_data_init(&msg_data_); 793 793 794 794 if (st_code/100 == 3) { … … 799 799 pjsip_generic_string_hdr_init2(&hcontact, &hname, &hvalue); 800 800 801 pj_list_push_back(&msg_data .hdr_list, &hcontact);801 pj_list_push_back(&msg_data_.hdr_list, &hcontact); 802 802 } 803 803 … … 813 813 } 814 814 815 pjsua_call_answer2(current_call, &call_opt, st_code, NULL, &msg_data );815 pjsua_call_answer2(current_call, &call_opt, st_code, NULL, &msg_data_); 816 816 } 817 817 } … … 1080 1080 pjsua_call_info ci; 1081 1081 input_result result; 1082 pjsua_msg_data msg_data ;1082 pjsua_msg_data msg_data_; 1083 1083 1084 1084 pjsua_call_get_info(current_call, &ci); … … 1095 1095 } 1096 1096 1097 pjsua_msg_data_init(&msg_data );1097 pjsua_msg_data_init(&msg_data_); 1098 1098 if (no_refersub) { 1099 1099 /* Add Refer-Sub: false in outgoing REFER request */ 1100 1100 pjsip_generic_string_hdr_init2(&refer_sub, &STR_REFER_SUB, 1101 1101 &STR_FALSE); 1102 pj_list_push_back(&msg_data .hdr_list, &refer_sub);1102 pj_list_push_back(&msg_data_.hdr_list, &refer_sub); 1103 1103 } 1104 1104 if (result.nb_result != PJSUA_APP_NO_NB) { … … 1108 1108 pjsua_buddy_info binfo; 1109 1109 pjsua_buddy_get_info(result.nb_result-1, &binfo); 1110 pjsua_call_xfer( current_call, &binfo.uri, &msg_data );1110 pjsua_call_xfer( current_call, &binfo.uri, &msg_data_); 1111 1111 } 1112 1112 … … 1114 1114 pj_str_t tmp; 1115 1115 tmp = pj_str(result.uri_result); 1116 pjsua_call_xfer( current_call, &tmp, &msg_data );1116 pjsua_call_xfer( current_call, &tmp, &msg_data_); 1117 1117 } 1118 1118 } … … 1131 1131 pjsua_call_id ids[PJSUA_MAX_CALLS]; 1132 1132 pjsua_call_info ci; 1133 pjsua_msg_data msg_data ;1133 pjsua_msg_data msg_data_; 1134 1134 char buf[128]; 1135 1135 unsigned i, count; … … 1190 1190 } 1191 1191 1192 pjsua_msg_data_init(&msg_data );1192 pjsua_msg_data_init(&msg_data_); 1193 1193 if (no_refersub) { 1194 1194 /* Add Refer-Sub: false in outgoing REFER request */ 1195 1195 pjsip_generic_string_hdr_init2(&refer_sub, &STR_REFER_SUB, 1196 1196 &STR_FALSE); 1197 pj_list_push_back(&msg_data .hdr_list, &refer_sub);1197 pj_list_push_back(&msg_data_.hdr_list, &refer_sub); 1198 1198 } 1199 1199 1200 1200 pjsua_call_xfer_replaces(call, dst_call, 1201 1201 PJSUA_XFER_NO_REQUIRE_REPLACES, 1202 &msg_data );1202 &msg_data_); 1203 1203 } 1204 1204 } … … 1263 1263 for (i=0; i<digits.slen; ++i) { 1264 1264 char body[80]; 1265 pjsua_msg_data msg_data ;1265 pjsua_msg_data msg_data_; 1266 1266 1267 1267 pjsua_msg_data_init(&msg_data); 1268 msg_data .content_type = pj_str("application/dtmf-relay");1268 msg_data_.content_type = pj_str("application/dtmf-relay"); 1269 1269 1270 1270 pj_ansi_snprintf(body, sizeof(body), … … 1272 1272 "Duration=160", 1273 1273 buf[i]); 1274 msg_data .msg_body = pj_str(body);1274 msg_data_.msg_body = pj_str(body); 1275 1275 1276 1276 status = pjsua_call_send_request(current_call, &SIP_INFO, 1277 &msg_data);1277 &msg_data_); 1278 1278 if (status != PJ_SUCCESS) { 1279 1279 return; -
pjproject/trunk/pjsip-apps/src/samples/clidemo.c
r4440 r5170 220 220 * Simple implementation of app_main() for console targets 221 221 */ 222 pj_status_t app_main(pj_cli_t *c li)222 pj_status_t app_main(pj_cli_t *c) 223 223 { 224 224 pj_status_t status; … … 232 232 * Create the console front end 233 233 */ 234 status = pj_cli_console_create(c li, &console_cfg, &sess, NULL);234 status = pj_cli_console_create(c, &console_cfg, &sess, NULL); 235 235 if (status != PJ_SUCCESS) 236 236 return status; … … 243 243 for (;;) { 244 244 char cmdline[PJ_CLI_MAX_CMDBUF]; 245 pj_status_t status;246 245 247 246 status = pj_cli_console_process(sess, &cmdline[0], sizeof(cmdline)); -
pjproject/trunk/pjsip-apps/src/samples/httpdemo.c
r3553 r5170 44 44 #define THIS_FILE "http_demo" 45 45 46 static void on_response(pj_http_req * http_req, const pj_http_resp *resp)46 static void on_response(pj_http_req *req, const pj_http_resp *resp) 47 47 { 48 48 unsigned i; 49 49 50 PJ_UNUSED_ARG( http_req);50 PJ_UNUSED_ARG(req); 51 51 PJ_LOG(3,(THIS_FILE, "%.*s %d %.*s", (int)resp->version.slen, resp->version.ptr, 52 52 resp->status_code, … … 66 66 } 67 67 68 static void on_send_data(pj_http_req * http_req, void **data, pj_size_t *size)68 static void on_send_data(pj_http_req *req, void **data, pj_size_t *size) 69 69 { 70 PJ_UNUSED_ARG( http_req);70 PJ_UNUSED_ARG(req); 71 71 PJ_UNUSED_ARG(size); 72 72 PJ_UNUSED_ARG(data); -
pjproject/trunk/pjsip-apps/src/samples/mix.c
r3664 r5170 196 196 while (processed < longest + clock_rate * APPEND * 2 / 1000) { 197 197 pj_int16_t framebuf[PTIME * 48000 / 1000]; 198 pjmedia_port * cp = pjmedia_conf_get_master_port(conf);198 pjmedia_port *mp = pjmedia_conf_get_master_port(conf); 199 199 pjmedia_frame frame; 200 200 201 201 frame.buf = framebuf; 202 frame.size = PJMEDIA_PIA_SPF(& cp->info) * 2;202 frame.size = PJMEDIA_PIA_SPF(&mp->info) * 2; 203 203 pj_assert(frame.size <= sizeof(framebuf)); 204 204 205 CHECK( pjmedia_port_get_frame( cp, &frame) );205 CHECK( pjmedia_port_get_frame(mp, &frame) ); 206 206 207 207 if (frame.type != PJMEDIA_FRAME_TYPE_AUDIO) { -
pjproject/trunk/pjsip-apps/src/samples/pcaputil.c
r5035 r5170 372 372 samples_cnt = 0; 373 373 for (i=0; i<frame_cnt; ++i) { 374 pjmedia_frame pcm_frame;375 376 374 pcm_frame.buf = pcm; 377 375 pcm_frame.size = samples_per_frame * 2; -
pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c
r5035 r5170 968 968 if (status != PJ_SUCCESS) { 969 969 pjsip_tx_data *tdata; 970 pj_status_t status ;971 972 status = pjsip_inv_end_session(inv, PJSIP_SC_UNSUPPORTED_MEDIA_TYPE,970 pj_status_t status2; 971 972 status2 = pjsip_inv_end_session(inv, PJSIP_SC_UNSUPPORTED_MEDIA_TYPE, 973 973 NULL, &tdata); 974 if (status == PJ_SUCCESS && tdata)975 status = pjsip_inv_send_msg(inv, tdata);974 if (status2 == PJ_SUCCESS && tdata) 975 status2 = pjsip_inv_send_msg(inv, tdata); 976 976 } 977 977 } -
pjproject/trunk/pjsip-apps/src/samples/siprtp.c
r5035 r5170 1060 1060 { 1061 1061 pjmedia_sdp_rtpmap rtpmap; 1062 pjmedia_sdp_attr *attr;1063 1062 char ptstr[10]; 1064 1063 … … 2126 2125 /* If URL is specified, then make call immediately */ 2127 2126 if (app.uri_to_call.slen) { 2128 unsigned i;2129 2130 2127 PJ_LOG(3,(THIS_FILE, "Making %d calls to %s..", app.max_calls, 2131 2128 app.uri_to_call.ptr)); -
pjproject/trunk/pjsip-apps/src/samples/stateful_proxy.c
r4420 r5170 248 248 /* This is CANCEL request */ 249 249 pjsip_transaction *invite_uas; 250 struct uas_data *uas_data ;250 struct uas_data *uas_data2; 251 251 pj_str_t key; 252 252 … … 270 270 * we receive final response from the UAC INVITE transaction. 271 271 */ 272 uas_data = (struct uas_data*) invite_uas->mod_data[mod_tu.id];273 if (uas_data ->uac_tsx && uas_data->uac_tsx->status_code < 200) {272 uas_data2 = (struct uas_data*) invite_uas->mod_data[mod_tu.id]; 273 if (uas_data2->uac_tsx && uas_data2->uac_tsx->status_code < 200) { 274 274 pjsip_tx_data *cancel; 275 275 276 pj_grp_lock_acquire(uas_data ->uac_tsx->grp_lock);277 278 pjsip_endpt_create_cancel(global.endpt, uas_data ->uac_tsx->last_tx,276 pj_grp_lock_acquire(uas_data2->uac_tsx->grp_lock); 277 278 pjsip_endpt_create_cancel(global.endpt, uas_data2->uac_tsx->last_tx, 279 279 &cancel); 280 280 pjsip_endpt_send_request(global.endpt, cancel, -1, NULL, NULL); 281 281 282 pj_grp_lock_release(uas_data ->uac_tsx->grp_lock);282 pj_grp_lock_release(uas_data2->uac_tsx->grp_lock); 283 283 } 284 284 -
pjproject/trunk/pjsip/src/pjsip-simple/publishc.c
r4530 r5170 435 435 /* Add user headers */ 436 436 if (!pj_list_empty(&pubc->usr_hdr)) { 437 const pjsip_hdr * hdr;438 439 hdr = pubc->usr_hdr.next;440 while ( hdr != &pubc->usr_hdr) {437 const pjsip_hdr *uhdr; 438 439 uhdr = pubc->usr_hdr.next; 440 while (uhdr != &pubc->usr_hdr) { 441 441 pjsip_hdr *new_hdr = (pjsip_hdr*) 442 pjsip_hdr_shallow_clone(tdata->pool, hdr);442 pjsip_hdr_shallow_clone(tdata->pool, uhdr); 443 443 pjsip_msg_add_hdr(tdata->msg, new_hdr); 444 hdr =hdr->next;444 uhdr = uhdr->next; 445 445 } 446 446 } -
pjproject/trunk/pjsip/src/pjsip/sip_dialog.c
r4911 r5170 243 243 pjsip_uri_get_uri(dlg->remote.info->uri); 244 244 if (!pj_list_empty(&sip_uri->header_param)) { 245 pj_str_t tmp ;245 pj_str_t tmp2; 246 246 247 247 /* Remove all header param */ … … 249 249 250 250 /* Print URI */ 251 tmp .ptr = (char*) pj_pool_alloc(dlg->pool,251 tmp2.ptr = (char*) pj_pool_alloc(dlg->pool, 252 252 dlg->remote.info_str.slen); 253 tmp .slen = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR,254 sip_uri, tmp .ptr,253 tmp2.slen = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, 254 sip_uri, tmp2.ptr, 255 255 dlg->remote.info_str.slen); 256 256 257 if (tmp .slen < 1) {257 if (tmp2.slen < 1) { 258 258 status = PJSIP_EURITOOLONG; 259 259 goto on_error; … … 261 261 262 262 /* Assign remote.info_str */ 263 dlg->remote.info_str = tmp ;263 dlg->remote.info_str = tmp2; 264 264 } 265 265 } … … 392 392 */ 393 393 if (contact) { 394 pj_str_t tmp ;395 396 pj_strdup_with_null(dlg->pool, &tmp , contact);394 pj_str_t tmp2; 395 396 pj_strdup_with_null(dlg->pool, &tmp2, contact); 397 397 dlg->local.contact = (pjsip_contact_hdr*) 398 pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp .ptr,399 tmp .slen, NULL);398 pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp2.ptr, 399 tmp2.slen, NULL); 400 400 if (!dlg->local.contact) { 401 401 status = PJSIP_EINVALIDURI; -
pjproject/trunk/pjsip/src/pjsip/sip_multipart.c
r5107 r5170 593 593 endptr = buf + len; 594 594 { 595 pj_str_t body;596 597 body.ptr = buf;body.slen = len;598 curptr = pj_strstr(& body, &delim);595 pj_str_t strbody; 596 597 strbody.ptr = buf; strbody.slen = len; 598 curptr = pj_strstr(&strbody, &delim); 599 599 if (!curptr) 600 600 return NULL; -
pjproject/trunk/pjsip/src/pjsip/sip_parser.c
r4537 r5170 675 675 char hname_copy[PJSIP_MAX_HNAME_LEN]; 676 676 pj_str_t tmp; 677 pjsip_parse_hdr_func * handler;677 pjsip_parse_hdr_func *func; 678 678 679 679 if (hname->slen >= PJSIP_MAX_HNAME_LEN) { … … 684 684 /* First, common case, try to find handler with exact name */ 685 685 hash = pj_hash_calc(0, hname->ptr, (unsigned)hname->slen); 686 handler= find_handler_imp(hash, hname);687 if ( handler)688 return handler;686 func = find_handler_imp(hash, hname); 687 if (func) 688 return func; 689 689 690 690 … … 981 981 /* Parse headers. */ 982 982 do { 983 pjsip_parse_hdr_func * handler;983 pjsip_parse_hdr_func * func; 984 984 pjsip_hdr *hdr = NULL; 985 985 … … 996 996 997 997 /* Find handler. */ 998 handler= find_handler(&hname);998 func = find_handler(&hname); 999 999 1000 1000 /* Call the handler if found. … … 1002 1002 * hname/hvalue pair. 1003 1003 */ 1004 if ( handler) {1005 hdr = (* handler)(ctx);1004 if (func) { 1005 hdr = (*func)(ctx); 1006 1006 1007 1007 /* Note: … … 2263 2263 2264 2264 PJ_TRY { 2265 pjsip_parse_hdr_func * handler= find_handler(hname);2266 if ( handler) {2267 hdr = (* handler)(&context);2265 pjsip_parse_hdr_func *func = find_handler(hname); 2266 if (func) { 2267 hdr = (*func)(&context); 2268 2268 } else { 2269 2269 hdr = parse_hdr_generic_string(&context); … … 2311 2311 /* Parse headers. */ 2312 2312 do { 2313 pjsip_parse_hdr_func * handler;2313 pjsip_parse_hdr_func * func; 2314 2314 pjsip_hdr *hdr = NULL; 2315 2315 … … 2326 2326 2327 2327 /* Find handler. */ 2328 handler= find_handler(&hname);2328 func = find_handler(&hname); 2329 2329 2330 2330 /* Call the handler if found. … … 2332 2332 * hname/hvalue pair. 2333 2333 */ 2334 if ( handler) {2335 hdr = (* handler)(&ctx);2334 if (func) { 2335 hdr = (*func)(&ctx); 2336 2336 } else { 2337 2337 hdr = parse_hdr_generic_string(&ctx); -
pjproject/trunk/pjsip/src/pjsip/sip_tel_uri.c
r4537 r5170 400 400 if (parse_params && *scanner->curptr==';') { 401 401 pj_str_t pname, pvalue; 402 const pjsip_parser_const_t *pc = pjsip_parser_const();403 402 404 403 do { -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
r5152 r5170 1184 1184 /* Start keep-alive timer */ 1185 1185 if (pjsip_cfg()->tcp.keep_alive_interval) { 1186 pj_time_val delay = {pjsip_cfg()->tcp.keep_alive_interval, 0}; 1186 pj_time_val delay = { 0 }; 1187 delay.sec = pjsip_cfg()->tcp.keep_alive_interval; 1187 1188 pjsip_endpt_schedule_timer(listener->endpt, 1188 1189 &tcp->ka_timer, … … 1543 1544 /* Start keep-alive timer */ 1544 1545 if (pjsip_cfg()->tcp.keep_alive_interval) { 1545 pj_time_val delay = { pjsip_cfg()->tcp.keep_alive_interval, 0 }; 1546 pj_time_val delay = { 0 }; 1547 delay.sec = pjsip_cfg()->tcp.keep_alive_interval; 1546 1548 pjsip_endpt_schedule_timer(tcp->base.endpt, &tcp->ka_timer, 1547 1549 &delay); -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r5143 r5170 2537 2537 2538 2538 if (0 && status == PJ_SUCCESS && pjsua_var.acc[acc_id].cred_cnt) { 2539 pjsua_acc *acc = &pjsua_var.acc[acc_id];2540 2539 pjsip_authorization_hdr *h; 2541 2540 char *uri; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r5099 r5170 4511 4511 * Always answer with 2xx. 4512 4512 */ 4513 pjsip_tx_data *tdata ;4513 pjsip_tx_data *tdata2; 4514 4514 const pj_str_t str_false = { "false", 5}; 4515 4515 pjsip_hdr *hdr; 4516 4516 4517 4517 status = pjsip_dlg_create_response(inv->dlg, rdata, code, NULL, 4518 &tdata );4518 &tdata2); 4519 4519 if (status != PJ_SUCCESS) { 4520 4520 pjsua_perror(THIS_FILE, "Unable to create 2xx response to REFER", … … 4525 4525 /* Add Refer-Sub header */ 4526 4526 hdr = (pjsip_hdr*) 4527 pjsip_generic_string_hdr_create(tdata ->pool, &str_refer_sub,4527 pjsip_generic_string_hdr_create(tdata2->pool, &str_refer_sub, 4528 4528 &str_false); 4529 pjsip_msg_add_hdr(tdata ->msg, hdr);4529 pjsip_msg_add_hdr(tdata2->msg, hdr); 4530 4530 4531 4531 4532 4532 /* Send answer */ 4533 4533 status = pjsip_dlg_send_response(inv->dlg, pjsip_rdata_get_tsx(rdata), 4534 tdata );4534 tdata2); 4535 4535 if (status != PJ_SUCCESS) { 4536 4536 pjsua_perror(THIS_FILE, "Unable to create 2xx response to REFER", -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r5133 r5170 907 907 if (ua_cfg->nameserver_count) { 908 908 #if PJSIP_HAS_RESOLVER 909 unsigned i ;909 unsigned ii; 910 910 911 911 /* Create DNS resolver */ … … 934 934 935 935 /* Print nameservers */ 936 for (i =0; i<ua_cfg->nameserver_count; ++i) {936 for (ii=0; ii<ua_cfg->nameserver_count; ++ii) { 937 937 PJ_LOG(4,(THIS_FILE, "Nameserver %.*s added", 938 (int)ua_cfg->nameserver[i ].slen,939 ua_cfg->nameserver[i ].ptr));938 (int)ua_cfg->nameserver[ii].slen, 939 ua_cfg->nameserver[ii].ptr)); 940 940 } 941 941 #else … … 1100 1100 /* Start worker thread if needed. */ 1101 1101 if (pjsua_var.ua_cfg.thread_cnt) { 1102 unsigned i ;1102 unsigned ii; 1103 1103 1104 1104 if (pjsua_var.ua_cfg.thread_cnt > PJ_ARRAY_SIZE(pjsua_var.thread)) 1105 1105 pjsua_var.ua_cfg.thread_cnt = PJ_ARRAY_SIZE(pjsua_var.thread); 1106 1106 1107 for (i =0; i<pjsua_var.ua_cfg.thread_cnt; ++i) {1107 for (ii=0; ii<pjsua_var.ua_cfg.thread_cnt; ++ii) { 1108 1108 status = pj_thread_create(pjsua_var.pool, "pjsua", &worker_thread, 1109 NULL, 0, 0, &pjsua_var.thread[i ]);1109 NULL, 0, 0, &pjsua_var.thread[ii]); 1110 1110 if (status != PJ_SUCCESS) 1111 1111 goto on_error; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_dump.c
r4977 r5170 372 372 /* Get and ICE SRTP status */ 373 373 if (call_med->tp) { 374 pjmedia_transport_info tp_info;375 376 pjmedia_transport_info_init(&tp_info);377 pjmedia_transport_get_info(call_med->tp, &tp_info);378 374 if (tp_info.specific_info_cnt > 0) { 379 375 unsigned j; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r5135 r5170 440 440 } else { 441 441 if (acc->cfg.allow_sdp_nat_rewrite && acc->reg_mapped_addr.slen) { 442 pj_status_t status ;442 pj_status_t status2; 443 443 444 444 /* Take the address from mapped addr as seen by registrar */ 445 status = pj_sockaddr_set_str_addr(af, &bound_addr,446 &acc->reg_mapped_addr);447 if (status != PJ_SUCCESS) {445 status2 = pj_sockaddr_set_str_addr(af, &bound_addr, 446 &acc->reg_mapped_addr); 447 if (status2 != PJ_SUCCESS) { 448 448 /* just leave bound_addr with whatever it was 449 449 pj_bzero(pj_sockaddr_get_addr(&bound_addr), -
pjproject/trunk/pjsip/src/pjsua2/call.cpp
r4996 r5170 153 153 154 154 155 void CallAudioMedia::setPortId(int id)156 { 157 this->id = id;155 void CallAudioMedia::setPortId(int pid) 156 { 157 this->id = pid; 158 158 } 159 159 -
pjproject/trunk/pjsip/src/pjsua2/media.cpp
r5165 r5170 1512 1512 dir = param.dir; 1513 1513 packing = param.packing; 1514 ignoreFmtp = param.ignore_fmtp ;1514 ignoreFmtp = param.ignore_fmtp != PJ_FALSE; 1515 1515 encMtu = param.enc_mtu; 1516 1516 encFmt.fromPj(param.enc_fmt); -
pjproject/trunk/pjsip/src/pjsua2/siptypes.cpp
r4968 r5170 305 305 /////////////////////////////////////////////////////////////////////////////// 306 306 307 void TransportInfo::fromPj(const pjsua_transport_info & info)308 { 309 this->id = info.id;310 this->type = info.type;311 this->typeName = pj2Str( info.type_name);312 this->info = pj2Str( info.info);313 this->flags = info.flag;307 void TransportInfo::fromPj(const pjsua_transport_info &tinfo) 308 { 309 this->id = tinfo.id; 310 this->type = tinfo.type; 311 this->typeName = pj2Str(tinfo.type_name); 312 this->info = pj2Str(tinfo.info); 313 this->flags = tinfo.flag; 314 314 315 315 char straddr[PJ_INET6_ADDRSTRLEN+10]; 316 pj_sockaddr_print(& info.local_addr, straddr, sizeof(straddr), 3);316 pj_sockaddr_print(&tinfo.local_addr, straddr, sizeof(straddr), 3); 317 317 this->localAddress = straddr; 318 318 319 319 pj_ansi_snprintf(straddr, sizeof(straddr), "%.*s:%d", 320 (int) info.local_name.host.slen,321 info.local_name.host.ptr,322 info.local_name.port);320 (int)tinfo.local_name.host.slen, 321 tinfo.local_name.host.ptr, 322 tinfo.local_name.port); 323 323 this->localName = straddr; 324 this->usageCount = info.usage_count;324 this->usageCount = tinfo.usage_count; 325 325 } 326 326 -
pjproject/trunk/pjsip/src/test/dns_test.c
r3553 r5170 174 174 */ 175 175 for (i=0; i<PJ_ARRAY_SIZE(ans); ++i) { 176 pj_dns_parsed_query q ;176 pj_dns_parsed_query q2; 177 177 char buf[128]; 178 178 char *services[] = { "_sip._udp.", "_sip._tcp.", "_sips._tcp."}; … … 180 180 181 181 for (j=0; j<PJ_ARRAY_SIZE(services); ++j) { 182 q .dnsclass = PJ_DNS_CLASS_IN;183 q .type = PJ_DNS_TYPE_SRV;184 185 q .name.ptr = buf;182 q2.dnsclass = PJ_DNS_CLASS_IN; 183 q2.type = PJ_DNS_TYPE_SRV; 184 185 q2.name.ptr = buf; 186 186 pj_bzero(buf, sizeof(buf)); 187 pj_strcpy2(&q .name, services[j]);188 pj_strcat(&q .name, &ans[i].rdata.srv.target);187 pj_strcpy2(&q2.name, services[j]); 188 pj_strcat(&q2.name, &ans[i].rdata.srv.target); 189 189 190 190 pj_bzero(&pkt, sizeof(pkt)); … … 192 192 pkt.hdr.flags = PJ_DNS_SET_QR(1) | 193 193 PJ_DNS_SET_RCODE(PJ_DNS_RCODE_NXDOMAIN); 194 pkt.q = &q ;194 pkt.q = &q2; 195 195 196 196 pj_dns_resolver_add_entry( resv, &pkt, PJ_FALSE); … … 407 407 408 408 while (result.status == 0x12345678) { 409 int i = 0;409 int ii = 0; 410 410 pj_time_val timeout = { 1, 0 }; 411 411 pjsip_endpt_handle_events(endpt, &timeout); 412 if (i == 1)412 if (ii == 1) 413 413 pj_dns_resolver_dump(pjsip_endpt_get_resolver(endpt), PJ_TRUE); 414 414 } -
pjproject/trunk/pjsip/src/test/tsx_uas_test.c
r4893 r5170 262 262 /* Schedule timer to send response for the specified UAS transaction */ 263 263 static void schedule_send_response( pjsip_rx_data *rdata, 264 const pj_str_t *tsx_key ,264 const pj_str_t *tsx_key_, 265 265 int status_code, 266 266 int msec_delay ) … … 281 281 282 282 r = PJ_POOL_ALLOC_T(tdata->pool, struct response); 283 pj_strdup(tdata->pool, &r->tsx_key, tsx_key );283 pj_strdup(tdata->pool, &r->tsx_key, tsx_key_); 284 284 r->tdata = tdata; 285 285 -
pjproject/trunk/third_party/build/speex/config.h
r5159 r5170 27 27 # pragma warning(disable: 4305) // truncation from 'const double ' to 'float ' 28 28 # pragma warning(disable: 4018) // signed/unsigned mismatch 29 # pragma warning(disable: 4456) // declaration of '[var]' hides previous local declaration 29 30 //# pragma warning(disable: 4701) // local variable used without initialized 30 31 #endif
Note: See TracChangeset
for help on using the changeset viewer.