client/server: tolerate WANT_WRITE errors

This commit is contained in:
Marco Oliverio
2022-05-20 10:00:37 +02:00
committed by David Garske
parent 4e112419f5
commit 12a3efeca8
2 changed files with 9 additions and 3 deletions
+5 -2
View File
@@ -807,7 +807,8 @@ static int ClientBenchmarkThroughput(WOLFSSL_CTX* ctx, char* host, word16 port,
}
else
#endif
if (err != WOLFSSL_ERROR_WANT_READ) {
if (err != WOLFSSL_ERROR_WANT_READ &&
err != WOLFSSL_ERROR_WANT_WRITE) {
fprintf(stderr, "SSL_read bench error %d\n", err);
err_sys("SSL_read failed");
}
@@ -1072,7 +1073,9 @@ static int ClientRead(WOLFSSL* ssl, char* reply, int replyLen, int mustRead,
}
}
if (mustRead && err == WOLFSSL_ERROR_WANT_READ) {
if (mustRead &&
(err == WOLFSSL_ERROR_WANT_READ
|| err == WOLFSSL_ERROR_WANT_WRITE)) {
elapsed = current_time(0) - start;
if (elapsed > MAX_NON_BLOCK_SEC) {
fprintf(stderr, "Nonblocking read timeout\n");