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:
parent
a9e22e9ef8
commit
a0575b4930
@ -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.
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user