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.
This commit is contained in:
Andrej Mitrovic 2020-08-24 16:40:57 +09:00 committed by Mathias LANG
parent 1fcc941b1f
commit 6f62236b2d

View file

@ -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;
}