[asterisk-scf-commits] asterisk-scf/release/pjproject.git branch "veesix" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Tue Nov 23 17:30:36 CST 2010
branch "veesix" has been updated
via 48aabcc9c79d5c33ae31c3fdc5880a85e5568e18 (commit)
from 9a70990f8e88e8f5b2b350b085760420801d944b (commit)
Summary of changes:
pjsip/src/test/transport_tcp_test.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit 48aabcc9c79d5c33ae31c3fdc5880a85e5568e18
Author: Mark Michelson <mmichelson at digium.com>
Date: Tue Nov 23 17:35:38 2010 -0600
Somehow forgot to add the actual test to my last commit.
diff --git a/pjsip/src/test/transport_tcp_test.c b/pjsip/src/test/transport_tcp_test.c
index 52595c6..16844a8 100644
--- a/pjsip/src/test/transport_tcp_test.c
+++ b/pjsip/src/test/transport_tcp_test.c
@@ -34,11 +34,12 @@ int transport_tcp_test(void)
enum { SEND_RECV_LOOP = 8 };
pjsip_tpfactory *tpfactory;
pjsip_transport *tcp;
- pj_sockaddr_in rem_addr;
+ pj_sockaddr rem_addr;
pj_status_t status;
char url[PJSIP_MAX_URL_SIZE];
int rtt[SEND_RECV_LOOP], min_rtt;
int i, pkt_lost;
+ char rem_addr_str[PJ_INET6_ADDRSTRLEN];
/* Start TCP listener on arbitrary port. */
status = pjsip_tcp_transport_start(endpt, NULL, 1, &tpfactory);
@@ -47,9 +48,8 @@ int transport_tcp_test(void)
return -10;
}
-
/* Get the listener address */
- status = pj_sockaddr_in_init(&rem_addr, &tpfactory->addr_name.host,
+ status = pj_sockaddr_init(pj_AF_INET6(), &rem_addr, &tpfactory->addr_name.host,
(pj_uint16_t)tpfactory->addr_name.port);
if (status != PJ_SUCCESS) {
app_perror(" Error: possibly invalid TCP address name", status);
@@ -57,13 +57,13 @@ int transport_tcp_test(void)
}
pj_ansi_sprintf(url, "sip:alice@%s:%d;transport=tcp",
- pj_inet_ntoa(rem_addr.sin_addr),
- pj_ntohs(rem_addr.sin_port));
+ pj_inet_ntop2(rem_addr.addr.sa_family, &rem_addr, rem_addr_str, sizeof(rem_addr_str)),
+ pj_sockaddr_get_port(&rem_addr));
/* Acquire one TCP transport. */
status = pjsip_endpt_acquire_transport(endpt, PJSIP_TRANSPORT_TCP,
- &rem_addr, sizeof(rem_addr),
+ &rem_addr, pj_sockaddr_get_len(&rem_addr),
NULL, &tcp);
if (status != PJ_SUCCESS || tcp == NULL) {
app_perror(" Error: unable to acquire TCP transport", status);
-----------------------------------------------------------------------
--
asterisk-scf/release/pjproject.git
More information about the asterisk-scf-commits
mailing list