From 233897b3a8d16097ca9064e0ff74a9836a1ffc93 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 25 Jan 2012 21:18:57 +0100 Subject: [PATCH] threaded DNS: Remove an unneeded function This inlines the function into its only caller. Signed-off-by: Uli Schlachter --- include/znc/Socket.h | 1 - src/Socket.cpp | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/znc/Socket.h b/include/znc/Socket.h index 037d202b..50ccccee 100644 --- a/include/znc/Socket.h +++ b/include/znc/Socket.h @@ -131,7 +131,6 @@ private: }; void StartTDNSThread(TDNSTask* task, bool bBind); void SetTDNSThreadFinished(TDNSTask* task, bool bBind, addrinfo* aiResult); - void TryToFinishTDNSTask(TDNSTask* task); void RetrieveTDNSResult(); static void* TDNSThread(void* argument); #endif diff --git a/src/Socket.cpp b/src/Socket.cpp index a1849734..58e3dddf 100644 --- a/src/Socket.cpp +++ b/src/Socket.cpp @@ -129,13 +129,13 @@ void CSockManager::SetTDNSThreadFinished(TDNSTask* task, bool bBind, addrinfo* a task->aiTarget = aiResult; task->bDoneTarget = true; } - TryToFinishTDNSTask(task); -} -void CSockManager::TryToFinishTDNSTask(TDNSTask* task) { + // Now that something is done, check if everything we needed is done if (!task->bDoneBind || !task->bDoneTarget) { return; } + + // All needed DNS is done, now collect the results addrinfo* aiTarget = NULL; addrinfo* aiBind = NULL;