Merge pull request #3760 from backhub/bug/openssl_read Fix return value of openssl_read (infinite loop)
diff --git a/src/openssl_stream.c b/src/openssl_stream.c
index edea8fe..b8ab21f 100644
--- a/src/openssl_stream.c
+++ b/src/openssl_stream.c
@@ -523,7 +523,7 @@ ssize_t openssl_read(git_stream *stream, void *data, size_t len)
int ret;
if ((ret = SSL_read(st->ssl, data, len)) <= 0)
- ssl_set_error(st->ssl, ret);
+ return ssl_set_error(st->ssl, ret);
return ret;
}