1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-30 04:39:01 +01:00

Fix handling of invalid connections

Channel::receive() can throw ChannelException and SerializationException, so just catch everything here.
This commit is contained in:
Aaron Piotrowski 2019-02-18 18:44:30 -06:00
parent a9e22e9ef8
commit a0575b4930
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -64,7 +64,7 @@ final class ProcessHub
try { try {
$received = yield Promise\timeout($channel->receive(), self::KEY_RECEIVE_TIMEOUT); $received = yield Promise\timeout($channel->receive(), self::KEY_RECEIVE_TIMEOUT);
} catch (TimeoutException $exception) { } catch (\Throwable $exception) {
$channel->close(); $channel->close();
return; // Ignore possible foreign connection attempt. return; // Ignore possible foreign connection attempt.
} }