X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Ftreesocket2.cpp;h=a06ff3a67248464aeb3646527fbfb1e9948fe451;hb=b998720a5f6f66e80c88a5448435943d5927abf3;hp=cb49d92c92d66f23cfd556aaeedbeffc026535d5;hpb=f293861ab70eab76ae0715a5f2c2769de332c779;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index cb49d92c9..a06ff3a67 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -440,6 +440,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command, ServerInstance->Logs->Log("m_spanningtree", SPARSE, "Unrecognised S2S command :%s %s %s", who->uuid.c_str(), command.c_str(), pmlist.GetJoined().c_str()); SendError("Unrecognised command '" + command + "' -- possibly loaded mismatched modules"); + return; } if (params.size() < cmd->min_params) @@ -448,6 +449,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command, ServerInstance->Logs->Log("m_spanningtree", SPARSE, "Insufficient parameters for S2S command :%s %s %s", who->uuid.c_str(), command.c_str(), pmlist.GetJoined().c_str()); SendError("Insufficient parameters for command '" + command + "'"); + return; } CmdResult res = cmd->Handle(params, who); @@ -459,7 +461,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command, who->uuid.c_str(), command.c_str(), pmlist.GetJoined().c_str()); SendError("Error handling '" + command + "' -- possibly loaded mismatched modules"); } - if (res == CMD_SUCCESS) + else if (res == CMD_SUCCESS) Utils->RouteCommand(route_back_again, command, params, who); } } @@ -482,13 +484,16 @@ void TreeSocket::Close() if (MyRoot) Squit(MyRoot,getError()); - if (!linkID.empty()) + if (!ConnectionFailureShown) { + ConnectionFailureShown = true; ServerInstance->SNO->WriteGlobalSno('l', "Connection to '\2%s\2' failed.",linkID.c_str()); time_t server_uptime = ServerInstance->Time() - this->age; if (server_uptime) - ServerInstance->SNO->WriteGlobalSno('l', "Connection to '\2%s\2' was established for %s", linkID.c_str(), Utils->Creator->TimeToStr(server_uptime).c_str()); - linkID.clear(); + { + std::string timestr = Utils->Creator->TimeToStr(server_uptime); + ServerInstance->SNO->WriteGlobalSno('l', "Connection to '\2%s\2' was established for %s", linkID.c_str(), timestr.c_str()); + } } }