- ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Processing request to lookup " + req->name + " of type " + ConvToStr(req->type) + " to " + this->myserver.addr());
+ // Shutdown the socket if it exists.
+ if (HasFd())
+ {
+ SocketEngine::Shutdown(this, 2);
+ SocketEngine::Close(this);
+ }
+
+ // Remove all entries from the cache.
+ cache.clear();
+ }
+
+ void Process(DNS::Request* req) CXX11_OVERRIDE
+ {
+ if ((unloading) || (req->creator->dying))
+ throw Exception("Module is being unloaded");
+
+ if (!HasFd())
+ {
+ Query rr(req->question);
+ rr.error = ERROR_DISABLED;
+ req->OnError(&rr);
+ return;
+ }
+
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Processing request to lookup " + req->question.name + " of type " + ConvToStr(req->question.type) + " to " + this->myserver.addr());