summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mrcsys2006-02-09 13:47:21 +0000
committerGravatar mrcsys2006-02-09 13:47:21 +0000
commit29b034ec9c827c7311e69fcb5765ef4e43478c29 (patch)
tree16b4b3a459d112e425a8c37dbbf1806a7af3fccb
parent3d113d2c9c356aed327d6fb1a2114ffda0360492 (diff)
downloadcsoap-29b034ec9c827c7311e69fcb5765ef4e43478c29.tar.gz
csoap-29b034ec9c827c7311e69fcb5765ef4e43478c29.tar.bz2
A few more error conditions need to be checked for in a socket read under SSL
-rw-r--r--nanohttp/nanohttp-socket.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/nanohttp/nanohttp-socket.c b/nanohttp/nanohttp-socket.c
index f880b74..e2c9312 100644
--- a/nanohttp/nanohttp-socket.c
+++ b/nanohttp/nanohttp-socket.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: nanohttp-socket.c,v 1.47 2006/02/08 11:13:14 snowdrop Exp $
+* $Id: nanohttp-socket.c,v 1.48 2006/02/09 13:47:21 mrcsys Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -551,7 +551,11 @@ hsocket_read(hsocket_t sock, byte_t * buffer, int total, int force,
log_verbose2("DEBUG A %d",i); */
status = SSL_read(sock.ssl, &buffer[totalRead], total - totalRead);
log_verbose2("DEBUG SSL_read %d",status);
- if (SSL_get_error(sock.ssl, status) == SSL_ERROR_ZERO_RETURN)
+ if (SSL_get_error(sock.ssl, status) == SSL_ERROR_ZERO_RETURN ||
+ SSL_get_error(sock.ssl, status) == SSL_ERROR_SSL ||
+ SSL_get_error(sock.ssl, status) == SSL_ERROR_SYSCALL ||
+ SSL_get_error(sock.ssl, status) == SSL_ERROR_SSL ||
+ SSL_get_shutdown(sock.ssl) == SSL_RECEIVED_SHUTDOWN )
{
log_verbose1("SSL Error");
return herror_new("hsocket_read", HSOCKET_ERROR_SSLCLOSE, "SSL Error");