From: Daniel Stenberg Date: Thu, 10 Feb 2022 22:50:35 +0000 (+0100) Subject: wolfssl: when SSL_read() returns zero, check the error X-Git-Tag: curl-7_82_0~92 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=327ef305304df23d10851ea1906e996a4f1bce56;p=thirdparty%2Fcurl.git 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 --- 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) {