summaryrefslogtreecommitdiff
path: root/lib/sslgen.c
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2010-03-19 15:43:11 +0000
committerKamil Dudka <kdudka@redhat.com>2010-03-19 15:43:11 +0000
commit19ca0c0fbe3066be78219ac894f0cb0ef7efebb4 (patch)
tree8a7d017c134448f9951f7133d673fa95c672d561 /lib/sslgen.c
parent6728334edbf7bc858af55c577345a99652fd29de (diff)
downloadcurl-19ca0c0fbe3066be78219ac894f0cb0ef7efebb4.tar.gz
- Improved Curl_read() to not ignore the error returned from Curl_ssl_recv().
Diffstat (limited to 'lib/sslgen.c')
-rw-r--r--lib/sslgen.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sslgen.c b/lib/sslgen.c
index 2271eb589..6707e0af6 100644
--- a/lib/sslgen.c
+++ b/lib/sslgen.c
@@ -399,7 +399,7 @@ struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data)
return curlssl_engines_list(data);
}
-/* return number of sent (non-SSL) bytes */
+/* return number of sent (non-SSL) bytes; -1 on error */
ssize_t Curl_ssl_send(struct connectdata *conn,
int sockindex,
const void *mem,
@@ -411,8 +411,8 @@ ssize_t Curl_ssl_send(struct connectdata *conn,
/* return number of received (decrypted) bytes */
/*
- * If the read would block (EWOULDBLOCK) we return -1. Otherwise we return
- * a regular CURLcode value.
+ * If the read would block (EWOULDBLOCK) we return -1. If an error occurs during
+ * the read, we return -2. Otherwise we return the count of bytes transfered.
*/
ssize_t Curl_ssl_recv(struct connectdata *conn, /* connection data */
int sockindex, /* socketindex */
@@ -425,9 +425,9 @@ ssize_t Curl_ssl_recv(struct connectdata *conn, /* connection data */
nread = curlssl_recv(conn, sockindex, mem, len, &block);
if(nread == -1) {
if(!block)
- return 0; /* this is a true error, not EWOULDBLOCK */
+ return -2; /* this is a true error, not EWOULDBLOCK */
else
- return -1;
+ return -1; /* EWOULDBLOCK */
}
return nread;