From 6f62236b2dc0788f8748a54a7014655219a6c8d7 Mon Sep 17 00:00:00 2001 From: Andrej Mitrovic Date: Mon, 24 Aug 2020 16:40:57 +0900 Subject: [PATCH] DNS allocateHandle(): Don't return handle in use This is a second attempt at fixing the issue originally mentioned in PR #152. This will allocate a new handle if all of them are in use. --- source/eventcore/drivers/posix/dns.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/eventcore/drivers/posix/dns.d b/source/eventcore/drivers/posix/dns.d index 6449a9a..c4db2f7 100644 --- a/source/eventcore/drivers/posix/dns.d +++ b/source/eventcore/drivers/posix/dns.d @@ -203,7 +203,7 @@ final class EventDriverDNS_GAI(Events : EventDriverEvents, Signals : EventDriver assert(m_lookups.length <= int.max); int id = cast(int)m_lookups.length; foreach (i, ref l; m_lookups) - if (!l.callback) { + if (!l.callback && !l.result) { id = cast(int)i; break; }