From adee6a86d155a70ff966459c75da1dbe230574d3 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Thu, 28 Oct 2021 20:53:58 +0200 Subject: [PATCH] Return the close notify error when expecting an error. --- examples/server/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/server/server.c b/examples/server/server.c index 048bf9e70..cd1a79132 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -3180,7 +3180,7 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args) } else if (err == 0 || err == WOLFSSL_ERROR_ZERO_RETURN) { err = ServerEchoData(ssl, clientfd, echoData, block, throughput); - if (err == WOLFSSL_ERROR_ZERO_RETURN) /* Got close notify */ + if (err == WOLFSSL_ERROR_ZERO_RETURN && runWithErrors == 1) /* Got close notify */ err = 0; if (err != 0) { SSL_free(ssl); ssl = NULL;