summaryrefslogtreecommitdiff
path: root/src/servers.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-23 18:28:42 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-23 18:28:42 +0000
commitbac7dea75b15323bb678ed56ca54606ee92c0afd (patch)
tree252691ab0e7240cd9dd1ccf26891e7ce66e6c178 /src/servers.cpp
parent426368db9d57376a47393cf22504f1d71b4ce0d8 (diff)
Buffer size limits (hard coded to 1mb for now, will allow to raise in config later)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1478 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/servers.cpp')
-rw-r--r--src/servers.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/servers.cpp b/src/servers.cpp
index d2ace18e8..15929345f 100644
--- a/src/servers.cpp
+++ b/src/servers.cpp
@@ -392,7 +392,12 @@ bool serverrec::RecvPacket(std::deque<std::string> &messages, char* recvhost,std
int pushed = 0;
if (rcvsize > 0)
{
- this->connectors[i].AddBuffer(data);
+ if (!this->connectors[i].AddBuffer(data))
+ {
+ WriteOpers("*** Read buffer for %s exceeds maximum, closing connection!",this->connectors[i].GetServerName().c_str());
+ this->connectors[i].CloseConnection();
+ this->connectors[i].SetState(STATE_DISCONNECTED);
+ }
if (this->connectors[i].BufferIsComplete())
{
while (this->connectors[i].BufferIsComplete())