diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-12 09:13:06 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-12 09:13:06 +0000 |
commit | 0a45c56f10efb2af30835652b75317f2969a0b06 (patch) | |
tree | 86d1dd00f16b8078dfeddd4609f5a8946d05ca91 | |
parent | c92f8ebd92337a009410cc263d4a1392136629d2 (diff) |
Remove individual read buffers inside of BufferedSocket, use the shared netbuffer instead, like users. This means a 65kb saving per BufferedSocket.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9960 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/inspsocket.h | 9 | ||||
-rw-r--r-- | src/inspsocket.cpp | 9 | ||||
-rw-r--r-- | src/modules.cpp | 1 |
3 files changed, 6 insertions, 13 deletions
diff --git a/include/inspsocket.h b/include/inspsocket.h index af93baa56..ae18afabd 100644 --- a/include/inspsocket.h +++ b/include/inspsocket.h @@ -159,15 +159,6 @@ class CoreExport BufferedSocket : public EventHandler * socket has timed out. */ bool timeout; - - /** - * Socket input buffer, used by read(). The class which - * extends BufferedSocket is expected to implement an extendable - * buffer which can grow much larger than 64k, - * this buffer is just designed to be temporary storage. - * space. - */ - char ibuf[65535]; /** * The IP address being connected diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index e70b7647b..d4e7e93e7 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -392,6 +392,7 @@ const char* BufferedSocket::Read() return NULL; int n = 0; + char *ReadBuffer = Instance->GetReadBuffer(); if (this->IsIOHooked) { @@ -399,7 +400,7 @@ const char* BufferedSocket::Read() int MOD_RESULT = 0; try { - MOD_RESULT = Instance->Config->GetIOHook(this)->OnRawSocketRead(this->fd,this->ibuf,sizeof(this->ibuf) - 1,result2); + MOD_RESULT = Instance->Config->GetIOHook(this)->OnRawSocketRead(this->fd, ReadBuffer, sizeof(ReadBuffer) - 1,result2); } catch (CoreException& modexcept) { @@ -417,7 +418,7 @@ const char* BufferedSocket::Read() } else { - n = recv(this->fd,this->ibuf,sizeof(this->ibuf) - 1,0); + n = recv(this->fd, ReadBuffer, sizeof(ReadBuffer) - 1, 0); } /* @@ -428,8 +429,8 @@ const char* BufferedSocket::Read() */ if (n > 0) { - ibuf[n] = 0; - return ibuf; + ReadBuffer[n] = 0; + return ReadBuffer; } else { diff --git a/src/modules.cpp b/src/modules.cpp index e25f4bf10..d3de60f6a 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -143,6 +143,7 @@ int Module::OnCheckInvite(User*, Channel*) { return 0; } int Module::OnCheckKey(User*, Channel*, const std::string&) { return 0; } int Module::OnCheckLimit(User*, Channel*) { return 0; } int Module::OnCheckBan(User*, Channel*) { return 0; } +int Module::OnCheckExtBan(User *, Channel *, char) { return 0; } int Module::OnStats(char, User*, string_list&) { return 0; } int Module::OnChangeLocalUserHost(User*, const std::string&) { return 0; } int Module::OnChangeLocalUserGECOS(User*, const std::string&) { return 0; } |