summaryrefslogtreecommitdiff
path: root/src/inspsocket.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-12 09:13:06 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-12 09:13:06 +0000
commit0a45c56f10efb2af30835652b75317f2969a0b06 (patch)
tree86d1dd00f16b8078dfeddd4609f5a8946d05ca91 /src/inspsocket.cpp
parentc92f8ebd92337a009410cc263d4a1392136629d2 (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
Diffstat (limited to 'src/inspsocket.cpp')
-rw-r--r--src/inspsocket.cpp9
1 files changed, 5 insertions, 4 deletions
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
{