From: danieldg Date: Wed, 6 May 2009 22:26:11 +0000 (+0000) Subject: Set errno properly on GnuTLS sessions that die during the SSL handshake X-Git-Tag: v2.0.23~1865 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=5a3d1bd4608b46fae23414822ad7512410dd773b;p=user%2Fhenk%2Fcode%2Finspircd.git Set errno properly on GnuTLS sessions that die during the SSL handshake git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11363 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 2939f4757..36ee530a2 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -490,6 +490,7 @@ class ModuleSSLGnuTLS : public Module if(!Handshake(session, fd)) { + errno = session->status == ISSL_CLOSING ? EIO : EAGAIN; // Couldn't resume handshake. return -1; } @@ -561,7 +562,7 @@ class ModuleSSLGnuTLS : public Module { // The handshake isn't finished, try to finish it. Handshake(session, fd); - errno = EAGAIN; + errno = session->status == ISSL_CLOSING ? EIO : EAGAIN; return -1; }