diff --git a/libtorrent/src/torrent_info.cpp b/libtorrent/src/torrent_info.cpp index 8e427998c..e43f3f297 100755 --- a/libtorrent/src/torrent_info.cpp +++ b/libtorrent/src/torrent_info.cpp @@ -400,9 +400,7 @@ namespace libtorrent { if (i->first == "pieces" || i->first == "piece length" - || i->first == "length" - || i->first == "files" - || i->first == "name") + || i->first == "length") continue; m_extra_info[i->first] = i->second; } @@ -826,33 +824,8 @@ namespace libtorrent m_nodes.push_back(node); } - bool torrent_info::remap_files(std::vector > const& map) - { - typedef std::vector > files_t; - - size_type offset = 0; - m_remapped_files.resize(map.size()); - - for (int i = 0; i < int(map.size()); ++i) - { - file_entry& fe = m_remapped_files[i]; - fe.path = map[i].first; - fe.offset = offset; - fe.size = map[i].second; - offset += fe.size; - } - if (offset != total_size()) - { - m_remapped_files.clear(); - return false; - } - - return true; - } - std::vector torrent_info::map_block(int piece, size_type offset - , int size, bool storage) const + , int size) const { assert(num_files() > 0); std::vector ret; @@ -866,9 +839,9 @@ namespace libtorrent std::vector::const_iterator file_iter; int counter = 0; - for (file_iter = begin_files(storage);; ++counter, ++file_iter) + for (file_iter = begin_files();; ++counter, ++file_iter) { - assert(file_iter != end_files(storage)); + assert(file_iter != end_files()); if (file_offset < file_iter->size) { file_slice f; @@ -889,11 +862,11 @@ namespace libtorrent } peer_request torrent_info::map_file(int file_index, size_type file_offset - , int size, bool storage) const + , int size) const { - assert(file_index < num_files(storage)); + assert(file_index < (int)m_files.size()); assert(file_index >= 0); - size_type offset = file_offset + file_at(file_index, storage).offset; + size_type offset = file_offset + m_files[file_index].offset; peer_request ret; ret.piece = offset / piece_length(); @@ -903,4 +876,3 @@ namespace libtorrent } } -