1
0
mirror of https://github.com/danog/dns.git synced 2024-11-26 20:14:51 +01:00

Fix host loading on Windows

This commit is contained in:
Niklas Keller 2017-06-24 01:18:03 +02:00
parent 70205d9282
commit ad55bcf870
2 changed files with 9 additions and 2 deletions

View File

@ -8,6 +8,12 @@ use Amp\WindowsRegistry\WindowsRegistry;
use function Amp\call;
final class WindowsConfigLoader implements ConfigLoader {
private $hostLoader;
public function __construct(HostLoader $hostLoader = null) {
$this->hostLoader = $hostLoader ?? new HostLoader;
}
public function loadConfig(): Promise {
return call(function () {
$keys = [
@ -67,7 +73,9 @@ final class WindowsConfigLoader implements ConfigLoader {
}
}
return new Config($nameservers);
$hosts = yield $this->hostLoader->loadHosts();
return new Config($nameservers, $hosts);
});
}
}

View File

@ -28,7 +28,6 @@ class IntegrationTest extends TestCase {
}
/**
* @param string $hostname
* @group internet
*/
public function testWorksAfterConfigReload() {