diff --git a/docs/makefile b/docs/makefile index ed5192c3f..3147fc895 100644 --- a/docs/makefile +++ b/docs/makefile @@ -70,8 +70,8 @@ $(REFERENCE_TARGETS:=.rst):gen_reference_doc.py ../include/libtorrent/*.hpp ../i rst2pdf $? -o $@ --stylesheets stylesheet %.html:%.rst - rst2html-2.6.py --template=template.txt --stylesheet-path=style.css --link-stylesheet --no-toc-backlinks $? > $@ - rst2html-2.6.py --template=template2.txt --stylesheet-path=style.css --link-stylesheet --no-toc-backlinks $? > $(WEB_PATH)/$@ + rst2html.py --template=template.txt --stylesheet-path=style.css --link-stylesheet --no-toc-backlinks $? > $@ + rst2html.py --template=template2.txt --stylesheet-path=style.css --link-stylesheet --no-toc-backlinks $? > $(WEB_PATH)/$@ %.png:%.dot dot -Tpng $? >$@ diff --git a/docs/manual-ref.html b/docs/manual-ref.html index 565990d5f..0862eb82b 100644 --- a/docs/manual-ref.html +++ b/docs/manual-ref.html @@ -826,7 +826,9 @@ able to do download blocks from the same piece, concentrating slow peers on as few pieces as possible. The reverse order means that the most common pieces are picked, instead of the rarest pieces (or in the case of sequential download, the last pieces, intead of the first).

-

parole mode -----------

+ +
+

parole mode

Peers that have participated in a piece that failed the hash check, may be put in parole mode. This means we prefer downloading a full piece from this peer, in order to distinguish which peer is sending corrupt data. Whether to do @@ -834,7 +836,9 @@ this is or not is controlled by +

prioritize partial pieces

This setting determines if partially downloaded or requested pieces should always be preferred over other pieces. The benefit of doing this is that the number of partial pieces is minimized (and hence the turn-around time for @@ -850,7 +854,9 @@ of the swarm.

in the piece picker exceeds the number of peers we're connected to times 1.5. This is in order to keep the waste of partial pieces to a minimum, but still prefer rarest pieces.

-

prefer whole pieces -------------------

+
+
+

prefer whole pieces

The prefer whole pieces setting makes the piece picker prefer picking entire pieces at a time. This is used by web connections (both http seeding standards), in order to be able to coalesce the small bittorrent requests to diff --git a/docs/manual.rst b/docs/manual.rst index 74099fdf2..a84bcb9fd 100644 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -717,7 +717,8 @@ few pieces as possible. The reverse order means that the most common pieces are picked, instead of the rarest pieces (or in the case of sequential download, the last pieces, intead of the first). -parole mode ----------- +parole mode +----------- Peers that have participated in a piece that failed the hash check, may be put in *parole mode*. This means we prefer downloading a full piece from this @@ -728,7 +729,8 @@ In parole mode, the piece picker prefers picking one whole piece at a time for a given peer, avoiding picking any blocks from a piece any other peer has contributed to (since that would defeat the purpose of parole mode). -prioritize partial pieces ------------------------- +prioritize partial pieces +------------------------- This setting determines if partially downloaded or requested pieces should always be preferred over other pieces. The benefit of doing this is that the @@ -748,7 +750,8 @@ in the piece picker exceeds the number of peers we're connected to times 1.5. This is in order to keep the waste of partial pieces to a minimum, but still prefer rarest pieces. -prefer whole pieces ------------------- +prefer whole pieces +------------------- The *prefer whole pieces* setting makes the piece picker prefer picking entire pieces at a time. This is used by web connections (both http seeding diff --git a/docs/reference-Core.html b/docs/reference-Core.html index bbee35336..033f70daf 100644 --- a/docs/reference-Core.html +++ b/docs/reference-Core.html @@ -55,16 +55,16 @@

Table of contents

@@ -1073,6 +1073,7 @@ struct torrent_handle torrent_status status (boost::uint32_t flags = 0xffffffff) const; void get_download_queue (std::vector<partial_piece_info>& queue) const; void reset_piece_deadline (int index) const; + void clear_piece_deadlines () const; void set_piece_deadline (int index, int deadline, int flags = 0) const; void set_priority (int prio) const; void file_progress (std::vector<size_type>& progress, int flags = 0) const; @@ -1274,12 +1275,14 @@ void get_download_queue (std::vector<partial_piece_info>& it will fill with information about pieces that are partially downloaded or not downloaded at all but partially requested. See partial_piece_info for the fields in the returned vector.

+
-
-

reset_piece_deadline() set_piece_deadline()

+
+

clear_piece_deadlines() reset_piece_deadline() set_piece_deadline()

 void reset_piece_deadline (int index) const;
+void clear_piece_deadlines () const;
 void set_piece_deadline (int index, int deadline, int flags = 0) const;
 

This function sets or resets the deadline associated with a specific @@ -1301,6 +1304,8 @@ completed.

reset_piece_deadline removes the deadline from the piece. If it hasn't already been downloaded, it will no longer be considered a priority.

+

clear_piece_deadlines() removes deadlines on all pieces in +the torrent. As if reset_piece_deadline() was called on all pieces.

set_priority()

@@ -2391,7 +2396,7 @@ struct torrent_status sha1_hash info_hash; }; -
+

operator==()

 bool operator== (torrent_status const& st) const;
@@ -2399,7 +2404,7 @@ bool operator== (torrent_status const& st) const;
 

compres if the torrent status objects come from the same torrent. i.e. only the torrent_handle field is compared.

-
+

enum state_t

Declared in "libtorrent/torrent_handle.hpp"

@@ -2949,7 +2954,7 @@ allowed to force another tracker update with this tracker.

If the last time this tracker was contacted failed, last_error is the error code describing what error occurred.

-
+

reset()

 void reset ();
@@ -3165,7 +3170,7 @@ class torrent_info : public intrusive_ptr_base<torrent_info>
    bool is_merkle_torrent () const;
 };
 
-
+

torrent_info()

 torrent_info (std::string const& filename, int flags = 0);
@@ -3197,7 +3202,7 @@ always throw if an error occurs. These overloads are not available when building
 exception support.

The flags argument is currently unused.

-
+

~torrent_info()

 ~torrent_info ();
@@ -3222,7 +3227,7 @@ names. Filename may be chaged using file_storage object, see the separate document on how
 to create torrents.

-
+

rename_file()

 void rename_file (int index, std::string const& new_filename);
@@ -3307,7 +3312,7 @@ the piece index as argument and gives you the exact size of that piece. It will
 be the same as piece_length() except in the case of the last piece, which may
 be smaller.

-
+

info_hash()

 const sha1_hash& info_hash () const;
@@ -3354,7 +3359,7 @@ std::string ssl_cert () const;
 torrent. Otherwise returns an empty string. The certificate is
 the the public certificate in x509 format.

-
+

is_valid()

 bool is_valid () const;
@@ -3467,7 +3472,7 @@ lazy_entry const* info (char const* key) const;
 It can be used to access extension values put in the .torrent file. If the specified
 key cannot be found, it returns NULL.

-
+

swap()

 void swap (torrent_info& ti);
diff --git a/docs/reference-Plugins.html b/docs/reference-Plugins.html
index 1ac2b8bd7..fad193594 100644
--- a/docs/reference-Plugins.html
+++ b/docs/reference-Plugins.html
@@ -57,9 +57,9 @@
 
 

libtorrent has a plugin interface for implementing extensions to the protocol. @@ -175,6 +175,7 @@ struct plugin virtual void added (aux::session_impl*); virtual void on_alert (alert const*); virtual void on_tick (); + virtual bool on_optimistic_unchoke (std::vector<policy::peer*>& /* peers */); virtual void save_state (entry&) const; virtual void load_state (lazy_entry const&); }; @@ -214,6 +215,18 @@ posted

virtual void on_tick ();

called once per second

+
+
+

on_optimistic_unchoke()

+
+virtual bool on_optimistic_unchoke (std::vector<policy::peer*>& /* peers */);
+
+

called when choosing peers to optimisticly unchoke +peer's will be unchoked in the order they appear in the given +vector which is initiallity sorted by when they were last +optimistically unchoked. +if the plugin returns true then the ordering provided will be +used and no other plugin will be allowed to change it.

save_state()

@@ -374,6 +387,7 @@ struct peer_plugin virtual bool on_suggest (int /*index*/); virtual bool on_cancel (peer_request const&); virtual bool on_dont_have (int /*index*/); + virtual void sent_unchoke (); virtual bool can_disconnect (error_code const& /*ec*/); virtual bool on_extended (int /*length*/, int /*msg*/, buffer::const_interval /*body*/); @@ -478,6 +492,13 @@ indicates that the plugin chain traversing and not let anyone else handle the message, including the default handler.

+
+
+

sent_unchoke()

+
+virtual void sent_unchoke ();
+
+

called after a choke message has been sent to the peer

can_disconnect()

@@ -508,7 +529,7 @@ virtual bool on_unknown_message (int /*length*/, int <

this is not called for web seeds

-
+

on_piece_failed() on_piece_pass()

 virtual void on_piece_pass (int /*index*/);
@@ -517,7 +538,7 @@ virtual void on_piece_failed (int /*index*/);
 

called when a piece that this peer participated in either fails or passes the hash_check

-
+

tick()

 virtual void tick ();
diff --git a/docs/reference-Settings.html b/docs/reference-Settings.html
index c555e40d4..1741517e3 100644
--- a/docs/reference-Settings.html
+++ b/docs/reference-Settings.html
@@ -330,6 +330,8 @@ struct session_settings
    bool report_redundant_bytes;
    std::string handshake_client_version;
    bool use_disk_cache_pool;
+   int inactive_down_rate;
+   int inactive_up_rate;
 };
 
@@ -1731,6 +1733,16 @@ blocks. Enabling this improves performance of the disk cache with the side effect that the disk cache is less likely and slower at returning memory to the kernel when cache pressure is low. + +
+
inactive_down_rate inactive_up_rate
+
the download and upload rate limits for a torrent to be considered +active by the queuing mechanism. A torrent whose download rate is less +than inactive_down_rate and whose upload rate is less than +inactive_up_rate for auto_manage_startup seconds, is +considered inactive, and another queued torrent may be startert. +This logic is disabled if dont_count_slow_torrents is false.
+
diff --git a/docs/todo.html b/docs/todo.html index 9186c452e..49b1f1bee 100644 --- a/docs/todo.html +++ b/docs/todo.html @@ -24,7 +24,7 @@ 2 important 6 relevant 13 feasible -46 notes +45 notes
relevance 4../src/session_impl.cpp:666in order to support SSL over uTP, the utp_socket manager either needs to be able to receive packets on multiple ports, or we need to peek into the first few bytes the payload stream of a socket to determine whether or not it's an SSL connection. (The former is simpler but won't do as well with NATs)
relevance 3../src/torrent.cpp:6151if peer is a really good peer, maybe we shouldn't disconnect it
relevance 3../src/torrent.cpp:6170if peer is a really good peer, maybe we shouldn't disconnect it
relevance 2../src/torrent.cpp:635post alert
relevance 1../src/session_impl.cpp:5552report the proper address of the router as the source IP of this understanding of our external address, instead of the empty address
relevance 1../src/session_impl.cpp:5544report the proper address of the router as the source IP of this understanding of our external address, instead of the empty address
relevance 1../src/session_impl.cpp:6341we only need to do this if our global IPv4 address has changed since the DHT (currently) only supports IPv4. Since restarting the DHT is kind of expensive, it would be nice to not do it unnecessarily
relevance 1../src/session_impl.cpp:6333we only need to do this if our global IPv4 address has changed since the DHT (currently) only supports IPv4. Since restarting the DHT is kind of expensive, it would be nice to not do it unnecessarily
relevance 1../src/torrent.cpp:1030make this depend on the error and on the filesystem the files are being downloaded to. If the error is no_space_left_on_device and the filesystem doesn't support sparse files, only zero the priorities of the pieces that are at the tails of all files, leaving everything up to the highest written piece in each file
relevance 1../src/torrent.cpp:1032make this depend on the error and on the filesystem the files are being downloaded to. If the error is no_space_left_on_device and the filesystem doesn't support sparse files, only zero the priorities of the pieces that are at the tails of all files, leaving everything up to the highest written piece in each file
relevance 1../src/torrent.cpp:5412save the send_stats state instead of throwing them away it may pose an issue when downgrading though
relevance 1../src/torrent.cpp:5431save the send_stats state instead of throwing them away it may pose an issue when downgrading though
relevance 1../src/torrent.cpp:6319should disconnect all peers that have the pieces we have not just seeds. It would be pretty expensive to check all pieces for all peers though
relevance 1../src/torrent.cpp:6338should disconnect all peers that have the pieces we have not just seeds. It would be pretty expensive to check all pieces for all peers though
relevance 0../src/bt_peer_connection.cpp:3356move the erasing into the loop above remove all payload ranges that has been sent
relevance 0../src/bt_peer_connection.cpp:3364move the erasing into the loop above remove all payload ranges that has been sent
relevance 0../src/session_impl.cpp:4299allow extensions to sort torrents for queuing
relevance 0../src/session_impl.cpp:4464use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections
relevance 0../src/session_impl.cpp:4507also take average_peers into account, to create a bias for downloading torrents with < average peers
relevance 0../src/session_impl.cpp:4498make this bias configurable
relevance 0../src/session_impl.cpp:4499also take average_peers into account, to create a bias for downloading torrents with < average peers
relevance 0../src/session_impl.cpp:4609post a message to have this happen immediately instead of waiting for the next tick
relevance 0../src/session_impl.cpp:4651make configurable
relevance 0../src/session_impl.cpp:4643make configurable
relevance 0../src/session_impl.cpp:4665make configurable
relevance 0../src/session_impl.cpp:4657make configurable
relevance 0../src/torrent.cpp:1232is verify_peer_cert called once per certificate in the chain, and this function just tells us which depth we're at right now? If so, the comment makes sense. any certificate that isn't the leaf (i.e. the one presented by the peer) should be accepted automatically, given preverified is true. The leaf certificate need to be verified to make sure its DN matches the info-hash
relevance 0../src/torrent.cpp:1234is verify_peer_cert called once per certificate in the chain, and this function just tells us which depth we're at right now? If so, the comment makes sense. any certificate that isn't the leaf (i.e. the one presented by the peer) should be accepted automatically, given preverified is true. The leaf certificate need to be verified to make sure its DN matches the info-hash
relevance 0../src/torrent.cpp:5145make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance maybe use the same format as .torrent files and reuse some code from torrent_info The mapped_files needs to be read both in the network thread and in the disk thread, since they both have their own mapped files structures which are kept in sync
relevance 0../src/torrent.cpp:5164make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance maybe use the same format as .torrent files and reuse some code from torrent_info The mapped_files needs to be read both in the network thread and in the disk thread, since they both have their own mapped files structures which are kept in sync
relevance 0../src/torrent.cpp:5300if this is a merkle torrent and we can't restore the tree, we need to wipe all the bits in the have array, but not necessarily we might want to do a full check to see if we have all the pieces. This is low priority since almost no one uses merkle torrents
relevance 0../src/torrent.cpp:5469make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance. using file_base
relevance 0../src/torrent.cpp:5488make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance. using file_base
relevance 0../src/torrent.cpp:8073go through the pieces we have and count the total number of downloaders we have. Only count peers that are interested in us since some peers might not send have messages for pieces we have it num_interested == 0, we need to pick a new piece
relevance 0../include/libtorrent/config.hpp:327Make this count Unicode characters instead of bytes on windows
relevance 0../include/libtorrent/config.hpp:333Make this count Unicode characters instead of bytes on windows
relevance 0../include/libtorrent/torrent.hpp:1336there's space for another bit here
relevance 0../include/libtorrent/torrent_info.hpp:123include the number of peers received from this tracker, at last announce
relevance 0../include/libtorrent/torrent_info.hpp:123include the number of peers received from this tracker, at last announce
relevance 0../include/libtorrent/upnp.hpp:108support using the windows API for UPnP operations as well
relevance 0../include/libtorrent/upnp.hpp:108support using the windows API for UPnP operations as well
relevance 0../include/libtorrent/utp_stream.hpp:378implement blocking write. Low priority since it's not used (yet)
relevance 0../include/libtorrent/utp_stream.hpp:378implement blocking write. Low priority since it's not used (yet)
relevance 0../include/libtorrent/kademlia/item.hpp:61since this is a public function, it should probably be moved out of this header and into one with other public functions.
relevance 0../include/libtorrent/kademlia/item.hpp:61since this is a public function, it should probably be moved out of this header and into one with other public functions.