diff options
| author | 2012-06-11 15:02:10 +0200 | |
|---|---|---|
| committer | 2012-06-11 15:02:10 +0200 | |
| commit | 31ec715931c72a902aeabb828a5d9a7a2563a8cc (patch) | |
| tree | 1aafd024cba8e1ad86f2a3d4976557d69fa62f94 /src/modules/m_spanningtree/main.cpp | |
| parent | Merge pull request #179 from attilamolnar/insp20+desyncfix (diff) | |
m_spanningtree Notify opers upon ecountering a configuration error when rehashing
Diffstat (limited to 'src/modules/m_spanningtree/main.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/main.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
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) |
