summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-08-25 18:01:50 +0200
committerAttila Molnar <attilamolnar@hush.com>2016-08-25 18:01:50 +0200
commit23e803f104d59503dc2a37e458eb4daedc44ccfc (patch)
treee694834a1960e92465e7ce21998b29437fdbc8a4 /src
parent2df0e9048693d88bac78ebb370b3a2529e66223d (diff)
m_spanningtree Handle unload in resolvers
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/resolvers.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/resolvers.cpp b/src/modules/m_spanningtree/resolvers.cpp
index 6682b8dbe..1228e375f 100644
--- a/src/modules/m_spanningtree/resolvers.cpp
+++ b/src/modules/m_spanningtree/resolvers.cpp
@@ -73,7 +73,12 @@ void ServernameResolver::OnLookupComplete(const DNS::Query *r)
void ServernameResolver::OnError(const DNS::Query *r)
{
- /* Ooops! */
+ if (r->error == DNS::ERROR_UNLOADED)
+ {
+ // We're being unloaded, skip the snotice and ConnectServer() below to prevent autoconnect creating new sockets
+ return;
+ }
+
if (query == DNS::QUERY_AAAA)
{
ServernameResolver* snr = new ServernameResolver(this->manager, host, MyLink, DNS::QUERY_A, myautoconnect);
@@ -115,6 +120,7 @@ void SecurityIPResolver::OnLookupComplete(const DNS::Query *r)
void SecurityIPResolver::OnError(const DNS::Query *r)
{
+ // This can be called because of us being unloaded but we don't have to do anything differently
if (query == DNS::QUERY_AAAA)
{
SecurityIPResolver* res = new SecurityIPResolver(mine, this->manager, host, MyLink, DNS::QUERY_A);