diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-11 19:06:27 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-11 19:06:27 +0000 |
commit | ed61aa1ed4b7418126bd99c62aa84d44e78b95ba (patch) | |
tree | 1187437923b52eb5c31e6c09a205f1886ef09291 /src/modules | |
parent | f5bc7aa7ceaee27df4aa047f3b702619f15fa00c (diff) |
Debug stuff, and some minor fixes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5927 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 11 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 13 | ||||
-rw-r--r-- | src/modules/extra/m_ziplink.cpp | 20 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 3 |
4 files changed, 41 insertions, 6 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 4a604ba9a..46c65efd4 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -267,7 +267,16 @@ class ModuleSSLGnuTLS : public Module } else if (strcmp("IS_HOOK", request->GetId()) == 0) { - return ServerInstance->Config->AddIOHook((Module*)this, (InspSocket*)ISR->Sock) ? (char*)"OK" : NULL; + char* ret = "OK"; + try + { + ret = ServerInstance->Config->AddIOHook((Module*)this, (InspSocket*)ISR->Sock) ? (char*)"OK" : NULL; + } + catch (ModuleException &e) + { + return NULL; + } + return ret; } else if (strcmp("IS_UNHOOK", request->GetId()) == 0) { diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index ed3d60b34..3aa1baea0 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -302,8 +302,17 @@ class ModuleSSLOpenSSL : public Module } 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; + char* ret = "OK"; + try + { + ret = ServerInstance->Config->AddIOHook((Module*)this, (InspSocket*)ISR->Sock) ? (char*)"OK" : NULL; + } + catch (ModuleException &e) + { + return NULL; + } + + return ret; } else if (strcmp("IS_UNHOOK", request->GetId()) == 0) { diff --git a/src/modules/extra/m_ziplink.cpp b/src/modules/extra/m_ziplink.cpp index 0647517c2..32f4cca77 100644 --- a/src/modules/extra/m_ziplink.cpp +++ b/src/modules/extra/m_ziplink.cpp @@ -148,7 +148,6 @@ class izip_session : public classbase z_stream c_stream; /* compression stream */ z_stream d_stream; /* decompress stream */ izip_status status; - int need_bytes; int fd; CountedBuffer* inbuf; }; @@ -196,7 +195,16 @@ class ModuleZLib : public Module } else if (strcmp("IS_HOOK", request->GetId()) == 0) { - return ServerInstance->Config->AddIOHook((Module*)this, (InspSocket*)ISR->Sock) ? (char*)"OK" : NULL; + char* ret = "OK"; + try + { + ret = ServerInstance->Config->AddIOHook((Module*)this, (InspSocket*)ISR->Sock) ? (char*)"OK" : NULL; + } + catch (ModuleException& e) + { + return NULL; + } + return ret; } else if (strcmp("IS_UNHOOK", request->GetId()) == 0) { @@ -255,6 +263,7 @@ class ModuleZLib : public Module session->status = IZIP_OPEN; session->inbuf = new CountedBuffer(); + ServerInstance->Log(DEBUG,"session->inbuf ALLOC = %d, %08x", fd, session->inbuf); session->c_stream.zalloc = (alloc_func)0; session->c_stream.zfree = (free_func)0; @@ -263,7 +272,6 @@ class ModuleZLib : public Module session->d_stream.zalloc = (alloc_func)0; session->d_stream.zfree = (free_func)0; session->d_stream.opaque = (voidpf)0; - } virtual void OnRawSocketConnect(int fd) @@ -289,6 +297,8 @@ class ModuleZLib : public Module if (readresult > 0) { + ServerInstance->Log(DEBUG,"session->inbuf PTR = %d, %08x", fd, session->inbuf); + session->inbuf->AddData(compr, readresult); int size = session->inbuf->GetFrame(compr, CHUNK); @@ -315,6 +325,8 @@ class ModuleZLib : public Module total_in_uncompressed += session->d_stream.total_out; buffer[session->d_stream.total_out] = 0; + + ServerInstance->Log(DEBUG,"Decompressed %d bytes", session->d_stream.total_out); } } return (readresult > 0); @@ -322,6 +334,8 @@ class ModuleZLib : public Module virtual int OnRawSocketWrite(int fd, const char* buffer, int count) { + ServerInstance->Log(DEBUG,"Compressing %d bytes", count); + izip_session* session = &sessions[fd]; int ocount = count; diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index ef7e17820..9345b5463 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -700,6 +700,9 @@ class TreeSocket : public InspSocket { myhost = ServerName; this->LinkState = CONNECTING; + + if (Hook) + InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); } /** When a listening socket gives us a new file descriptor, |