1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 03:16:37 +02:00

Cap mode stacker max line length

This commit is contained in:
Adam
2013-09-03 19:40:03 -04:00
parent 4691351167
commit 1b42e26642
3 changed files with 5 additions and 2 deletions
+2
View File
@@ -66,6 +66,8 @@ class CoreExport IRCDProto : public Service
bool RequiresID;
/* The maximum number of modes we are allowed to set with one MODE command */
unsigned MaxModes;
/* The maximum number of bytes a line may have */
unsigned MaxLine;
/** Sets the server in NOOP mode. If NOOP mode is enabled, no users
* will be able to oper on the server.
+2 -2
View File
@@ -274,7 +274,7 @@ static std::list<Anope::string> BuildModeStrings(StackerInfo *info)
for (it = info->AddModes.begin(), it_end = info->AddModes.end(); it != it_end; ++it)
{
if (++NModes > IRCD->MaxModes)
if (++NModes > IRCD->MaxModes || (buf.length() + parambuf.length() > IRCD->MaxLine - 100)) // Leave room for command, channel, etc
{
ret.push_back(buf + parambuf);
buf = "+";
@@ -294,7 +294,7 @@ static std::list<Anope::string> BuildModeStrings(StackerInfo *info)
buf += "-";
for (it = info->DelModes.begin(), it_end = info->DelModes.end(); it != it_end; ++it)
{
if (++NModes > IRCD->MaxModes)
if (++NModes > IRCD->MaxModes || (buf.length() + parambuf.length() > IRCD->MaxLine - 100)) // Leave room for command, channel, etc
{
ret.push_back(buf + parambuf);
buf = "-";
+1
View File
@@ -28,6 +28,7 @@ IRCDProto::IRCDProto(Module *creator, const Anope::string &p) : Service(creator,
CanSVSNick = CanSVSJoin = CanSetVHost = CanSetVIdent = CanSNLine = CanSQLine = CanSQLineChannel
= CanSZLine = CanSVSHold = CanSVSO = CanCertFP = RequiresID = false;
MaxModes = 3;
MaxLine = 512;
if (IRCD == NULL)
IRCD = this;