aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoi-Ho Chan <hoiho.chan@gmail.com>2011-02-17 21:46:59 -0800
committerDaniel Stenberg <daniel@haxx.se>2011-02-18 09:17:32 +0100
commit05895927f59eef2d746a1b70f40f1abd0907a474 (patch)
tree009d028e080a2fb46b392e8e260c992888648c2c
parentd9805c5b2bf5e7cc9980306c5720f2d7f0402225 (diff)
PolarSSL: Return 0 on receiving TLS CLOSE_NOTIFY alert
Signed-off-by: Hoi-Ho Chan <hoiho.chan@gmail.com>
-rw-r--r--lib/polarssl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/polarssl.c b/lib/polarssl.c
index 272e1183e..51e35db87 100644
--- a/lib/polarssl.c
+++ b/lib/polarssl.c
@@ -352,6 +352,9 @@ static ssize_t polarssl_recv(struct connectdata *conn,
ret = ssl_read(&conn->ssl[num].ssl, (unsigned char *)buf, buffersize);
if(ret <= 0) {
+ if(ret == POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY)
+ return 0;
+
*curlcode = (ret == POLARSSL_ERR_NET_TRY_AGAIN) ?
CURLE_AGAIN : CURLE_RECV_ERROR;
return -1;