Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/iperf_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1810,8 +1810,12 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)

#endif //HAVE_SSL

// File cannot be transferred using UDP because of the UDP packets header (packet number, etc.)
if(test->role == 'c' && test->diskfile_name != (char*) 0 && test->protocol->id == Pudp) {
/*
* File cannot be transferred using UDP because of the UDP packets
* header (packet number, etc.). Specifying Pudp here implies this is
* on the client side.
*/
if (test->diskfile_name != (char*) 0 && test->protocol->id == Pudp) {
i_errno = IEUDPFILETRANSFER;
return -1;
}
Expand Down Expand Up @@ -2445,8 +2449,17 @@ get_parameters(struct iperf_test *test)

if ((j_p = iperf_cJSON_GetObjectItemType(j, "tcp", cJSON_True)) != NULL)
set_protocol(test, Ptcp);
if ((j_p = iperf_cJSON_GetObjectItemType(j, "udp", cJSON_True)) != NULL)
set_protocol(test, Pudp);
if ((j_p = iperf_cJSON_GetObjectItemType(j, "udp", cJSON_True)) != NULL) {
/* Disallow UDP transfers if we already are to/from a file */
if (test->diskfile_name != NULL) {
i_errno = IEUDPFILETRANSFER;
r = -1;
}
else {
/* Not to/from a file, set UDP protocol as intended*/
set_protocol(test, Pudp);
}
}
if ((j_p = iperf_cJSON_GetObjectItemType(j, "sctp", cJSON_True)) != NULL)
set_protocol(test, Psctp);
if ((j_p = iperf_cJSON_GetObjectItemType(j, "omit", cJSON_Number)) != NULL)
Expand Down
3 changes: 3 additions & 0 deletions src/iperf_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ iperf_strerror(int int_errno)
case IETOTALRATE:
snprintf(errstr, len, "total required bandwidth is larger than server limit");
break;
case IETOTALINTERVAL:
snprintf(errstr, len, "invalid time interval for calculating average data rate");
break;
Comment thread
bmah888 marked this conversation as resolved.
case IESKEWTHRESHOLD:
snprintf(errstr, len, "skew threshold must be a positive number");
break;
Expand Down
2 changes: 1 addition & 1 deletion src/iperf_locale.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ const char test_start_bytes[] =
"Starting Test: protocol: %s, %d streams, %d byte blocks, omitting %d seconds, %"PRIuFAST64" bytes to send, tos %d\n";

const char test_start_blocks[] =
"Starting Test: protocol: %s, %d streams, %d byte blocks, omitting %d seconds, %"PRIuFAST64" bytes to send, tos %d\n";
"Starting Test: protocol: %s, %d streams, %d byte blocks, omitting %d seconds, %"PRIuFAST64" blocks to send, tos %d\n";
Comment thread
bmah888 marked this conversation as resolved.


/* -------------------------------------------------------------------
Expand Down