summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2009-01-02 23:26:54 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2009-01-02 23:26:54 +0000
commit31407a3b9e138266bcc1ddb5cffd91bee4f1092c (patch)
tree0eab2cbc69e0530914b374c87348bbd84043489c
parent7fdb199071b8f83860e33d9548f014c54c95fbe2 (diff)
...and make it not go querying modules that dont implement the right interface and cause it to crash :p
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10935 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_spanningtree/main.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index dcd02ba9b..511465084 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -728,11 +728,15 @@ void ModuleSpanningTree::RedoConfig(Module* mod, const std::string &name)
{
/* If m_sha256.so is loaded (we use this for HMAC) or any module implementing a BufferedSocket interface is loaded,
* then we need to re-read our config again taking this into account.
- *
- * We determine if a module supports BufferedSocket simply by sending it the Request for its BufferedSocket name,
- * and if it responds non-NULL, it implements the interface.
*/
- if (name == "m_sha256.so" || BufferedSocketNameRequest((Module*)this, mod).Send() != NULL)
+ modulelist* ml = ServerInstance->Modules->FindInterface("BufferedSocketHook");
+ bool IsBufferSocketModule = false;
+
+ /* Did we find any modules? */
+ if (ml && std::find(ml->begin(), ml->end(), mod) != ml->end())
+ IsBufferSocketModule = true;
+
+ if (name == "m_sha256.so" || IsBufferSocketModule)
{
Utils->ReadConfiguration(true);
}