From 13a9c3c78dced54c512c6d1e38b3b90f68258b79 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 17 Dec 2014 03:50:01 +0000 Subject: [PATCH] we no longer support including file-hashes when creating torrents --- examples/make_torrent.cpp | 6 ------ include/libtorrent/create_torrent.hpp | 14 -------------- src/create_torrent.cpp | 2 -- 3 files changed, 22 deletions(-) diff --git a/examples/make_torrent.cpp b/examples/make_torrent.cpp index 5540fe965..54f3b2c64 100644 --- a/examples/make_torrent.cpp +++ b/examples/make_torrent.cpp @@ -130,9 +130,6 @@ void print_usage() " merkle torrents require client support\n" " the resulting full merkle tree is written to\n" " the specified file\n" - "-f include sha-1 file hashes in the torrent\n" - " this helps supporting mixing sources from\n" - " other networks\n" "-w url adds a web seed to the torrent with\n" " the specified url\n" "-t url adds the specified tracker to the\n" @@ -223,9 +220,6 @@ int main(int argc, char* argv[]) ++i; outfile = argv[i]; break; - case 'f': - flags |= create_torrent::calculate_file_hashes; - break; case 'l': flags |= create_torrent::symlinks; break; diff --git a/include/libtorrent/create_torrent.hpp b/include/libtorrent/create_torrent.hpp index 33b77f21d..e3c8833e7 100644 --- a/include/libtorrent/create_torrent.hpp +++ b/include/libtorrent/create_torrent.hpp @@ -140,12 +140,6 @@ namespace libtorrent // is useful if you need to reconstruct a file hierarchy which contains // symlinks. , symlinks = 8 - - // If this is set, the set_piece_hashes() function will, as it calculates - // the piece hashes, also calculate the file hashes and add those associated - // with each file. Note that unless you use the set_piece_hashes() function, - // this flag will have no effect. - , calculate_file_hashes = 16 }; // The ``piece_size`` is the size of each piece in bytes. It must @@ -277,9 +271,6 @@ namespace libtorrent int piece_length() const { return m_files.piece_length(); } int piece_size(int i) const { return m_files.piece_size(i); } - // internal - bool should_add_file_hashes() const { return m_calculate_file_hashes; } - // This function returns the merkle hash tree, if the torrent was created as a merkle // torrent. The tree is created by ``generate()`` and won't be valid until that function // has been called. When creating a merkle tree torrent, the actual tree itself has to @@ -359,11 +350,6 @@ namespace libtorrent // the torrent file. The full data of the pointed-to // file is still included bool m_include_symlinks:1; - - // this is only used by set_piece_hashes(). It will - // calculate sha1 hashes for each file and add it - // to the file list - bool m_calculate_file_hashes:1; }; namespace detail diff --git a/src/create_torrent.cpp b/src/create_torrent.cpp index 6c9479bc0..cbd4d53e2 100644 --- a/src/create_torrent.cpp +++ b/src/create_torrent.cpp @@ -251,7 +251,6 @@ namespace libtorrent , m_merkle_torrent((flags & merkle) != 0) , m_include_mtime((flags & modification_time) != 0) , m_include_symlinks((flags & symlinks) != 0) - , m_calculate_file_hashes((flags & calculate_file_hashes) != 0) { TORRENT_ASSERT(fs.num_files() > 0); @@ -306,7 +305,6 @@ namespace libtorrent , m_merkle_torrent(ti.is_merkle_torrent()) , m_include_mtime(false) , m_include_symlinks(false) - , m_calculate_file_hashes(false) { TORRENT_ASSERT(ti.is_valid()); if (ti.creation_date()) m_creation_date = *ti.creation_date();