diff options
author | Adam <Adam@anope.org> | 2013-09-03 19:40:03 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-09-03 19:40:03 -0400 |
commit | 1b42e266426fd9aee439d024d787c7ba4a421c63 (patch) | |
tree | b4c0a6c823108f0b2b3a6d5673200e57956a0abe /src | |
parent | 46913511677b169f32d55e4fc96a8c236169ddc7 (diff) |
Cap mode stacker max line length
Diffstat (limited to 'src')
-rw-r--r-- | src/modes.cpp | 4 | ||||
-rw-r--r-- | src/protocol.cpp | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/modes.cpp b/src/modes.cpp index 41c2ac663..55ce2b506 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -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 = "-"; diff --git a/src/protocol.cpp b/src/protocol.cpp index ba44ea708..dc07ac40d 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -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; |