summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-09 21:15:56 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-09 21:15:56 +0000
commit6d2bf07374515c88734a19ffaac179b7357059ea (patch)
treeb82977fceb97d5ff929c68375a7d4fcd3076fb12 /src/modules/extra
parent42747aef3eacfeb418cd1ac1d7854e3cc4e66469 (diff)
It works! WOO AND YAY! (this isnt finished yet, only an idiot would use this on a production net atm)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5897 e03df62e-2008-0410-955e-edbf42e46eb7
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)