Skip to content

Commit

Permalink
Add debug messges whe State changes
Browse files Browse the repository at this point in the history
  • Loading branch information
davidBar-On committed Jul 16, 2024
1 parent ed66f42 commit 41dba5f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1861,6 +1861,10 @@ void iperf_close_logfile(struct iperf_test *test)
int
iperf_set_send_state(struct iperf_test *test, signed char state)
{
if (test->debug_level >= DEBUG_LEVEL_INFO) {
iperf_printf(test, "State change: sending and setting State to %d (control socket is %d)\n", state, test->ctrl_sck);
}

if (test->ctrl_sck >= 0) {
test->state = state;
if (Nwrite(test->ctrl_sck, (char*) &state, sizeof(state), Ptcp) < 0) {
Expand Down
4 changes: 4 additions & 0 deletions src/iperf_client_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ iperf_handle_message_client(struct iperf_test *test)
}
}

if (test->debug_level >= DEBUG_LEVEL_INFO) {
iperf_printf(test, "State change: client received State %d\n", test->state);
}

switch (test->state) {
case PARAM_EXCHANGE:
if (iperf_exchange_parameters(test) < 0)
Expand Down
4 changes: 4 additions & 0 deletions src/iperf_server_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ iperf_handle_message_server(struct iperf_test *test)
}
}

if (test->debug_level >= DEBUG_LEVEL_INFO) {
iperf_printf(test, "State change: server received State %d\n", test->state);
}

switch(test->state) {
case TEST_START:
break;
Expand Down

0 comments on commit 41dba5f

Please sign in to comment.