Bugfix
This commit is contained in:
parent
83d9c2e1a0
commit
5f50fa4636
@ -187,7 +187,7 @@ class WriteLoop extends ResumableSignalLoop
|
|||||||
$body_length = strlen($message['serialized_body']);
|
$body_length = strlen($message['serialized_body']);
|
||||||
$actual_length = $body_length + 32;
|
$actual_length = $body_length + 32;
|
||||||
if ($total_length && $total_length + $actual_length > 32760 || $count >= 1020) {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ class WriteLoop extends ResumableSignalLoop
|
|||||||
$body_length = strlen($MTmessage['body']);
|
$body_length = strlen($MTmessage['body']);
|
||||||
$actual_length = $body_length + 32;
|
$actual_length = $body_length + 32;
|
||||||
if ($total_length && $total_length + $actual_length > 32760) {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
$count++;
|
$count++;
|
||||||
|
@ -298,6 +298,7 @@ trait Files
|
|||||||
private $done = [];
|
private $done = [];
|
||||||
private $pending = [];
|
private $pending = [];
|
||||||
public $nextRead;
|
public $nextRead;
|
||||||
|
public $size;
|
||||||
public function write(string $data, int $offset)
|
public function write(string $data, int $offset)
|
||||||
{
|
{
|
||||||
if (isset($this->pending[$offset])) {
|
if (isset($this->pending[$offset])) {
|
||||||
@ -325,11 +326,14 @@ trait Files
|
|||||||
}
|
}
|
||||||
$this->pending[$offset] = new Deferred;
|
$this->pending[$offset] = new Deferred;
|
||||||
$res = $this->pending[$offset]->promise();
|
$res = $this->pending[$offset]->promise();
|
||||||
|
if ($offset + $size >= $this->size) {
|
||||||
|
$this->nextRead->resolve(true);
|
||||||
|
}
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$bridge->nextRead = new Deferred;
|
$bridge->nextRead = new Deferred;
|
||||||
|
$bridge->size = $size;
|
||||||
$reader = [$bridge, 'read'];
|
$reader = [$bridge, 'read'];
|
||||||
$writer = [$bridge, 'write'];
|
$writer = [$bridge, 'write'];
|
||||||
yield $this->all([
|
yield $this->all([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user