mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 09:58:59 +01:00
Bugfix
This commit is contained in:
parent
949bd194ed
commit
214fc0d0f9
@ -18,6 +18,8 @@
|
||||
|
||||
namespace danog\MadelineProto\Loop\Connection;
|
||||
|
||||
use Amp\ByteStream\PendingReadError;
|
||||
use Amp\ByteStream\StreamException;
|
||||
use Amp\Loop;
|
||||
use Amp\Websocket\ClosedException;
|
||||
use danog\MadelineProto\Logger;
|
||||
@ -25,7 +27,6 @@ use danog\MadelineProto\Loop\Impl\SignalLoop;
|
||||
use danog\MadelineProto\MTProtoTools\Crypt;
|
||||
use danog\MadelineProto\NothingInTheSocketException;
|
||||
use danog\MadelineProto\Tools;
|
||||
use Amp\ByteStream\StreamException;
|
||||
|
||||
/**
|
||||
* Socket read loop.
|
||||
@ -57,7 +58,7 @@ class ReadLoop extends SignalLoop
|
||||
while (true) {
|
||||
try {
|
||||
$error = yield $this->waitSignal($this->readMessage());
|
||||
} catch (NothingInTheSocketException|StreamException $e) {
|
||||
} catch (NothingInTheSocketException | StreamException | PendingReadError $e) {
|
||||
if (isset($connection->old)) {
|
||||
return;
|
||||
}
|
||||
@ -65,10 +66,6 @@ class ReadLoop extends SignalLoop
|
||||
$API->logger->logger("Got nothing in the socket in DC {$datacenter}, reconnecting...", Logger::ERROR);
|
||||
yield $connection->reconnect();
|
||||
continue;
|
||||
} catch (ClosedException $e) {
|
||||
$API->logger->logger($e->getMessage(), Logger::FATAL_ERROR);
|
||||
|
||||
throw $e;
|
||||
}
|
||||
|
||||
if (is_int($error)) {
|
||||
|
Loading…
Reference in New Issue
Block a user