mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Merge pull request #7357 from kareem-wolfssl/gh7349
Fix potential division by zero in example server.
This commit is contained in:
@ -513,14 +513,19 @@ int ServerEchoData(SSL* ssl, int clientfd, int echoData, int block,
|
|||||||
#define SIZE_FMT "%zu"
|
#define SIZE_FMT "%zu"
|
||||||
#define SIZE_TYPE size_t
|
#define SIZE_TYPE size_t
|
||||||
#endif
|
#endif
|
||||||
printf(
|
if (rx_time > 0.0 && tx_time > 0.0) {
|
||||||
"wolfSSL Server Benchmark " SIZE_FMT " bytes\n"
|
printf(
|
||||||
"\tRX %8.3f ms (%8.3f MBps)\n"
|
"wolfSSL Server Benchmark " SIZE_FMT " bytes\n"
|
||||||
"\tTX %8.3f ms (%8.3f MBps)\n",
|
"\tRX %8.3f ms (%8.3f MBps)\n"
|
||||||
(SIZE_TYPE)throughput,
|
"\tTX %8.3f ms (%8.3f MBps)\n",
|
||||||
rx_time * 1000, throughput / rx_time / 1024 / 1024,
|
(SIZE_TYPE)throughput,
|
||||||
tx_time * 1000, throughput / tx_time / 1024 / 1024
|
rx_time * 1000, throughput / rx_time / 1024 / 1024,
|
||||||
);
|
tx_time * 1000, throughput / tx_time / 1024 / 1024
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("Invalid rx_time: %f or tx_time: %f\n", rx_time, tx_time);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user