From 3eb205218a321e454d873ae14e2e717ce9d64142 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 16 Apr 2014 13:08:44 +0200 Subject: m_spanningtree Throw an exception on protocol violations instead of returning CMD_INVALID Catch CoreExceptions, log and close the link in OnDataReady() --- src/modules/m_spanningtree/ijoin.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/modules/m_spanningtree/ijoin.cpp') 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& } 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::vectorIsLocal()) - { - 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); -- cgit v1.3.1-10-gc9f91