fixed python binding typo in session_status and added some more documentation for file_storage

This commit is contained in:
Arvid Norberg 2009-11-11 05:28:28 +00:00
parent ac0f9d8f9c
commit 130c6a9c55
4 changed files with 42 additions and 4 deletions

View File

@ -104,6 +104,7 @@ release 0.14.7
* fixed create_torrent when passing in a path ending with /
* fixed move_storage when source doesn't exist
* fixed DHT state save bug for node-id
* fixed typo in python binding session_status struct
release 0.14.6

View File

@ -210,7 +210,7 @@ void bind_session()
#ifndef TORRENT_DISABLE_DHT
.def_readonly("dht_nodes", &session_status::dht_nodes)
.def_readonly("dht_cache_nodes", &session_status::dht_node_cache)
.def_readonly("dht_node_cache", &session_status::dht_node_cache)
.def_readonly("dht_torrents", &session_status::dht_torrents)
.def_readonly("dht_global_nodes", &session_status::dht_global_nodes)
.def_readonly("active_requests", &session_status::active_requests)

View File

@ -189,6 +189,25 @@ The possible arreibutes are::
attribute_hidden
attribute_executable
add_file
--------
::
void add_file(file_entry const& e);
void add_file(fs::path const& p, size_type size);
Adds a file to the file storage. If more files than one are added,
certain restrictions to their paths apply. In a multi-file file
storage (torrent), all files must share the same root directory.
That is, the first path element of all files must be the same.
This shared path element is also set to the name of the torrent. It
can be changed by calling ``set_name``.
The built in functions to traverse a directory to add files will
make sure this requirement is fulfilled.
create_torrent
==============
@ -272,6 +291,24 @@ generate the flat file, use the bencode() function.
It may be useful to add custom entries to the torrent file before bencoding it
and saving it to disk.
If anything goes wrong during torrent generation, this function will return
an empty ``entry`` structure. You can test for this condition by querying the
type of the entry::
file_storage fs;
// add file ...
create_torrent t(fs);
// add trackers and piece hashes ...
e = t.generate();
if (e.type() == entry::undefined_t)
{
// something went wrong
}
For instance, you cannot generate a torrent with 0 files in it. If you don't add
any files to the ``file_storage``, torrent generation will fail.
set_comment()
-------------

View File

@ -698,7 +698,7 @@ struct has the following members::
int unchoke_counter;
int dht_nodes;
int dht_cache_nodes;
int dht_node_cache;
int dht_torrents;
int dht_global_nodes;
std::vector<dht_lookup> active_requests;
@ -750,11 +750,11 @@ seconds until the next optimistic unchoke change and the start of the next
unchoke interval. These numbers may be reset prematurely if a peer that is
unchoked disconnects or becomes notinterested.
``dht_nodes``, ``dht_cache_nodes`` and ``dht_torrents`` are only available when
``dht_nodes``, ``dht_node_cache`` 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
table. This number only includes *active* nodes, not cache nodes. The
``dht_cache_nodes`` is set to the number of nodes in the node cache. These nodes
``dht_node_cache`` is set to the number of nodes in the node cache. These nodes
are used to replace the regular nodes in the routing table in case any of them
becomes unresponsive.