]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Set errno properly on GnuTLS sessions that die during the SSL handshake
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 6 May 2009 22:26:11 +0000 (22:26 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 6 May 2009 22:26:11 +0000 (22:26 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11363 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/extra/m_ssl_gnutls.cpp

index 2939f475798ca425ceb517f171d320aca10cba88..36ee530a25ee0950a7b85185178cbf436788aca9 100644 (file)
@@ -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;
                }