From 327ef305304df23d10851ea1906e996a4f1bce56 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 10 Feb 2022 23:50:35 +0100 Subject: [PATCH] wolfssl: when SSL_read() returns zero, check the error Returning zero indicates end of connection, so if there's no data read but the connection is alive, it needs to return -1 with CURLE_AGAIN. Closes #8431 --- lib/vtls/wolfssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 314279dd13..d44a406b53 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -917,7 +917,7 @@ static ssize_t wolfssl_recv(struct Curl_easy *data, nread = SSL_read(backend->handle, buf, buffsize); - if(nread < 0) { + if(nread <= 0) { int err = SSL_get_error(backend->handle, nread); switch(err) {