aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_spanningtree/ijoin.cpp
diff options
context:
space:
mode:
authorGravatar Attila Molnar2014-04-16 13:08:44 +0200
committerGravatar Attila Molnar2014-04-16 13:08:44 +0200
commit3eb205218a321e454d873ae14e2e717ce9d64142 (patch)
tree4f0c4aabf7fe7c51b329e09b59984977869fd786 /src/modules/m_spanningtree/ijoin.cpp
parentRemove WALLCHOPS and WALLVOICES ISUPPORT tokens (diff)
downloadinspircd++-3eb205218a321e454d873ae14e2e717ce9d64142.tar.gz
inspircd++-3eb205218a321e454d873ae14e2e717ce9d64142.tar.bz2
inspircd++-3eb205218a321e454d873ae14e2e717ce9d64142.zip
m_spanningtree Throw an exception on protocol violations instead of returning CMD_INVALID
Catch CoreExceptions, log and close the link in OnDataReady()
Diffstat (limited to 'src/modules/m_spanningtree/ijoin.cpp')
-rw-r--r--src/modules/m_spanningtree/ijoin.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/modules/m_spanningtree/ijoin.cpp b/src/modules/m_spanningtree/ijoin.cpp
index a579848c8..637321bcb 100644
--- a/src/modules/m_spanningtree/ijoin.cpp
+++ b/src/modules/m_spanningtree/ijoin.cpp
@@ -48,10 +48,7 @@ CmdResult CommandIJoin::HandleRemote(RemoteUser* user, std::vector<std::string>&
}
if (RemoteTS < chan->age)
- {
- ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Attempted to lower TS via IJOIN. Channel=" + params[0] + " RemoteTS=" + params[1] + " LocalTS=" + ConvToStr(chan->age));
- return CMD_INVALID;
- }
+ throw ProtocolException("Attempted to lower TS via IJOIN. LocalTS=" + ConvToStr(chan->age));
apply_modes = ((params.size() > 2) && (RemoteTS == chan->age));
}
else
@@ -73,10 +70,7 @@ CmdResult CommandResync::HandleServer(TreeServer* server, std::vector<std::strin
}
if (!server->IsLocal())
- {
- ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Received RESYNC with a source that is not directly connected: " + server->GetID());
- return CMD_INVALID;
- }
+ throw ProtocolException("RESYNC from a server that is not directly connected");
// Send all known information about the channel
server->GetSocket()->SyncChannel(chan);