forked from wolfSSL/wolfssl
Fix potential division by zero in example server.
This commit is contained in:
@ -513,6 +513,7 @@ int ServerEchoData(SSL* ssl, int clientfd, int echoData, int block,
|
||||
#define SIZE_FMT "%zu"
|
||||
#define SIZE_TYPE size_t
|
||||
#endif
|
||||
if (rx_time && tx_time) {
|
||||
printf(
|
||||
"wolfSSL Server Benchmark " SIZE_FMT " bytes\n"
|
||||
"\tRX %8.3f ms (%8.3f MBps)\n"
|
||||
@ -522,6 +523,10 @@ int ServerEchoData(SSL* ssl, int clientfd, int echoData, int block,
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user