]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/dns.cpp
Change around some dns stuff (dont use this yet)
[user/henk/code/inspircd.git] / src / dns.cpp
index 55c41eb3210398053114bb81a53d17c99d8f6364..5a79d0d2eb1b79910107451d0d69fc5b36495b76 100644 (file)
@@ -116,7 +116,7 @@ class RequestTimeout : public InspTimer
  public:
        RequestTimeout(InspIRCd* SI, DNSRequest* watching, int id, requestlist &requests) : InspTimer(2, time(NULL)), ServerInstance(SI), watch(watching), watchid(id), rl(requests)
        {
-               ServerInstance->Log(DEBUG,"New DNS timeout set on %08x", watching);
+               ServerInstance->Log(DEBUG, "New DNS timeout set on %08x", watching);
        }
 
        void Tick(time_t TIME)
@@ -126,13 +126,19 @@ class RequestTimeout : public InspTimer
                        /* Still exists, whack it */
                        if (rl.find(watchid)->second == watch)
                        {
+                               if (ServerInstance->Res->Classes[watchid])
+                               {
+                                       ServerInstance->Res->Classes[watchid]->OnError(RESOLVER_TIMEOUT, "Request timed out");
+                                       delete ServerInstance->Res->Classes[watchid];
+                                       ServerInstance->Res->Classes[watchid] = NULL;
+                               }
                                rl.erase(rl.find(watchid));
                                delete watch;
-                               ServerInstance->Log(DEBUG,"DNS timeout on %08x squished pointer", watch);
+                               ServerInstance->Log(DEBUG, "DNS timeout on %08x squished pointer", watch);
                        }
                        return;
                }
-               ServerInstance->Log(DEBUG,"DNS timeout on %08x: result already received!", watch);
+               ServerInstance->Log(DEBUG, "DNS timeout on %08x: result already received!", watch);
        }
 };