From 4ec65c6231df9fcb38210f9b885cdf73b72cc176 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sun, 9 Feb 2014 17:17:04 +0100 Subject: Call DelFd() and SetFd(-1) from SocketEngine::Close(EventHandler*) --- src/commands/cmd_dns.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/commands') diff --git a/src/commands/cmd_dns.cpp b/src/commands/cmd_dns.cpp index 63924d87b..7b93c7bb3 100644 --- a/src/commands/cmd_dns.cpp +++ b/src/commands/cmd_dns.cpp @@ -681,10 +681,8 @@ class MyManager : public Manager, public Timer, public EventHandler { if (this->GetFd() > -1) { - SocketEngine::DelFd(this); SocketEngine::Shutdown(this, 2); SocketEngine::Close(this); - this->SetFd(-1); /* Remove expired entries from the cache */ this->Tick(ServerInstance->Time()); @@ -710,13 +708,13 @@ class MyManager : public Manager, public Timer, public EventHandler { /* Failed to bind */ ServerInstance->Logs->Log("RESOLVER", LOG_SPARSE, "Resolver: Error binding dns socket - hostnames will NOT resolve"); - SocketEngine::Close(this); + SocketEngine::Close(this->GetFd()); this->SetFd(-1); } else if (!SocketEngine::AddFd(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE)) { ServerInstance->Logs->Log("RESOLVER", LOG_SPARSE, "Resolver: Internal error starting DNS - hostnames will NOT resolve."); - SocketEngine::Close(this); + SocketEngine::Close(this->GetFd()); this->SetFd(-1); } } -- cgit v1.2.3