]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
wolfssl: when SSL_read() returns zero, check the error
authorDaniel Stenberg <daniel@haxx.se>
Thu, 10 Feb 2022 22:50:35 +0000 (23:50 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 11 Feb 2022 09:48:52 +0000 (10:48 +0100)
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

index 314279dd13ab9c3ce97bdf6cc5015bcb26affb44..d44a406b53cf3f7861371eed8447873bd2e064e0 100644 (file)
@@ -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) {