- Timestamp:
- Aug 25, 2015 8:45:46 AM (9 years ago)
- File:
-
- 1 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",
Note: See TracChangeset
for help on using the changeset viewer.