Tweakable part size

This commit is contained in:
Daniil Gentili 2018-10-13 16:06:51 +00:00
parent b4835f595f
commit 52e670d7a5
2 changed files with 6 additions and 3 deletions

View File

@ -56,7 +56,7 @@ class MTProto
/*
const V = 71;
*/
const V = 104;
const V = 105;
const NOT_LOGGED_IN = 0;
const WAITING_CODE = 1;
const WAITING_SIGNUP = -1;
@ -524,6 +524,9 @@ class MTProto
'handler_workers' => 10,
], 'upload' => [
'allow_automatic_upload' => true,
'part_size' => 512*1024,
], 'download' => [
'part_size' => 1024*1024,
], 'pwr' => [
'pwr' => false,
// Need info ?

View File

@ -44,7 +44,7 @@ trait Files
$this->logger->logger('Upload status: '.$percent.'%', \danog\MadelineProto\Logger::NOTICE);
};
}
$part_size = 512 * 1024;
$part_size = $this->settings['upload']['part_size'];
$part_total_num = (int) ceil($file_size / $part_size);
$part_num = 0;
$method = $file_size > 10 * 1024 * 1024 ? 'upload.saveBigFilePart' : 'upload.saveFilePart';
@ -370,7 +370,7 @@ trait Files
$end = $message_media['size'];
}
$size = $end - $offset;
$part_size = 1024 * 1024;
$part_size = $this->settings['download']['part_size'];
$percent = 0;
$datacenter = isset($message_media['InputFileLocation']['dc_id']) ? $message_media['InputFileLocation']['dc_id'] : $this->datacenter->curdc;
if (isset($message_media['key'])) {