summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp5
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp8
2 files changed, 12 insertions, 1 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 4f22a5e70..0006c9de9 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -445,7 +445,10 @@ class ModuleSSLGnuTLS : public Module
}
virtual int OnRawSocketWrite(int fd, const char* buffer, int count)
- {
+ {
+ if (!count)
+ return 0;
+
issl_session* session = &sessions[fd];
const char* sendbuffer = buffer;
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index 0da67d677..06708ff54 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -296,16 +296,19 @@ class ModuleSSLOpenSSL : public Module
virtual char* OnRequest(Request* request)
{
ISHRequest* ISR = (ISHRequest*)request;
+ ServerInstance->Log(DEBUG, "hook OnRequest");
if (strcmp("IS_NAME", request->GetId()) == 0)
{
return "openssl";
}
else if (strcmp("IS_HOOK", request->GetId()) == 0)
{
+ ServerInstance->Log(DEBUG, "Hooking socket %08x", ISR->Sock);
return ServerInstance->Config->AddIOHook((Module*)this, (InspSocket*)ISR->Sock) ? (char*)"OK" : NULL;
}
else if (strcmp("IS_UNHOOK", request->GetId()) == 0)
{
+ ServerInstance->Log(DEBUG, "Unhooking socket %08x", ISR->Sock);
return ServerInstance->Config->DelIOHook((InspSocket*)ISR->Sock) ? (char*)"OK" : NULL;
}
return NULL;
@@ -314,6 +317,7 @@ class ModuleSSLOpenSSL : public Module
virtual void OnRawSocketAccept(int fd, const std::string &ip, int localport)
{
+ ServerInstance->Log(DEBUG, "Hook accept %d", fd);
issl_session* session = &sessions[fd];
session->fd = fd;
@@ -515,6 +519,10 @@ class ModuleSSLOpenSSL : public Module
int DoWrite(issl_session* session)
{
+ if (!session->outbuf.size())
+ return -1;
+
+ ServerInstance->Log(DEBUG, "m_ssl_openssl.so: To write: %d", session->outbuf.size());
int ret = SSL_write(session->sess, session->outbuf.data(), session->outbuf.size());
if (ret == 0)