summaryrefslogtreecommitdiff
path: root/src/userprocess.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-14 16:31:49 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-14 16:31:49 +0000
commitcbb888a47064a8b70254047fd305bea73c2395ad (patch)
tree5e4e9eec35b169166e2a6589faa4ceeaaa0db45c /src/userprocess.cpp
parent730d2a2c2af916b32a46c3f0792e99b3275839cc (diff)
Allow for resizing of MAXBUF above/below 512 via non-interactive configure. (Some crazy mofo on the forums asked for this, good luck its your funeral :p)
THIS IS UNSUPPORTED BY US IF YOU CHANGE IT, WE WON'T EVEN TELL YOU HOW :) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7022 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/userprocess.cpp')
-rw-r--r--src/userprocess.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/userprocess.cpp b/src/userprocess.cpp
index a72d738c3..dd6a4c24d 100644
--- a/src/userprocess.cpp
+++ b/src/userprocess.cpp
@@ -107,7 +107,7 @@ void InspIRCd::ProcessUser(userrec* cu)
}
else
{
- current->WriteServ("NOTICE %s :Your previous line was too long and was not delivered (Over 512chars) Please shorten it.", current->nick);
+ current->WriteServ("NOTICE %s :Your previous line was too long and was not delivered (Over %d chars) Please shorten it.", current->nick, MAXBUF-2);
current->recvq = "";
}
}
@@ -177,8 +177,8 @@ void InspIRCd::ProcessUser(userrec* cu)
std::string single_line = current->GetBuffer();
current->bytes_in += single_line.length();
current->cmds_in++;
- if (single_line.length() > 512)
- single_line.resize(512);
+ if (single_line.length() > MAXBUF - 2) /* MAXBUF is 514 to allow for neccessary line terminators */
+ single_line.resize(MAXBUF - 2); /* So to trim to 512 here, we use MAXBUF - 2 */
EventHandler* old_comp = this->SE->GetRef(currfd);