]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket1.cpp
m_spanningtree Assign an id to new Memberships
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket1.cpp
index 9c262f1ea469b3aca0881b1ee5ce626692ea8557..931bd3f9f4fcacb32cbba9667ed17e0fd6e1108d 100644 (file)
@@ -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;
        }