From f6573be3321798765757b9ccc80ba4810d605ad0 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 15 Sep 2019 18:19:51 +0200 Subject: [PATCH] Avoid problems with HTTP --- src/danog/MadelineProto/Connection.php | 11 +++++++++++ src/danog/MadelineProto/Loop/Connection/ReadLoop.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/danog/MadelineProto/Connection.php b/src/danog/MadelineProto/Connection.php index e48ca547..73339b31 100644 --- a/src/danog/MadelineProto/Connection.php +++ b/src/danog/MadelineProto/Connection.php @@ -427,6 +427,17 @@ class Connection extends Session $this->writer->resume(); } } + /** + * Resume HttpWaiter + * + * @return void + */ + public function pingHttpWaiter() + { + if (isset($this->waiter)) { + $this->waiter->resume(); + } + } /** * Connect main instance. * diff --git a/src/danog/MadelineProto/Loop/Connection/ReadLoop.php b/src/danog/MadelineProto/Loop/Connection/ReadLoop.php index b3bff8b4..aa583ebb 100644 --- a/src/danog/MadelineProto/Loop/Connection/ReadLoop.php +++ b/src/danog/MadelineProto/Loop/Connection/ReadLoop.php @@ -130,7 +130,7 @@ class ReadLoop extends SignalLoop Loop::defer([$connection, 'handle_messages']); if ($shared->isHttp()) { - Loop::defer([$connection->waiter, 'resume']); + Loop::defer([$connection, 'pingHttpWaiter']); } } }