mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
A few improvements in storage-daemon-cli interface (#570)
* Pause and resume upload in storage-daemon * Update help * Update LoadSpeed.cpp * Fix json output, prohibit torrents without files Co-authored-by: SpyCheese <mikle98@yandex.ru> Co-authored-by: Andrey Pfau <andreypfau@ton.org>
This commit is contained in:
parent
1a07edfed4
commit
b88eda83fe
4 changed files with 17 additions and 1 deletions
|
@ -100,6 +100,9 @@ td::Status TorrentHeader::validate(td::uint64 total_size, td::uint64 header_size
|
|||
if (serialization_size() != header_size) {
|
||||
return td::Status::Error("Invalid size");
|
||||
}
|
||||
if (files_count == 0) {
|
||||
return td::Status::Error("No files");
|
||||
}
|
||||
for (size_t i = 0; i + 1 < files_count; ++i) {
|
||||
if (name_index[i] > name_index[i + 1]) {
|
||||
return td::Status::Error("Invalid name offset");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue