diff --git a/src/iperf_api.c b/src/iperf_api.c
index dd0abe8..ab6491d 100644
--- a/src/iperf_api.c
+++ b/src/iperf_api.c
@@ -2168,16 +2168,20 @@ iperf_exchange_results(struct iperf_test *test)
{
if (test->role == 'c') {
/* Send results to server. */
+ printf("Send results to server\n");
if (send_results(test) < 0)
return -1;
/* Get server results. */
+ printf("Get server results\n");
if (get_results(test) < 0)
return -1;
} else {
/* Get client results. */
+ printf("Get client results\n");
if (get_results(test) < 0)
return -1;
/* Send results to client. */
+ printf("Send results to client\n");
if (send_results(test) < 0)
return -1;
}
@@ -2525,6 +2529,7 @@ get_results(struct iperf_test *test)
int retransmits;
struct iperf_stream *sp;
+ printf("%s: ctrl_sck\n", __func__);
j = JSON_read(test->ctrl_sck);
if (j == NULL) {
i_errno = IERECVRESULTS;
@@ -2702,11 +2707,14 @@ JSON_write(int fd, cJSON *json)
if (Nwrite(fd, (char*) &nsize, sizeof(nsize), Ptcp) < 0)
r = -1;
else {
+ printf("%s: fd: %d r: %d, hsize: %d, nsize: %d\n", __func__, fd, r, hsize, nsize);
if (Nwrite(fd, str, hsize, Ptcp) < 0)
r = -1;
+ printf("%s: r: %d, hsize: %d, str: %s\n", __func__, r, hsize, str);
}
cJSON_free(str);
}
+ printf("%s: r: %d\n", __func__, r);
return r;
}
@@ -2728,12 +2736,14 @@ JSON_read(int fd)
*/
if (Nread(fd, (char*) &nsize, sizeof(nsize), Ptcp) >= 0) {
hsize = ntohl(nsize);
+ printf("%s: fd: %d, port: %d, hsize: %d\n", __func__, fd, Ptcp, hsize);
/* Allocate a buffer to hold the JSON */
strsize = hsize + 1; /* +1 for trailing NULL */
if (strsize) {
str = (char *) calloc(sizeof(char), strsize);
if (str != NULL) {
rc = Nread(fd, str, hsize, Ptcp);
+ printf("%s: rc: %d fd: %d, port: %d, str: %s\n", __func__, rc, fd, Ptcp, str);
if (rc >= 0) {
/*
* We should be reading in the number of bytes corresponding to the
diff --git a/src/iperf_client_api.c b/src/iperf_client_api.c
index 7ad4c93..7a8af94 100644
--- a/src/iperf_client_api.c
+++ b/src/iperf_client_api.c
@@ -299,6 +299,7 @@ iperf_handle_message_client(struct iperf_test *test)
}
}
+ printf("%s: state: %d\n", __func__, test->state);
switch (test->state) {
case PARAM_EXCHANGE:
if (iperf_exchange_parameters(test) < 0)
@@ -397,9 +398,11 @@ iperf_connect(struct iperf_test *test)
make_cookie(test->cookie);
/* Create and connect the control channel */
- if (test->ctrl_sck < 0)
+ if (test->ctrl_sck < 0) {
// Create the control channel using an ephemeral port
test->ctrl_sck = netdial(test->settings->domain, Ptcp, test->bind_address, test->bind_dev, 0, test->server_hostname, test->server_port, test->settings->connect_timeout);
+ printf("%s: netdial test->ctrl_sc
iperf3测试IPsec offload
最新推荐文章于 2025-07-25 15:53:40 发布