diff --git a/src/danog/MadelineProto/Loop/Connection/WriteLoop.php b/src/danog/MadelineProto/Loop/Connection/WriteLoop.php index 08b56a09..b3951765 100644 --- a/src/danog/MadelineProto/Loop/Connection/WriteLoop.php +++ b/src/danog/MadelineProto/Loop/Connection/WriteLoop.php @@ -187,7 +187,7 @@ class WriteLoop extends ResumableSignalLoop $body_length = strlen($message['serialized_body']); $actual_length = $body_length + 32; if ($total_length && $total_length + $actual_length > 32760 || $count >= 1020) { - $API->logger->logger('Length overflow, postponing part of payload', \danog\MadelineProto\Logger::NOTICE); + $API->logger->logger('Length overflow, postponing part of payload', \danog\MadelineProto\Logger::ULTRA_VERBOSE); break; } @@ -248,7 +248,7 @@ class WriteLoop extends ResumableSignalLoop $body_length = strlen($MTmessage['body']); $actual_length = $body_length + 32; if ($total_length && $total_length + $actual_length > 32760) { - $API->logger->logger('Length overflow, postponing part of payload', \danog\MadelineProto\Logger::NOTICE); + $API->logger->logger('Length overflow, postponing part of payload', \danog\MadelineProto\Logger::ULTRA_VERBOSE); break; } $count++; diff --git a/src/danog/MadelineProto/MTProtoTools/Files.php b/src/danog/MadelineProto/MTProtoTools/Files.php index 7797c801..ee368b49 100644 --- a/src/danog/MadelineProto/MTProtoTools/Files.php +++ b/src/danog/MadelineProto/MTProtoTools/Files.php @@ -298,6 +298,7 @@ trait Files private $done = []; private $pending = []; public $nextRead; + public $size; public function write(string $data, int $offset) { if (isset($this->pending[$offset])) { @@ -325,11 +326,14 @@ trait Files } $this->pending[$offset] = new Deferred; $res = $this->pending[$offset]->promise(); - + if ($offset + $size >= $this->size) { + $this->nextRead->resolve(true); + } return $res; } }; $bridge->nextRead = new Deferred; + $bridge->size = $size; $reader = [$bridge, 'read']; $writer = [$bridge, 'write']; yield $this->all([