Improve fileCallback
This commit is contained in:
parent
235aab55e9
commit
3939e113f5
2
docs
2
docs
@ -1 +1 @@
|
|||||||
Subproject commit 4ed3a8447cf21c69322bcdaf149eb3ce0befe8c0
|
Subproject commit de22c3b924011923438ce6e5e60725a51089ab04
|
@ -1205,7 +1205,7 @@ trait Files
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($offset === $end) {
|
if ($offset === $end) {
|
||||||
$cb(100);
|
$cb(100, 0, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$params = [];
|
$params = [];
|
||||||
@ -1235,7 +1235,7 @@ trait Files
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$params) {
|
if (!$params) {
|
||||||
$cb(100);
|
$cb(100, 0, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$count = \count($params);
|
$count = \count($params);
|
||||||
@ -1256,7 +1256,7 @@ trait Files
|
|||||||
$start = \microtime(true);
|
$start = \microtime(true);
|
||||||
$size = yield $this->downloadPart($message_media, $cdn, $datacenter, $old_dc, $ige, $cb, $initParam = \array_shift($params), $callable, $seekable);
|
$size = yield $this->downloadPart($message_media, $cdn, $datacenter, $old_dc, $ige, $cb, $initParam = \array_shift($params), $callable, $seekable);
|
||||||
if ($initParam['part_end_at'] - $initParam['part_start_at'] !== $size) { // Premature end for undefined length files
|
if ($initParam['part_end_at'] - $initParam['part_start_at'] !== $size) { // Premature end for undefined length files
|
||||||
$origCb(100);
|
$origCb(100, 0, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1304,7 +1304,7 @@ trait Files
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($message_media['size'])) {
|
if (!isset($message_media['size'])) {
|
||||||
$origCb(100);
|
$origCb(100, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user