amphp / dns

Async DNS resolution for PHP based on Amp.
https://amphp.org/dns
MIT License
157 stars 32 forks source link

DNS timeout causes array out of bounds error. #1

Closed Danack closed 10 years ago

Danack commented 10 years ago

It looks like when a DNS lookup times out, the code doesn't handle it gracefully. i.e. when

$this->completePendingLookup($id, null, ResolutionErrors::ERR_SERVER_TIMEOUT);

is called, it causes an out of bounds error in AddrDnsResolver.php on line 49:

Error message: "Undefined offset: 3" aka ERR_SERVER_TIMEOUT

Stack trace:

intahwebz/vendor/rdlowrey/artax/src/Artax/AddrDnsResolver.php:49
intahwebz/vendor/daverandom/addr/lib/Addr/Client.php:267
intahwebz/vendor/daverandom/addr/lib/Addr/Client.php:188
intahwebz/vendor/rdlowrey/alert/lib/NativeReactor.php:143
intahwebz/vendor/rdlowrey/alert/lib/NativeReactor.php:122
intahwebz/vendor/rdlowrey/alert/lib/NativeReactor.php:82
intahwebz/vendor/rdlowrey/artax/src/Artax/Client.php:53
intahwebz/src/BaseReality/Service/FlickrArtax.php:33
DaveRandom commented 10 years ago

Fixed by https://github.com/rdlowrey/Artax/commit/136ee365d9cce65fd0c250cdb16b921e44d79ab2