From e4bd5d90469c5505a127f805810beb0e89b115e8 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Fri, 3 Dec 2021 17:44:53 +0100 Subject: [PATCH] Handle an `EPIPE` error from the socket Issue reported in https://github.com/wolfSSL/wolfssl/issues/4623 --- src/wolfio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wolfio.c b/src/wolfio.c index 28da546a1..16ee7e892 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -129,6 +129,10 @@ static int TranslateIoError(int err) WOLFSSL_MSG("\tSocket interrupted"); return WOLFSSL_CBIO_ERR_ISR; } + else if (err == SOCKET_EPIPE) { + WOLFSSL_MSG("\tBroken pipe"); + return WOLFSSL_CBIO_ERR_CONN_CLOSE; + } else if (err == SOCKET_ECONNABORTED) { WOLFSSL_MSG("\tConnection aborted"); return WOLFSSL_CBIO_ERR_CONN_CLOSE;