X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Ftreesocket1.cpp;h=931bd3f9f4fcacb32cbba9667ed17e0fd6e1108d;hb=c8f92d97c2cd92a07bbb76b96a67cd089c7e3407;hp=9c262f1ea469b3aca0881b1ee5ce626692ea8557;hpb=99f79a4e5c3abbe91a03216824e7659051872054;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 9c262f1ea..931bd3f9f 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -188,7 +188,7 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason) } else { - ServerInstance->SNO->WriteGlobalSno('L', "Server \002"+Current->GetName()+"\002 split from server \002"+Current->GetParent()->GetName()+"\002 with reason: "+reason); + ServerInstance->SNO->WriteToSnoMask('L', "Server \002"+Current->GetName()+"\002 split from server \002"+Current->GetParent()->GetName()+"\002 with reason: "+reason); } int num_lost_servers = 0; int num_lost_users = 0; @@ -204,8 +204,9 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason) Current->Tidy(); Current->GetParent()->DelChild(Current); Current->cull(); + const bool ismyroot = (Current == MyRoot); delete Current; - if (Current == MyRoot) + if (ismyroot) { MyRoot = NULL; Close(); @@ -250,7 +251,18 @@ void TreeSocket::OnDataReady() SendError("Read null character from socket"); break; } - ProcessLine(line); + + try + { + ProcessLine(line); + } + catch (CoreException& ex) + { + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Error while processing: " + line); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, ex.GetReason()); + SendError(ex.GetReason() + " - check the log file for details"); + } + if (!getError().empty()) break; }