aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Giancola <mikegiancola@gmail.com>2013-05-22 23:42:33 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-05-22 23:42:33 +0200
commit520833cbe1601feed1c6473bd28c4c894e7ee63e (patch)
tree987b575ef1e96a1eccc6ed94e2be2ad7c28ed1af /lib
parente58d9c87f783334b01310260e0cf5220c338c58c (diff)
ossl_recv: SSL_read() returning 0 is an error too
SSL_read can return 0 for "not successful", according to the open SSL documentation: http://www.openssl.org/docs/ssl/SSL_read.html
Diffstat (limited to 'lib')
-rw-r--r--lib/ssluse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ssluse.c b/lib/ssluse.c
index 80fa11957..36c38042a 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -2595,7 +2595,7 @@ static ssize_t ossl_recv(struct connectdata *conn, /* connection data */
buffsize = (buffersize > (size_t)INT_MAX) ? INT_MAX : (int)buffersize;
nread = (ssize_t)SSL_read(conn->ssl[num].handle, buf, buffsize);
- if(nread < 0) {
+ if(nread <= 0) {
/* failed SSL_read */
int err = SSL_get_error(conn->ssl[num].handle, (int)nread);