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

Implement proper fix for the OPCache issue

This commit is contained in:
Niklas Keller 2017-07-01 15:44:10 +02:00
parent c1c552d752
commit d382d71fc7

View File

@ -158,12 +158,11 @@ abstract class Socket {
try {
// Work around an OPCache issue that returns an empty array with "return yield ...",
// so assign to a variable first.
// so assign to a variable first and return after the try block.
//
// See https://github.com/amphp/dns/issues/58.
// See https://bugs.php.net/bug.php?id=74840.
$result = yield Promise\timeout($deferred->promise(), $timeout);
return $result;
} catch (Amp\TimeoutException $exception) {
unset($this->pending[$id]);
@ -178,6 +177,8 @@ abstract class Socket {
$deferred->resolve();
}
}
return $result;
});
}