]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket2.cpp
m_spanningtree Netburst: Remove unused parameters and variables
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket2.cpp
index cb49d92c92d66f23cfd556aaeedbeffc026535d5..a06ff3a67248464aeb3646527fbfb1e9948fe451 100644 (file)
@@ -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());
+               }
        }
 }