extensions
@@ -549,7 +550,11 @@ versions is the payload download only.
total_download and total_upload are the total number of bytes downloaded and
uploaded to and from all torrents. total_payload_download and total_payload_upload
are the same thing but where only the payload is considered.
-
num_peers is the total number of peer connections this session have.
+
num_peers is the total number of peer connections this session has. This includes
+incoming connections that still hasn't sent their handshake or outgoing connections
+that still hasn't completed the TCP connection. This number may be slightly higher
+than the sum of all peers of all torrents because the incoming connections may not
+be assigned a torrent yet.
dht_nodes, dht_cache_nodes and dht_torrents are only available when
built with DHT support. They are all set to 0 if the DHT isn't running. When
the DHT is running, dht_nodes is set to the number of nodes in the routing
@@ -951,18 +956,18 @@ public:
typedef std::vector<file_entry>::const_reverse_iterator
reverse_file_iterator;
- file_iterator begin_files() const;
- file_iterator end_files() const;
- reverse_file_iterator rbegin_files() const;
- reverse_file_iterator rend_files() const;
+ file_iterator begin_files(bool storage = false) const;
+ file_iterator end_files(bool storage = false) const;
+ reverse_file_iterator rbegin_files(bool storage = false) const;
+ reverse_file_iterator rend_files(bool storage = false) const;
- int num_files() const;
- file_entry const& file_at(int index) const;
+ int num_files(bool storage = false) const;
+ file_entry const& file_at(int index, bool storage = false) const;
std::vector<file_slice> map_block(int piece, size_type offset
- , int size) const;
+ , int size, bool storage = false) const;
peer_request map_file(int file_index, size_type file_offset
- , int size) const;
+ , int size, bool storage = false) const;
std::vector<announce_entry> const& trackers() const;
@@ -1064,19 +1069,48 @@ object.
least one tracker url or at least one DHT node.
+
+
+
+bool remap_files(std::vector<std::string, libtorrent::size_type> const& map);
+
+
+
This call will create a new mapping of the data in this torrent to other files. The
+torrent_info maintains 2 views of the file storage. One that is true to the torrent
+file, and one that represents what is actually saved on disk. This call will change
+what the files on disk are called.
+
The return value indicates if the remap was successful or not. True means success and
+false means failure. The only reason for failure is if the sum of all the files passed
+in through map has to be exactly the same as the total_size of the torrent.
+
+
-file_iterator begin_files() const;
-file_iterator end_files() const;
-reverse_file_iterator rbegin_files() const;
-reverse_file_iterator rend_files() const;
+file_iterator begin_files(bool storage = false) const;
+file_iterator end_files(bool storage = false) const;
+reverse_file_iterator rbegin_files(bool storage = false) const;
+reverse_file_iterator rend_files(bool storage = false) const;
This class will need some explanation. First of all, to get a list of all files
in the torrent, you can use begin_files(), end_files(),
rbegin_files() and rend_files(). These will give you standard vector
iterators with the type file_entry.
+
The storage parameter specifies which view of the files you want. The default
+is false, which means you will see the content of the torrent file. If set to
+true, you will see the file that the storage class uses to save the files to
+disk. Typically these views are the same, but in case the files have been
+remapped, they may differ. For more info, see remap_files().
+
+struct file_entry
+{
+ boost::filesystem::path path;
+ size_type offset;
+ size_type size;
+ boost::shared_ptr<const boost::filesystem::path> orig_path;
+};
+
The path is the full (relative) path of each file. i.e. if it is a multi-file
torrent, all the files starts with a directory with the same name as torrent_info::name().
The filenames are encoded with UTF-8.
@@ -1089,33 +1123,29 @@ incorrectly encoded, and had to be fixed in order to be acceptable utf-8,
the original string is preserved in
orig_path. The reason to keep it
is to be able to reproduce the info-section exactly, with the correct
info-hash.
-
-struct file_entry
-{
- boost::filesystem::path path;
- size_type offset;
- size_type size;
- boost::shared_ptr<const boost::filesystem::path> orig_path;
-};
-
-int num_files() const;
-file_entry const& file_at(int index) const;
+int num_files(bool storage = false) const;
+file_entry const& file_at(int index, bool storage = false) const;
If you need index-access to files you can use the num_files() and file_at()
to access files using indices.
+
The storage parameter specifies which view of the files you want. The default
+is false, which means you will see the content of the torrent file. If set to
+true, you will see the file that the storage class uses to save the files to
+disk. Typically these views are the same, but in case the files have been
+remapped, they may differ. For more info, see remap_files().
std::vector<file_slice> map_block(int piece, size_type offset
- , int size) const;
+ , int size, bool storage = false) const;
This function will map a piece index, a byte offset within that piece and
@@ -1135,13 +1165,18 @@ To get the path and filename, use offset is the byte offset in the file where the range
starts, and size is the number of bytes this range is. The size + offset
will never be greater than the file size.
+
The storage parameter specifies which view of the files you want. The default
+is false, which means you will see the content of the torrent file. If set to
+true, you will see the file that the storage class uses to save the files to
+disk. Typically these views are the same, but in case the files have been
+remapped, they may differ. For more info, see remap_files().
peer_request map_file(int file_index, size_type file_offset
- , int size) const;
+ , int size, bool storage = false) const;
This function will map a range in a specific file into a range in the torrent.
@@ -1176,6 +1211,11 @@ void add_url_seed(std::string const& url);
vector of those urls. If you're creating a torrent file, add_url_seed()
adds one url to the list of url-seeds. Currently, the only transport protocol
supported for the url is http.
+
The storage parameter specifies which view of the files you want. The default
+is false, which means you will see the content of the torrent file. If set to
+true, you will see the file that the storage class uses to save the files to
+disk. Typically these views are the same, but in case the files have been
+remapped, they may differ. For more info, see remap_files().
See HTTP seeding for more information.
@@ -1887,6 +1927,13 @@ struct torrent_status
float distributed_copies;
int block_size;
+
+ int num_uploads;
+ int num_connections;
+ int uploads_limit;
+ int connections_limit;
+
+ bool compact_mode;
};
progress is a value in the range [0, 1], that represents the progress of the
@@ -2004,6 +2051,14 @@ is the number of bytes that each piece request asks for and the number of
bytes that each bit in the partial_piece_info's bitset represents
(see get_download_queue()). This is typically 16 kB, but it may be
larger if the pieces are larger.
+
num_uploads is the number of unchoked peers in this torrent.
+
num_connections is the number of peer connections this torrent has, including
+half-open connections that hasn't completed the bittorrent handshake yet. This is
+always <= num_peers.
+
uploads_limit is the set limit of upload slots (unchoked peers) for this torrent.
+
connections_limit is the set limit of number of connections for this torrent.
+
compact_mode is true if this torrent was started with compact allocation mode
+for its storage. False means it was started in full allocation mode.
diff --git a/docs/manual.rst b/docs/manual.rst
index 6716a08a6..400cde918 100644
--- a/docs/manual.rst
+++ b/docs/manual.rst
@@ -855,18 +855,18 @@ The ``torrent_info`` has the following synopsis::
typedef std::vector
::const_reverse_iterator
reverse_file_iterator;
- file_iterator begin_files() const;
- file_iterator end_files() const;
- reverse_file_iterator rbegin_files() const;
- reverse_file_iterator rend_files() const;
+ file_iterator begin_files(bool storage = false) const;
+ file_iterator end_files(bool storage = false) const;
+ reverse_file_iterator rbegin_files(bool storage = false) const;
+ reverse_file_iterator rend_files(bool storage = false) const;
- int num_files() const;
- file_entry const& file_at(int index) const;
+ int num_files(bool storage = false) const;
+ file_entry const& file_at(int index, bool storage = false) const;
std::vector map_block(int piece, size_type offset
- , int size) const;
+ , int size, bool storage = false) const;
peer_request map_file(int file_index, size_type file_offset
- , int size) const;
+ , int size, bool storage = false) const;
std::vector const& trackers() const;
@@ -982,21 +982,54 @@ Note that a torrent file must include at least one file, and it must have at
least one tracker url or at least one DHT node.
+remap_files()
+-------------
+
+ ::
+
+ bool remap_files(std::vector const& map);
+
+This call will create a new mapping of the data in this torrent to other files. The
+``torrent_info`` maintains 2 views of the file storage. One that is true to the torrent
+file, and one that represents what is actually saved on disk. This call will change
+what the files on disk are called.
+
+The return value indicates if the remap was successful or not. True means success and
+false means failure. The only reason for failure is if the sum of all the files passed
+in through ``map`` has to be exactly the same as the total_size of the torrent.
+
+
begin_files() end_files() rbegin_files() rend_files()
-----------------------------------------------------
::
- file_iterator begin_files() const;
- file_iterator end_files() const;
- reverse_file_iterator rbegin_files() const;
- reverse_file_iterator rend_files() const;
+ file_iterator begin_files(bool storage = false) const;
+ file_iterator end_files(bool storage = false) const;
+ reverse_file_iterator rbegin_files(bool storage = false) const;
+ reverse_file_iterator rend_files(bool storage = false) const;
This class will need some explanation. First of all, to get a list of all files
in the torrent, you can use ``begin_files()``, ``end_files()``,
``rbegin_files()`` and ``rend_files()``. These will give you standard vector
iterators with the type ``file_entry``.
+The ``storage`` parameter specifies which view of the files you want. The default
+is false, which means you will see the content of the torrent file. If set to
+true, you will see the file that the storage class uses to save the files to
+disk. Typically these views are the same, but in case the files have been
+remapped, they may differ. For more info, see `remap_files()`_.
+
+::
+
+ struct file_entry
+ {
+ boost::filesystem::path path;
+ size_type offset;
+ size_type size;
+ boost::shared_ptr orig_path;
+ };
+
The ``path`` is the full (relative) path of each file. i.e. if it is a multi-file
torrent, all the files starts with a directory with the same name as ``torrent_info::name()``.
The filenames are encoded with UTF-8.
@@ -1012,15 +1045,6 @@ the original string is preserved in ``orig_path``. The reason to keep it
is to be able to reproduce the info-section exactly, with the correct
info-hash.
-::
-
- struct file_entry
- {
- boost::filesystem::path path;
- size_type offset;
- size_type size;
- boost::shared_ptr orig_path;
- };
num_files() file_at()
@@ -1028,20 +1052,27 @@ num_files() file_at()
::
- int num_files() const;
- file_entry const& file_at(int index) const;
+ int num_files(bool storage = false) const;
+ file_entry const& file_at(int index, bool storage = false) const;
If you need index-access to files you can use the ``num_files()`` and ``file_at()``
to access files using indices.
+The ``storage`` parameter specifies which view of the files you want. The default
+is false, which means you will see the content of the torrent file. If set to
+true, you will see the file that the storage class uses to save the files to
+disk. Typically these views are the same, but in case the files have been
+remapped, they may differ. For more info, see `remap_files()`_.
+
+
map_block()
-----------
::
std::vector map_block(int piece, size_type offset
- , int size) const;
+ , int size, bool storage = false) const;
This function will map a piece index, a byte offset within that piece and
a size (in bytes) into the corresponding files with offsets where that data
@@ -1063,6 +1094,12 @@ as argument. The ``offset`` is the byte offset in the file where the range
starts, and ``size`` is the number of bytes this range is. The size + offset
will never be greater than the file size.
+The ``storage`` parameter specifies which view of the files you want. The default
+is false, which means you will see the content of the torrent file. If set to
+true, you will see the file that the storage class uses to save the files to
+disk. Typically these views are the same, but in case the files have been
+remapped, they may differ. For more info, see `remap_files()`_.
+
map_file()
----------
@@ -1070,7 +1107,7 @@ map_file()
::
peer_request map_file(int file_index, size_type file_offset
- , int size) const;
+ , int size, bool storage = false) const;
This function will map a range in a specific file into a range in the torrent.
The ``file_offset`` parameter is the offset in the file, given in bytes, where
@@ -1107,6 +1144,12 @@ vector of those urls. If you're creating a torrent file, ``add_url_seed()``
adds one url to the list of url-seeds. Currently, the only transport protocol
supported for the url is http.
+The ``storage`` parameter specifies which view of the files you want. The default
+is false, which means you will see the content of the torrent file. If set to
+true, you will see the file that the storage class uses to save the files to
+disk. Typically these views are the same, but in case the files have been
+remapped, they may differ. For more info, see `remap_files()`_.
+
See `HTTP seeding`_ for more information.
diff --git a/include/libtorrent/torrent_info.hpp b/include/libtorrent/torrent_info.hpp
index a2d6c4ef9..795289bf4 100755
--- a/include/libtorrent/torrent_info.hpp
+++ b/include/libtorrent/torrent_info.hpp
@@ -71,7 +71,7 @@ namespace libtorrent
size_type offset; // the offset of this file inside the torrent
size_type size; // the size of this file
// if the path was incorrectly encoded, this is
- // the origianal corrupt encoded string. It is
+ // the original corrupt encoded string. It is
// preserved in order to be able to reproduce
// the correct info-hash
boost::shared_ptr orig_path;
@@ -115,8 +115,12 @@ namespace libtorrent
void add_file(fs::path file, size_type size);
void add_url_seed(std::string const& url);
- std::vector map_block(int piece, size_type offset, int size) const;
- peer_request map_file(int file, size_type offset, int size) const;
+ bool remap_files(std::vector > const& map);
+
+ std::vector map_block(int piece, size_type offset
+ , int size, bool storage = false) const;
+ peer_request map_file(int file, size_type offset, int size
+ , bool storage = false) const;
std::vector const& url_seeds() const
{
@@ -128,15 +132,60 @@ namespace libtorrent
typedef std::vector::const_reverse_iterator reverse_file_iterator;
// list the files in the torrent file
- file_iterator begin_files() const { return m_files.begin(); }
- file_iterator end_files() const { return m_files.end(); }
- reverse_file_iterator rbegin_files() const { return m_files.rbegin(); }
- reverse_file_iterator rend_files() const { return m_files.rend(); }
+ file_iterator begin_files(bool storage = false) const
+ {
+ if (!storage || m_remapped_files.empty())
+ return m_files.begin();
+ else
+ return m_remapped_files.begin();
+ }
- int num_files() const
- { assert(m_piece_length > 0); return (int)m_files.size(); }
- const file_entry& file_at(int index) const
- { assert(index >= 0 && index < (int)m_files.size()); return m_files[index]; }
+ file_iterator end_files(bool storage = false) const
+ {
+ if (!storage || m_remapped_files.empty())
+ return m_files.end();
+ else
+ return m_remapped_files.end();
+ }
+
+ reverse_file_iterator rbegin_files(bool storage = false) const
+ {
+ if (!storage || m_remapped_files.empty())
+ return m_files.rbegin();
+ else
+ return m_remapped_files.rbegin();
+ }
+
+ reverse_file_iterator rend_files(bool storage = false) const
+ {
+ if (!storage || m_remapped_files.empty())
+ return m_files.rend();
+ else
+ return m_remapped_files.rend();
+ }
+
+ int num_files(bool storage = false) const
+ {
+ assert(m_piece_length > 0);
+ if (!storage || m_remapped_files.empty())
+ return (int)m_files.size();
+ else
+ return (int)m_remapped_files.size();
+ }
+
+ const file_entry& file_at(int index, bool storage = false) const
+ {
+ if (!storage || m_remapped_files.empty())
+ {
+ assert(index >= 0 && index < (int)m_files.size());
+ return m_files[index];
+ }
+ else
+ {
+ assert(index >= 0 && index < (int)m_remapped_files.size());
+ return m_remapped_files[index];
+ }
+ }
const std::vector& trackers() const { return m_urls; }
@@ -218,6 +267,13 @@ namespace libtorrent
// the list of files that this torrent consists of
std::vector m_files;
+ // this vector is typically empty. If it is not
+ // empty, it means the user has re-mapped the
+ // files in this torrent to diffefrent names
+ // on disk. This is only used when reading and
+ // writing the disk.
+ std::vector m_remapped_files;
+
nodes_t m_nodes;
// the sum of all filesizes
diff --git a/src/storage.cpp b/src/storage.cpp
index 40efff02c..64f601927 100755
--- a/src/storage.cpp
+++ b/src/storage.cpp
@@ -247,8 +247,8 @@ namespace libtorrent
{
p = complete(p);
std::vector > sizes;
- for (torrent_info::file_iterator i = t.begin_files();
- i != t.end_files(); ++i)
+ for (torrent_info::file_iterator i = t.begin_files(true);
+ i != t.end_files(true); ++i)
{
size_type size = 0;
std::time_t time = 0;
@@ -287,7 +287,7 @@ namespace libtorrent
, bool compact_mode
, std::string* error)
{
- if ((int)sizes.size() != t.num_files())
+ if ((int)sizes.size() != t.num_files(true))
{
if (error) *error = "mismatching number of files";
return false;
@@ -296,8 +296,8 @@ namespace libtorrent
std::vector >::const_iterator s
= sizes.begin();
- for (torrent_info::file_iterator i = t.begin_files();
- i != t.end_files(); ++i, ++s)
+ for (torrent_info::file_iterator i = t.begin_files(true);
+ i != t.end_files(true); ++i, ++s)
{
size_type size = 0;
std::time_t time = 0;
@@ -349,7 +349,7 @@ namespace libtorrent
: m_info(info)
, m_files(fp)
{
- assert(info.begin_files() != info.end_files());
+ assert(info.begin_files(true) != info.end_files(true));
m_save_path = fs::complete(path);
assert(m_save_path.is_complete());
}
@@ -412,8 +412,8 @@ namespace libtorrent
{
// first, create all missing directories
fs::path last_path;
- for (torrent_info::file_iterator file_iter = m_info.begin_files(),
- end_iter = m_info.end_files(); file_iter != end_iter; ++file_iter)
+ for (torrent_info::file_iterator file_iter = m_info.begin_files(true),
+ end_iter = m_info.end_files(true); file_iter != end_iter; ++file_iter)
{
fs::path dir = (m_save_path / file_iter->path).branch_path();
@@ -510,11 +510,11 @@ namespace libtorrent
if (seed)
{
- if (m_info.num_files() != (int)file_sizes.size())
+ if (m_info.num_files(true) != (int)file_sizes.size())
{
error = "the number of files does not match the torrent (num: "
+ boost::lexical_cast(file_sizes.size()) + " actual: "
- + boost::lexical_cast(m_info.num_files()) + ")";
+ + boost::lexical_cast(m_info.num_files(true)) + ")";
return false;
}
@@ -522,8 +522,8 @@ namespace libtorrent
fs = file_sizes.begin();
// the resume data says we have the entire torrent
// make sure the file sizes are the right ones
- for (torrent_info::file_iterator i = m_info.begin_files()
- , end(m_info.end_files()); i != end; ++i, ++fs)
+ for (torrent_info::file_iterator i = m_info.begin_files(true)
+ , end(m_info.end_files(true)); i != end; ++i, ++fs)
{
if (i->size != fs->first)
{
@@ -688,7 +688,7 @@ namespace libtorrent
#ifndef NDEBUG
std::vector slices
- = m_info.map_block(slot, offset, size);
+ = m_info.map_block(slot, offset, size, true);
assert(!slices.empty());
#endif
@@ -699,7 +699,7 @@ namespace libtorrent
size_type file_offset = start;
std::vector::const_iterator file_iter;
- for (file_iter = m_info.begin_files();;)
+ for (file_iter = m_info.begin_files(true);;)
{
if (file_offset < file_iter->size)
break;
@@ -757,7 +757,7 @@ namespace libtorrent
assert(int(slices.size()) > counter);
size_type slice_size = slices[counter].size;
assert(slice_size == read_bytes);
- assert(m_info.file_at(slices[counter].file_index).path
+ assert(m_info.file_at(slices[counter].file_index, true).path
== file_iter->path);
#endif
@@ -813,7 +813,7 @@ namespace libtorrent
#ifndef NDEBUG
std::vector slices
- = m_info.map_block(slot, offset, size);
+ = m_info.map_block(slot, offset, size, true);
assert(!slices.empty());
#endif
@@ -823,14 +823,14 @@ namespace libtorrent
size_type file_offset = start;
std::vector::const_iterator file_iter;
- for (file_iter = m_info.begin_files();;)
+ for (file_iter = m_info.begin_files(true);;)
{
if (file_offset < file_iter->size)
break;
file_offset -= file_iter->size;
++file_iter;
- assert(file_iter != m_info.end_files());
+ assert(file_iter != m_info.end_files(true));
}
fs::path p(m_save_path / file_iter->path);
@@ -874,7 +874,7 @@ namespace libtorrent
{
assert(int(slices.size()) > counter);
assert(slices[counter].size == write_bytes);
- assert(m_info.file_at(slices[counter].file_index).path
+ assert(m_info.file_at(slices[counter].file_index, true).path
== file_iter->path);
assert(buf_pos >= 0);
@@ -902,7 +902,7 @@ namespace libtorrent
#endif
++file_iter;
- assert(file_iter != m_info.end_files());
+ assert(file_iter != m_info.end_files(true));
fs::path p = m_save_path / file_iter->path;
file_offset = 0;
out = m_files.open_file(
@@ -1866,8 +1866,8 @@ namespace libtorrent
// find the file that failed, and skip all the blocks in that file
size_type file_offset = 0;
size_type current_offset = m_current_slot * m_info.piece_length();
- for (torrent_info::file_iterator i = m_info.begin_files();
- i != m_info.end_files(); ++i)
+ for (torrent_info::file_iterator i = m_info.begin_files(true);
+ i != m_info.end_files(true); ++i)
{
file_offset += i->size;
if (file_offset > current_offset) break;
diff --git a/src/torrent_info.cpp b/src/torrent_info.cpp
index e43f3f297..76c10e572 100755
--- a/src/torrent_info.cpp
+++ b/src/torrent_info.cpp
@@ -824,8 +824,33 @@ 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) const
+ , int size, bool storage) const
{
assert(num_files() > 0);
std::vector ret;
@@ -839,9 +864,9 @@ namespace libtorrent
std::vector::const_iterator file_iter;
int counter = 0;
- for (file_iter = begin_files();; ++counter, ++file_iter)
+ for (file_iter = begin_files(storage);; ++counter, ++file_iter)
{
- assert(file_iter != end_files());
+ assert(file_iter != end_files(storage));
if (file_offset < file_iter->size)
{
file_slice f;
@@ -862,11 +887,11 @@ namespace libtorrent
}
peer_request torrent_info::map_file(int file_index, size_type file_offset
- , int size) const
+ , int size, bool storage) const
{
- assert(file_index < (int)m_files.size());
+ assert(file_index < num_files(storage));
assert(file_index >= 0);
- size_type offset = file_offset + m_files[file_index].offset;
+ size_type offset = file_offset + file_at(file_index, storage).offset;
peer_request ret;
ret.piece = offset / piece_length();
diff --git a/test/test_storage.cpp b/test/test_storage.cpp
index 447017af6..1c672bdfe 100644
--- a/test/test_storage.cpp
+++ b/test/test_storage.cpp
@@ -142,12 +142,31 @@ int test_main()
run_storage_tests(info);
// make sure the files have the correct size
+ std::cerr << file_size(initial_path() / "temp_storage" / "test1.tmp") << std::endl;
TEST_CHECK(file_size(initial_path() / "temp_storage" / "test1.tmp") == 17);
+ std::cerr << file_size(initial_path() / "temp_storage" / "test2.tmp") << std::endl;
TEST_CHECK(file_size(initial_path() / "temp_storage" / "test2.tmp") == 31);
TEST_CHECK(exists("temp_storage/test3.tmp"));
TEST_CHECK(exists("temp_storage/test4.tmp"));
remove_all(initial_path() / "temp_storage");
+// ==============================================
+
+ // make sure remap_files works
+ std::vector > map;
+ map.push_back(std::make_pair(std::string("temp_storage/test.tmp"), 17 + 612 + 1));
+ bool ret = info.remap_files(map);
+ TEST_CHECK(ret);
+
+ run_storage_tests(info, false);
+
+ std::cerr << file_size(initial_path() / "temp_storage" / "test.tmp") << std::endl;
+ TEST_CHECK(file_size(initial_path() / "temp_storage" / "test.tmp") == 17 + 612 + 1);
+
+ remove_all(initial_path() / "temp_storage");
+
+// ==============================================
+
info = torrent_info();
info.set_piece_size(piece_size);
info.add_file("temp_storage/test1.tmp", 17 + 612 + 1);
@@ -158,6 +177,8 @@ int test_main()
TEST_CHECK(file_size(initial_path() / "temp_storage" / "test1.tmp") == 48);
remove_all(initial_path() / "temp_storage");
+// ==============================================
+
// make sure full allocation mode actually allocates the files
// and creates the directories
run_storage_tests(info, false);