diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-22 15:58:13 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-22 15:58:13 +0000 |
commit | 08b8c64bb6b6aa1d8cc5a7963c4ffa0a24e81960 (patch) | |
tree | 0870f52bd5d499235bce3fd65cc764ec1d1f9eb6 | |
parent | c2dd98bd7dd310e76e5e69bfd964c01981fdb454 (diff) |
Change around some dns stuff (dont use this yet)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5522 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/dns.h | 9 | ||||
-rw-r--r-- | src/dns.cpp | 7 | ||||
-rw-r--r-- | src/users.cpp | 4 |
3 files changed, 12 insertions, 8 deletions
diff --git a/include/dns.h b/include/dns.h index 804250c15..b011a9ddb 100644 --- a/include/dns.h +++ b/include/dns.h @@ -255,11 +255,6 @@ class DNS : public EventHandler int currid; /** - * Currently active Resolver classes - */ - Resolver* Classes[MAX_REQUEST_ID]; - - /** * We have to turn off a few checks on received packets * when people are using 4in6 (e.g. ::ffff:xxxx). This is * a temporary kludge, Please let me know if you know how @@ -274,6 +269,10 @@ class DNS : public EventHandler public: /** + * Currently active Resolver classes + */ + Resolver* Classes[MAX_REQUEST_ID]; + /** * The port number DNS requests are made on, * and replies have as a source-port number. */ diff --git a/src/dns.cpp b/src/dns.cpp index ca08b93ba..5a79d0d2e 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -126,7 +126,12 @@ class RequestTimeout : public InspTimer /* Still exists, whack it */ if (rl.find(watchid)->second == watch) { - watch->OnError(RESOLVER_TIMEOUT, "Request timed out"); + 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); diff --git a/src/users.cpp b/src/users.cpp index c666fd7bd..796893be6 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -282,8 +282,8 @@ userrec::userrec(InspIRCd* Instance) : ServerInstance(Instance) for (unsigned int n = 0; n < MAXCHANS; n++) { chans[n] = new ucrec(); - x->channel = NULL; - x->uc_modes = 0; + chans[n]->channel = NULL; + chans[n]->uc_modes = 0; } } |