summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-04-16 03:34:58 -0500
committerAdam <Adam@anope.org>2013-04-16 18:19:42 -0500
commit47332d6e9b990498dd35457090dd8983d8aae8d3 (patch)
tree5f298a5093f16ab7b349dd817d26ec9b98f67dac /src/modules/extra
parent1dfead3b2cc9e8c603f6ad6f7216576a2ce361fb (diff)
Fix m_ssl_gnutls and perhaps some other things on Windows by recognizing WSAEWOULDBLOCK
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 38b3700b5..e329186a5 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -86,6 +86,12 @@ static ssize_t gnutls_pull_wrapper(gnutls_transport_ptr_t user_wrap, void* buffe
return -1;
}
int rv = ServerInstance->SE->Recv(user, reinterpret_cast<char *>(buffer), size, 0);
+ if (rv < 0)
+ {
+ /* On Windows we need to set errno for gnutls */
+ if (SocketEngine::IgnoreError())
+ errno = EAGAIN;
+ }
if (rv < (int)size)
ServerInstance->SE->ChangeEventMask(user, FD_READ_WILL_BLOCK);
return rv;
@@ -100,6 +106,12 @@ static ssize_t gnutls_push_wrapper(gnutls_transport_ptr_t user_wrap, const void*
return -1;
}
int rv = ServerInstance->SE->Send(user, reinterpret_cast<const char *>(buffer), size, 0);
+ if (rv < 0)
+ {
+ /* On Windows we need to set errno for gnutls */
+ if (SocketEngine::IgnoreError())
+ errno = EAGAIN;
+ }
if (rv < (int)size)
ServerInstance->SE->ChangeEventMask(user, FD_WRITE_WILL_BLOCK);
return rv;