commit 5c51824265c97a596aa840025106b061766a2b62 parent 19d66bd8c130b453ceaffed91a266c8793a7a2fb Author: Christian Grothoff <christian@grothoff.org> Date: Wed, 29 Oct 2014 15:46:17 +0000 make sure we always set non-zero errno in send_tls_adapter Diffstat:
| M | src/microhttpd/daemon.c | | | 9 | +++++++++ |
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -482,6 +482,15 @@ send_tls_adapter (struct MHD_Connection *connection, #endif return -1; } + if (res < 0) + { + /* some other GNUTLS error, should set 'errno'; as we do not + really understand the error (not listed in GnuTLS + documentation explicitly), we set 'errno' to something that + will cause the connection to fail. */ + MHD_set_socket_errno_ (ECONNRESET); + return -1; + } return res; }