summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-11 10:40:48 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-11 10:40:48 +0000
commitfe66a14a06c5542a8b127e2f1e0a51e4dc2946dc (patch)
tree9ae4b18dbe9ef384f1edd78446980b0086ea6098 /src
parenta5833e654dd99fc2513b17100f0f06d50e75b4a9 (diff)
Move ReadBuffer into InspIRCd class
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4877 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/userprocess.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/userprocess.cpp b/src/userprocess.cpp
index 656eac865..565b7df05 100644
--- a/src/userprocess.cpp
+++ b/src/userprocess.cpp
@@ -51,11 +51,6 @@ using namespace std;
#include "command_parse.h"
#include "cull_list.h"
-//extern struct sockaddr_in client,server;
-//extern socklen_t length;
-
-char data[65536];
-
void InspIRCd::ProcessUser(userrec* cu)
{
int result = EAGAIN;
@@ -72,7 +67,7 @@ void InspIRCd::ProcessUser(userrec* cu)
try
{
- MOD_RESULT = this->Config->GetIOHook(cu->GetPort())->OnRawSocketRead(cu->fd,data,65535,result2);
+ MOD_RESULT = this->Config->GetIOHook(cu->GetPort())->OnRawSocketRead(cu->fd,ReadBuffer,sizeof(ReadBuffer),result2);
log(DEBUG,"Data result returned by module: %d",MOD_RESULT);
}
catch (ModuleException& modexcept)
@@ -91,7 +86,7 @@ void InspIRCd::ProcessUser(userrec* cu)
}
else
{
- result = cu->ReadData(data, 65535);
+ result = cu->ReadData(ReadBuffer, sizeof(ReadBuffer));
}
log(DEBUG,"Read result: %d",result);
@@ -112,12 +107,12 @@ void InspIRCd::ProcessUser(userrec* cu)
for (int checker = 0; checker < result; checker++)
{
- if (data[checker] == 0)
- data[checker] = ' ';
+ if (ReadBuffer[checker] == 0)
+ ReadBuffer[checker] = ' ';
}
if (result > 0)
- data[result] = '\0';
+ ReadBuffer[result] = '\0';
current = cu;
currfd = current->fd;
@@ -125,7 +120,7 @@ void InspIRCd::ProcessUser(userrec* cu)
// add the data to the users buffer
if (result > 0)
{
- if (!current->AddBuffer(data))
+ if (!current->AddBuffer(ReadBuffer))
{
// AddBuffer returned false, theres too much data in the user's buffer and theyre up to no good.
if (current->registered == REG_ALL)