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']); } } }