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
This commit is contained in:
Daniel Stenberg 2022-02-10 23:50:35 +01:00
parent 96f85a0fef
commit 327ef30530
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View 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) {