From 31ec715931c72a902aeabb828a5d9a7a2563a8cc Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Mon, 11 Jun 2012 15:02:10 +0200 Subject: m_spanningtree Notify opers upon ecountering a configuration error when rehashing --- src/modules/m_spanningtree/main.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/modules/m_spanningtree/main.cpp') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 1067852d1..f639a748d 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -765,7 +765,21 @@ void ModuleSpanningTree::OnPreRehash(User* user, const std::string ¶meter) void ModuleSpanningTree::OnRehash(User* user) { // Re-read config stuff - Utils->ReadConfiguration(); + try + { + Utils->ReadConfiguration(); + } + catch (ModuleException& e) + { + // Refresh the IP cache anyway, so servers read before the error will be allowed to connect + Utils->RefreshIPCache(); + // Always warn local opers with snomask +l, also warn globally (snomask +L) if the rehash was issued by a remote user + std::string msg = "Error in configuration: "; + msg.append(e.GetReason()); + ServerInstance->SNO->WriteToSnoMask('l', msg); + if (!IS_LOCAL(user)) + ServerInstance->PI->SendSNONotice("L", msg); + } } void ModuleSpanningTree::OnLoadModule(Module* mod) -- cgit v1.3.1-10-gc9f91