mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-12 11:12:16 +00:00
Fix typo in variable name (#940)
This commit is contained in:
parent
0bcebe8a0e
commit
43ad9947b9
2 changed files with 8 additions and 8 deletions
|
@ -324,7 +324,7 @@ td::Status Torrent::add_piece(td::uint64 piece_i, td::Slice data, td::Ref<vm::Ce
|
||||||
piece_is_ready_[piece_i] = true;
|
piece_is_ready_[piece_i] = true;
|
||||||
ready_parts_count_++;
|
ready_parts_count_++;
|
||||||
|
|
||||||
if (chunks_.empty() || !enabled_wirte_to_files_) {
|
if (chunks_.empty() || !enabled_write_to_files_) {
|
||||||
return add_pending_piece(piece_i, data);
|
return add_pending_piece(piece_i, data);
|
||||||
}
|
}
|
||||||
return add_validated_piece(piece_i, data);
|
return add_validated_piece(piece_i, data);
|
||||||
|
@ -357,7 +357,7 @@ td::Status Torrent::add_pending_piece(td::uint64 piece_i, td::Slice data) {
|
||||||
fatal_error_ = S.clone();
|
fatal_error_ = S.clone();
|
||||||
return S;
|
return S;
|
||||||
}
|
}
|
||||||
if (enabled_wirte_to_files_) {
|
if (enabled_write_to_files_) {
|
||||||
add_pending_pieces();
|
add_pending_pieces();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -367,10 +367,10 @@ td::Status Torrent::add_pending_piece(td::uint64 piece_i, td::Slice data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Torrent::enable_write_to_files() {
|
void Torrent::enable_write_to_files() {
|
||||||
if (enabled_wirte_to_files_) {
|
if (enabled_write_to_files_) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
enabled_wirte_to_files_ = true;
|
enabled_write_to_files_ = true;
|
||||||
if (header_) {
|
if (header_) {
|
||||||
add_pending_pieces();
|
add_pending_pieces();
|
||||||
}
|
}
|
||||||
|
@ -441,7 +441,7 @@ td::Status Torrent::add_validated_piece(td::uint64 piece_i, td::Slice data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Torrent::is_completed() const {
|
bool Torrent::is_completed() const {
|
||||||
return inited_info_ && enabled_wirte_to_files_ && included_ready_size_ == included_size_;
|
return inited_info_ && enabled_write_to_files_ && included_ready_size_ == included_size_;
|
||||||
}
|
}
|
||||||
|
|
||||||
td::Result<td::BufferSlice> Torrent::read_file(td::Slice name) {
|
td::Result<td::BufferSlice> Torrent::read_file(td::Slice name) {
|
||||||
|
@ -488,7 +488,7 @@ Torrent::Torrent(Info info, td::optional<TorrentHeader> header, ton::MerkleTree
|
||||||
, info_(info)
|
, info_(info)
|
||||||
, root_dir_(std::move(root_dir))
|
, root_dir_(std::move(root_dir))
|
||||||
, header_(std::move(header))
|
, header_(std::move(header))
|
||||||
, enabled_wirte_to_files_(true)
|
, enabled_write_to_files_(true)
|
||||||
, merkle_tree_(std::move(tree))
|
, merkle_tree_(std::move(tree))
|
||||||
, piece_is_ready_(info_.pieces_count(), true)
|
, piece_is_ready_(info_.pieces_count(), true)
|
||||||
, ready_parts_count_{info_.pieces_count()}
|
, ready_parts_count_{info_.pieces_count()}
|
||||||
|
@ -586,7 +586,7 @@ void Torrent::set_file_excluded(size_t i, bool excluded) {
|
||||||
included_ready_size_ += chunk.ready_size;
|
included_ready_size_ += chunk.ready_size;
|
||||||
}
|
}
|
||||||
chunk.excluded = excluded;
|
chunk.excluded = excluded;
|
||||||
if (!enabled_wirte_to_files_ || excluded) {
|
if (!enabled_write_to_files_ || excluded) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto range = get_file_parts_range(i);
|
auto range = get_file_parts_range(i);
|
||||||
|
|
|
@ -173,7 +173,7 @@ class Torrent {
|
||||||
size_t not_ready_pending_piece_count_{0};
|
size_t not_ready_pending_piece_count_{0};
|
||||||
size_t header_pieces_count_{0};
|
size_t header_pieces_count_{0};
|
||||||
std::map<td::uint64, td::string> pending_pieces_;
|
std::map<td::uint64, td::string> pending_pieces_;
|
||||||
bool enabled_wirte_to_files_ = false;
|
bool enabled_write_to_files_ = false;
|
||||||
struct InMemoryPiece {
|
struct InMemoryPiece {
|
||||||
std::string data;
|
std::string data;
|
||||||
std::set<size_t> pending_chunks;
|
std::set<size_t> pending_chunks;
|
||||||
|
|
Loading…
Reference in a new issue