diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-05-06 22:26:11 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-05-06 22:26:11 +0000 |
commit | 5a3d1bd4608b46fae23414822ad7512410dd773b (patch) | |
tree | 769ebbe2bf5a2bcb1c6b3243b58015fec357c47f /src/modules/extra | |
parent | afdc66c2ce4a5102a6f244c561e800cfd265069f (diff) |
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
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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; } |