libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit ae668d2eca7af0c3d31e8898e807a4398760525a
parent 6abbeb5f407232f9742970232ca2ab9e37f62e1f
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 13 Feb 2011 09:53:44 +0000

fix gnutls error handling

Diffstat:
MChangeLog | 4++++
Msrc/daemon/daemon.c | 8++++++++
2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,7 @@ +Sun Feb 13 10:52:29 CET 2011 + Handle gnutls receive error(s) for interrupted SSL + connections better. -MS + Fri Feb 11 10:15:38 CET 2011 Fixing parameter ordering in documentation (#1659). -wellska diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c @@ -399,6 +399,14 @@ recv_tls_adapter (struct MHD_Connection *connection, void *other, size_t i) errno = EINTR; return -1; } + if (res < 0) + { + /* Likely 'GNUTLS_E_INVALID_SESSION' (client communication + disrupted); set errno to something caller will interpret + correctly as a hard error*/ + errno = EPIPE; + return res; + } return res; }