From acb2fd6756834a81679a9906eedb2b043ee087ed Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 20 Aug 2018 23:57:12 +0200 Subject: [PATCH] mbedtls: treat zero return from mbedtls_ssl_read() as non-error Patch-by: jshanab on github Fixes #2899 --- lib/vtls/mbedtls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index d7759dc849..209ec74f7e 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -795,7 +795,8 @@ static ssize_t mbed_recv(struct connectdata *conn, int num, if(ret <= 0) { if(ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) return 0; - + else if(!ret) + return 0; *curlcode = (ret == MBEDTLS_ERR_SSL_WANT_READ) ? CURLE_AGAIN : CURLE_RECV_ERROR; return -1; -- GitLab