From cd4adae4ed693de0ff9832a7dc78a57c531b72ae Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 2 Feb 2014 09:33:19 +0000 Subject: [PATCH] add and fix some documentation. regenerate html. remove bittorrent_utp as a connection type, there's already a utp_socket flag --- docs/reference-Core.html | 712 +++++++++++++----------- docs/reference-Session.html | 543 +++++++++--------- docs/reference-Settings.html | 68 ++- docs/todo.html | 8 +- include/libtorrent/i2p_stream.hpp | 1 + include/libtorrent/peer_info.hpp | 26 +- include/libtorrent/session_settings.hpp | 7 + src/bt_peer_connection.cpp | 5 +- 8 files changed, 748 insertions(+), 622 deletions(-) diff --git a/docs/reference-Core.html b/docs/reference-Core.html index da7ad9b2b..1c8011d3c 100644 --- a/docs/reference-Core.html +++ b/docs/reference-Core.html @@ -55,16 +55,16 @@

Table of contents

@@ -164,6 +164,7 @@ struct peer_info holepunched, i2p_socket, utp_socket, + ssl_socket, rc4_encrypted, plaintext_encrypted, }; @@ -191,14 +192,13 @@ struct peer_info standard_bittorrent, web_seed, http_seed, - bittorrent_utp, }; - unsigned int flags; + boost::uint32_t flags; int source; char read_state; char write_state; - tcp::endpoint ip; + tcp::endpoint ip; int up_speed; int down_speed; int payload_up_speed; @@ -254,8 +254,8 @@ struct peer_info

Declared in "libtorrent/peer_info.hpp"

--++ @@ -368,6 +368,11 @@ I2P transport. + + + + @@ -487,14 +492,10 @@ up writing buffers to disk before downloading more. - + - - - - @@ -512,9 +513,8 @@ was received.
read_state write_state
-
bitmasks indicating what state this peer -is in with regards to sending and receiving data. The states are declared in the -bw_state enum.
+
bitmasks indicating what state this peer is in with regards to sending +and receiving data. The states are declared in the bw_state enum.
ip
@@ -524,29 +524,26 @@ more info, see the
up_speed down_speed
-
the current upload and download speed -we have to and from this peer (including any protocol messages). -updated about once per second
+
the current upload and download speed we have to and from this peer +(including any protocol messages). updated about once per second
payload_up_speed payload_down_speed
-
The transfer rates -of payload data only -updated about once per second
+
The transfer rates of payload data only updated about once per second
total_download total_upload
-
the total number of bytes downloaded -from and uploaded to this peer. These numbers do not include the protocol chatter, but only -the payload data.
+
the total number of bytes downloaded from and uploaded to this peer. +These numbers do not include the protocol chatter, but only the +payload data.
pid
-
the peer's id as used in the bit torrent protocol. This id can be used to -extract 'fingerprints' from the peer. Sometimes it can tell you which client the peer -is using. See identify_client()_
+
the peer's id as used in the bit torrent protocol. This id can be used +to extract 'fingerprints' from the peer. Sometimes it can tell you +which client the peer is using. See identify_client()_
pieces
@@ -557,9 +554,9 @@ or if the peer miss that piece (set to 0).
upload_limit download_limit
-
the number of bytes per second we are allowed to send to or receive from this -peer. It may be -1 if there's no local limit on the peer. The global -limit and the torrent limit may also be enforced.
+
the number of bytes per second we are allowed to send to or receive +from this peer. It may be -1 if there's no local limit on the peer. +The global limit and the torrent limit may also be enforced.
@@ -575,8 +572,9 @@ queue will be d
request_timeout
-
the number of seconds until the current front piece request -will time out. This timeout can be adjusted through session_settings::request_timeout. +
the number of seconds until the current front piece request will time +out. This timeout can be adjusted through +session_settings::request_timeout. -1 means that there is not outstanding request.
@@ -598,12 +596,13 @@ sending us that turned out to fail the hash check.
country[2]
-
the two letter ISO 3166 country code for the country the peer -is connected from. If the country hasn't been resolved yet, both chars are set -to 0. If the resolution failed for some reason, the field is set to "--". If the -resolution service returns an invalid country code, it is set to "!!". -The countries.nerd.dk service is used to look up countries. This field will -remain set to 0 unless the torrent is set to resolve countries, see resolve_countries().
+
the two letter ISO 3166 country code for the country the peer is +connected from. If the country hasn't been resolved yet, both chars +are set to 0. If the resolution failed for some reason, the field is +set to "--". If the resolution service returns an invalid country +code, it is set to "!!". The countries.nerd.dk service is used to +look up countries. This field will remain set to 0 unless the torrent +is set to resolve countries, see resolve_countries().
inet_as_name
@@ -616,11 +615,11 @@ an empty string if there is no name in the geo ip database.
load_balancing
-
a measurement of the balancing of free download (that we get) -and free upload that we give. Every peer gets a certain amount of free upload, but -this member says how much extra free upload this peer has got. If it is a negative -number it means that this was a peer from which we have got this amount of free -download.
+
a measurement of the balancing of free download (that we get) and free +upload that we give. Every peer gets a certain amount of free upload, +but this member says how much extra free upload this peer has got. +If it is a negative number it means that this was a peer from which we +have got this amount of free download.
download_queue_length
@@ -659,31 +658,33 @@ that we haven't answered with a piece yet.
failcount
-
the number of times this peer has "failed". i.e. failed to connect -or disconnected us. The failcount is decremented when we see this peer in a tracker -response or peer exchange message.
+
the number of times this peer has "failed". i.e. failed to connect or +disconnected us. The failcount is decremented when we see this peer in +a tracker response or peer exchange message.
downloading_piece_index downloading_block_index downloading_progress downloading_total
-
You can know which piece, and which part of that piece, that is currently being -downloaded from a specific peer by looking at these four members. -downloading_piece_index is the index of the piece that is currently being downloaded. -This may be set to -1 if there's currently no piece downloading from this peer. If it is ->= 0, the other three members are valid. downloading_block_index is the index of the -block (or sub-piece) that is being downloaded. downloading_progress is the number -of bytes of this block we have received from the peer, and downloading_total is -the total number of bytes in this block.
+
You can know which piece, and which part of that piece, that is +currently being downloaded from a specific peer by looking at these +four members. downloading_piece_index is the index of the piece +that is currently being downloaded. This may be set to -1 if there's +currently no piece downloading from this peer. If it is >= 0, the +other three members are valid. downloading_block_index is the +index of the block (or sub-piece) that is being downloaded. +downloading_progress is the number of bytes of this block we have +received from the peer, and downloading_total is the total number +of bytes in this block.
client
a string describing the software at the other end of the connection. -In some cases this information is not available, then it will contain a string -that may give away something about which software is running in the other end. -In the case of a web seed, the server type and version will be a part of this -string.
+In some cases this information is not available, then it will contain +a string that may give away something about which software is running +in the other end. In the case of a web seed, the server type and +version will be a part of this string.
connection_type
@@ -696,21 +697,22 @@ bytes per second.
pending_disk_bytes
-
the number of bytes this peer has pending in the -disk-io thread. Downloaded and waiting to be written to disk. This is what -is capped by session_settings::max_queued_disk_bytes.
+
the number of bytes this peer has pending in the disk-io thread. +Downloaded and waiting to be written to disk. This is what is capped +by session_settings::max_queued_disk_bytes.
send_quota receive_quota
-
the number of bytes this peer has been -assigned to be allowed to send and receive until it has to request more quota -from the bandwidth manager.
+
the number of bytes this peer has been assigned to be allowed to send +and receive until it has to request more quota from the bandwidth +manager.
rtt
an estimated round trip time to this peer, in milliseconds. It is -estimated by timing the the tcp connect(). It may be 0 for incoming connections.
+estimated by timing the the tcp connect(). It may be 0 for +incoming connections.
num_pieces
@@ -719,20 +721,26 @@ estimated by timing the the tcp connect(). It
download_rate_peak upload_rate_peak
-
the highest download and upload -rates seen on this connection. They are given in bytes per second. This number is -reset to 0 on reconnect.
+
the highest download and upload rates seen on this connection. They +are given in bytes per second. This number is reset to 0 on reconnect.
progress_ppm
indicates the download progress of the peer in the range [0, 1000000] (parts per million).
+
+
estimated_reciprocation_rate
+
this is an estimation of the upload rate, to this peer, where it will +unchoke us. This is a coarse estimation based on the rate at which +we sent right before we were choked. This is primarily used for the +bittyrant choking algorithm.
+
local_endpoint
the IP and port pair the socket is bound to locally. i.e. the IP -address of the interface it's going out over. This may be useful for multi-homed -clients with multiple interfaces to the internet.
+address of the interface it's going out over. This may be useful for +multi-homed clients with multiple interfaces to the internet.
@@ -1047,7 +1055,8 @@ struct torrent_handle void add_http_seed (std::string const& url) const; void remove_http_seed (std::string const& url) const; std::set<std::string> http_seeds () const; - void add_extension (boost::function<boost::shared_ptr<torrent_plugin>(torrent*, void*)> const& ext + void add_extension ( + boost::function<boost::shared_ptr<torrent_plugin>(torrent*, void*)> const& ext , void* userdata = 0); bool set_metadata (char const* metadata, int size) const; bool is_valid () const; @@ -1370,7 +1379,8 @@ they operate on

add_extension()

-void add_extension (boost::function<boost::shared_ptr<torrent_plugin>(torrent*, void*)> const& ext
+void add_extension (
+      boost::function<boost::shared_ptr<torrent_plugin>(torrent*, void*)> const& ext
       , void* userdata = 0);
 

add the specified extension to this torrent. The ext argument is @@ -1746,25 +1756,26 @@ info-hash.

 void use_interface (const char* net_interface) const;
 
-

use_interface() sets the network interface this torrent will use when it opens outgoing -connections. By default, it uses the same interface as the session uses to listen on. The -parameter must be a string containing one or more, comma separated, ip-address (either an -IPv4 or IPv6 address). When specifying multiple interfaces, the torrent will round-robin -which interface to use for each outgoing conneciton. This is useful for clients that are -multi-homed.

+

use_interface() sets the network interface this torrent will use +when it opens outgoing connections. By default, it uses the same +interface as the session uses to listen on. The parameter must be a +string containing one or more, comma separated, ip-address (either an +IPv4 or IPv6 address). When specifying multiple interfaces, the +torrent will round-robin which interface to use for each outgoing +conneciton. This is useful for clients that are multi-homed.

piece_availability()

 void piece_availability (std::vector<int>& avail) const;
 
-

Fills the specified std::vector<int> with the availability for each -piece in this torrent. libtorrent does not keep track of availability for -seeds, so if the torrent is seeding the availability for all pieces is -reported as 0.

-

The piece availability is the number of peers that we are connected that has -advertized having a particular piece. This is the information that libtorrent -uses in order to prefer picking rare pieces.

+

Fills the specified std::vector<int> with the availability for +each piece in this torrent. libtorrent does not keep track of +availability for seeds, so if the torrent is seeding the availability +for all pieces is reported as 0.

+

The piece availability is the number of peers that we are connected +that has advertized having a particular piece. This is the information +that libtorrent uses in order to prefer picking rare pieces.

@@ -1776,11 +1787,11 @@ void piece_priority (int index, int priority) const; void prioritize_pieces (std::vector<int> const& pieces) const; std::vector<int> piece_priorities () const; -

These functions are used to set and get the prioritiy of individual pieces. -By default all pieces have priority 1. That means that the random rarest -first algorithm is effectively active for all pieces. You may however -change the priority of individual pieces. There are 8 different priority -levels:

+

These functions are used to set and get the prioritiy of individual +pieces. By default all pieces have priority 1. That means that the +random rarest first algorithm is effectively active for all pieces. +You may however change the priority of individual pieces. There are 8 +different priority levels:

  1. piece is not downloaded at all
  2. @@ -1792,20 +1803,20 @@ the same availability, but not over pieces with lower availability lower availability
  3. currently the same as 4
  4. piece is as likely to be picked as any piece with availability 1
  5. -
  6. maximum priority, availability is disregarded, the piece is preferred -over any other piece with lower priority
  7. +
  8. maximum priority, availability is disregarded, the piece is +preferred over any other piece with lower priority
-

The exact definitions of these priorities are implementation details, and -subject to change. The interface guarantees that higher number means higher -priority, and that 0 means do not download.

+

The exact definitions of these priorities are implementation details, +and subject to change. The interface guarantees that higher number +means higher priority, and that 0 means do not download.

piece_priority sets or gets the priority for an individual piece, specified by index.

-

prioritize_pieces takes a vector of integers, one integer per piece in -the torrent. All the piece priorities will be updated with the priorities -in the vector.

-

piece_priorities returns a vector with one element for each piece in the -torrent. Each element is the current priority of that piece.

+

prioritize_pieces takes a vector of integers, one integer per +piece in the torrent. All the piece priorities will be updated with +the priorities in the vector.

+

piece_priorities returns a vector with one element for each piece +in the torrent. Each element is the current priority of that piece.

@@ -1819,16 +1830,19 @@ std::vector<int> file_priorities () const;

index must be in the range [0, number_of_files).

file_priority() queries or sets the priority of file index.

-

prioritize_files() takes a vector that has at as many elements as there are -files in the torrent. Each entry is the priority of that file. The function -sets the priorities of all the pieces in the torrent based on the vector.

-

file_priorities() returns a vector with the priorities of all files.

+

prioritize_files() takes a vector that has at as many elements as +there are files in the torrent. Each entry is the priority of that +file. The function sets the priorities of all the pieces in the +torrent based on the vector.

+

file_priorities() returns a vector with the priorities of all +files.

The priority values are the same as for piece_priority().

-

Whenever a file priority is changed, all other piece priorities are reset -to match the file priorities. In order to maintain sepcial priorities for -particular pieces, piece_priority() has to be called again for those pieces.

-

You cannot set the file priorities on a torrent that does not yet -have metadata or a torrent that is a seed. file_priority(int, int) and +

Whenever a file priority is changed, all other piece priorities are +reset to match the file priorities. In order to maintain sepcial +priorities for particular pieces, piece_priority() has to be called +again for those pieces.

+

You cannot set the file priorities on a torrent that does not yet have +metadata or a torrent that is a seed. file_priority(int, int) and prioritize_files() are both no-ops for such torrents.

@@ -1855,12 +1869,13 @@ immediately.

 void scrape_tracker () const;
 
-

scrape_tracker() will send a scrape request to the tracker. A scrape request queries the -tracker for statistics such as total number of incomplete peers, complete peers, number of -downloads etc.

-

This request will specifically update the num_complete and num_incomplete fields in -the torrent_status struct once it completes. When it completes, it will generate a -scrape_reply_alert. If it fails, it will generate a scrape_failed_alert.

+

scrape_tracker() will send a scrape request to the tracker. A +scrape request queries the tracker for statistics such as total number +of incomplete peers, complete peers, number of downloads etc.

+

This request will specifically update the num_complete and +num_incomplete fields in the torrent_status struct once it +completes. When it completes, it will generate a scrape_reply_alert. +If it fails, it will generate a scrape_failed_alert.

@@ -1873,37 +1888,43 @@ int download_limit () const; void set_upload_limit (int limit) const; void set_download_limit (int limit) const; -

set_upload_limit will limit the upload bandwidth used by this particular torrent to the -limit you set. It is given as the number of bytes per second the torrent is allowed to upload. -set_download_limit works the same way but for download bandwidth instead of upload bandwidth. -Note that setting a higher limit on a torrent then the global limit (session_settings::upload_rate_limit) -will not override the global rate limit. The torrent can never upload more than the global rate +

set_upload_limit will limit the upload bandwidth used by this +particular torrent to the limit you set. It is given as the number of +bytes per second the torrent is allowed to upload. +set_download_limit works the same way but for download bandwidth +instead of upload bandwidth. Note that setting a higher limit on a +torrent then the global limit +(session_settings::upload_rate_limit) will not override the global +rate limit. The torrent can never upload more than the global rate limit.

-

upload_limit and download_limit will return the current limit setting, for upload and -download, respectively.

+

upload_limit and download_limit will return the current limit +setting, for upload and download, respectively.

set_sequential_download()

 void set_sequential_download (bool sd) const;
 
-

set_sequential_download() enables or disables sequential download. When enabled, the piece -picker will pick pieces in sequence instead of rarest first.

-

Enabling sequential download will affect the piece distribution negatively in the swarm. It should be -used sparingly.

+

set_sequential_download() enables or disables sequential +download. When enabled, the piece picker will pick pieces in sequence +instead of rarest first.

+

Enabling sequential download will affect the piece distribution +negatively in the swarm. It should be used sparingly.

connect_peer()

 void connect_peer (tcp::endpoint const& adr, int source = 0) const;
 
-

connect_peer() is a way to manually connect to peers that one believe is a part of the -torrent. If the peer does not respond, or is not a member of this torrent, it will simply -be disconnected. No harm can be done by using this other than an unnecessary connection -attempt is made. If the torrent is uninitialized or in queued or checking mode, this -will throw libtorrent_exception. The second (optional) argument will be bitwised ORed into -the source mask of this peer. Typically this is one of the source flags in peer_info. -i.e. tracker, pex, dht etc.

+

connect_peer() is a way to manually connect to peers that one +believe is a part of the torrent. If the peer does not respond, or is +not a member of this torrent, it will simply be disconnected. No harm +can be done by using this other than an unnecessary connection attempt +is made. If the torrent is uninitialized or in queued or checking +mode, this will throw libtorrent_exception. The second (optional) +argument will be bitwised ORed into the source mask of this peer. +Typically this is one of the source flags in peer_info. i.e. +tracker, pex, dht etc.

@@ -1912,10 +1933,11 @@ i.e. tracker, pex int max_uploads () const; void set_max_uploads (int max_uploads) const; -

set_max_uploads() sets the maximum number of peers that's unchoked at the same time on this -torrent. If you set this to -1, there will be no limit. This defaults to infinite. The primary -setting controlling this is the global unchoke slots limit, set by unchoke_slots_limit -in session_settings.

+

set_max_uploads() sets the maximum number of peers that's unchoked +at the same time on this torrent. If you set this to -1, there will be +no limit. This defaults to infinite. The primary setting controlling +this is the global unchoke slots limit, set by unchoke_slots_limit in +session_settings.

max_uploads() returns the current settings.

@@ -1925,11 +1947,13 @@ in max_connections () const; void set_max_connections (int max_connections) const; -

set_max_connections() sets the maximum number of connection this torrent will open. If all -connections are used up, incoming connections may be refused or poor connections may be closed. -This must be at least 2. The default is unlimited number of connections. If -1 is given to the -function, it means unlimited. There is also a global limit of the number of connections, set -by connections_limit in session_settings.

+

set_max_connections() sets the maximum number of connection this +torrent will open. If all connections are used up, incoming +connections may be refused or poor connections may be closed. This +must be at least 2. The default is unlimited number of connections. If +-1 is given to the function, it means unlimited. There is also a +global limit of the number of connections, set by +connections_limit in session_settings.

max_connections() returns the current settings.

@@ -1946,17 +1970,20 @@ of the tracker announce. Set this if the tracker requires authorization.

 void move_storage (std::string const& save_path, int flags = 0) const;
 
-

Moves the file(s) that this torrent are currently seeding from or downloading to. If -the given save_path is not located on the same drive as the original save path, -the files will be copied to the new drive and removed from their original location. -This will block all other disk IO, and other torrents download and upload rates may -drop while copying the file.

-

Since disk IO is performed in a separate thread, this operation is also asynchronous. -Once the operation completes, the storage_moved_alert is generated, with the new -path as the message. If the move fails for some reason, storage_moved_failed_alert -is generated instead, containing the error message.

-

The flags argument determines the behavior of the copying/moving of the files -in the torrent. see move_flags_t.

+

Moves the file(s) that this torrent are currently seeding from or +downloading to. If the given save_path is not located on the same +drive as the original save path, the files will be copied to the new +drive and removed from their original location. This will block all +other disk IO, and other torrents download and upload rates may drop +while copying the file.

+

Since disk IO is performed in a separate thread, this operation is +also asynchronous. Once the operation completes, the +storage_moved_alert is generated, with the new path as the +message. If the move fails for some reason, +storage_moved_failed_alert is generated instead, containing the +error message.

+

The flags argument determines the behavior of the copying/moving +of the files in the torrent. see move_flags_t.

rename_file()

 void rename_file (int index, std::string const& new_name) const;
 
-

Renames the file with the given index asynchronously. The rename operation is complete -when either a file_renamed_alert or file_rename_failed_alert is posted.

+

Renames the file with the given index asynchronously. The rename +operation is complete when either a file_renamed_alert or +file_rename_failed_alert is posted.

super_seeding()

@@ -2023,11 +2055,12 @@ but stable.

 boost::shared_ptr<torrent> native_handle () const;
 
-

This function is intended only for use by plugins and the alert dispatch function. Any code -that runs in libtorrent's network thread may not use the public API of torrent_handle. -Doing so results in a dead-lock. For such routines, the native_handle gives access to the -underlying type representing the torrent. This type does not have a stable API and should -be relied on as little as possible.

+

This function is intended only for use by plugins and the alert +dispatch function. Any code that runs in libtorrent's network thread +may not use the public API of torrent_handle. Doing so results in a +dead-lock. For such routines, the native_handle gives access to +the underlying type representing the torrent. This type does not have +a stable API and should be relied on as little as possible.

enum flags_t

@@ -2218,7 +2251,8 @@ torrent file (such as a magnet link or a URL).

torrent_status

Declared in "libtorrent/torrent_handle.hpp"

-

holds a snapshot of the status of a torrent, as queried by torrent_handle::status().

+

holds a snapshot of the status of a torrent, as queried by +torrent_handle::status().

 struct torrent_status
 {
@@ -2321,7 +2355,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"

131072 indicates that this socket is a uTP socket
ssl_socket262144indicates that this socket is running on top of an SSL +(TLS) channel
rc4_encrypted 1048576 this connection is obfuscated with RC4
web_seed 1Bittorrent connection over uTPHTTP connection using the BEP 19 protocol
http_seed 2HTTP connection using the BEP 19 protocol
bittorrent_utp3 HTTP connection using the BEP 17 protocol
@@ -2437,92 +2471,92 @@ been successful yet, it's set to an empty string.
total_download total_upload
-
the number of bytes downloaded and -uploaded to all peers, accumulated, this session only. The session is considered -to restart when a torrent is paused and restarted again. When a torrent is paused, -these counters are reset to 0. If you want complete, persistent, stats, see +
the number of bytes downloaded and uploaded to all peers, accumulated, +this session only. The session is considered to restart when a +torrent is paused and restarted again. When a torrent is paused, these +counters are reset to 0. If you want complete, persistent, stats, see all_time_upload and all_time_download.
total_payload_download total_payload_upload
-
counts the amount of bytes -send and received this session, but only the actual payload data (i.e the interesting -data), these counters ignore any protocol overhead.
+
counts the amount of bytes send and received this session, but only +the actual payload data (i.e the interesting data), these counters +ignore any protocol overhead.
total_failed_bytes
-
the number of bytes that has been downloaded and that -has failed the piece hash test. In other words, this is just how much crap that -has been downloaded.
+
the number of bytes that has been downloaded and that has failed the +piece hash test. In other words, this is just how much crap that has +been downloaded.
total_redundant_bytes
-
the number of bytes that has been downloaded even -though that data already was downloaded. The reason for this is that in some -situations the same data can be downloaded by mistake. When libtorrent sends -requests to a peer, and the peer doesn't send a response within a certain -timeout, libtorrent will re-request that block. Another situation when -libtorrent may re-request blocks is when the requests it sends out are not -replied in FIFO-order (it will re-request blocks that are skipped by an out of -order block). This is supposed to be as low as possible.
+
the number of bytes that has been downloaded even though that data +already was downloaded. The reason for this is that in some situations +the same data can be downloaded by mistake. When libtorrent sends +requests to a peer, and the peer doesn't send a response within a +certain timeout, libtorrent will re-request that block. Another +situation when libtorrent may re-request blocks is when the requests +it sends out are not replied in FIFO-order (it will re-request blocks +that are skipped by an out of order block). This is supposed to be as +low as possible.
pieces
-
a bitmask that represents which pieces we have (set to true) and -the pieces we don't have. It's a pointer and may be set to 0 if the torrent isn't -downloading or seeding.
+
a bitmask that represents which pieces we have (set to true) and the +pieces we don't have. It's a pointer and may be set to 0 if the +torrent isn't downloading or seeding.
verified_pieces
-
a bitmask representing which pieces has had their hash -checked. This only applies to torrents in seed mode. If the torrent is not -in seed mode, this bitmask may be empty.
+
a bitmask representing which pieces has had their hash checked. This +only applies to torrents in seed mode. If the torrent is not in seed +mode, this bitmask may be empty.
total_done
-
the total number of bytes of the file(s) that we have. All -this does not necessarily has to be downloaded during this session (that's +
the total number of bytes of the file(s) that we have. All this does +not necessarily has to be downloaded during this session (that's total_payload_download).
total_wanted_done
-
the number of bytes we have downloaded, only counting the -pieces that we actually want to download. i.e. excluding any pieces that we have but -have priority 0 (i.e. not wanted).
+
the number of bytes we have downloaded, only counting the pieces that +we actually want to download. i.e. excluding any pieces that we have +but have priority 0 (i.e. not wanted).
total_wanted
-
The total number of bytes we want to download. -This may be smaller than the total torrent size -in case any pieces are prioritized to 0, i.e. not wanted
+
The total number of bytes we want to download. This may be smaller +than the total torrent size in case any pieces are prioritized to 0, +i.e. not wanted
all_time_upload all_time_download
-
are accumulated upload and download -payload byte counters. They are saved in and restored from resume data to keep totals -across sessions.
+
are accumulated upload and download payload byte counters. They are +saved in and restored from resume data to keep totals across sessions.
added_time
-
the posix-time when this torrent was added. i.e. what -time(NULL) returned at the time.
+
the posix-time when this torrent was added. i.e. what time(NULL) +returned at the time.
completed_time
-
the posix-time when this torrent was finished. If -the torrent is not yet finished, this is 0.
+
the posix-time when this torrent was finished. If the torrent is not +yet finished, this is 0.
last_seen_complete
-
the time when we, or one of our peers, last -saw a complete copy of this torrent.
+
the time when we, or one of our peers, last saw a complete copy of +this torrent.
storage_mode
-
The allocation mode for the torrent. See storage_mode_t for the options. -For more information, see storage allocation.
+
The allocation mode for the torrent. See storage_mode_t for the +options. For more information, see storage allocation.
progress
@@ -2531,9 +2565,10 @@ torrent's current task. It may be checking files or downloading.
progress_ppm
-
reflects the same value as progress, but instead in a range -[0, 1000000] (ppm = parts per million). When floating point operations are disabled, -this is the only alternative to the floating point value in progress.
+
reflects the same value as progress, but instead in a range [0, +1000000] (ppm = parts per million). When floating point operations are +disabled, this is the only alternative to the floating point value in +progress.
queue_position
@@ -2543,16 +2578,17 @@ queue. If the torrent is a seed or finished, this is -1.
download_rate upload_rate
-
the total rates for all peers for this -torrent. These will usually have better precision than summing the rates from -all peers. The rates are given as the number of bytes per second.
+
the total rates for all peers for this torrent. These will usually +have better precision than summing the rates from all peers. The rates +are given as the number of bytes per second.
download_payload_rate upload_payload_rate
-
the total transfer rate of payload only, not counting protocol chatter. This might -be slightly smaller than the other rates, but if projected over a long time -(e.g. when calculating ETA:s) the difference may be noticeable.
+
the total transfer rate of payload only, not counting protocol +chatter. This might be slightly smaller than the other rates, but if +projected over a long time (e.g. when calculating ETA:s) the +difference may be noticeable.
num_seeds
@@ -2561,71 +2597,66 @@ currently connected to.
num_peers
-
the number of peers this torrent currently is connected to. -Peer connections that are in the half-open state (is attempting to connect) -or are queued for later connection attempt do not count. Although they are -visible in the peer list when you call get_peer_info().
+
the number of peers this torrent currently is connected to. Peer +connections that are in the half-open state (is attempting to connect) +or are queued for later connection attempt do not count. Although they +are visible in the peer list when you call get_peer_info().
num_complete num_incomplete
-
if the tracker sends scrape info in its -announce reply, these fields will be -set to the total number of peers that -have the whole file and the total number -of peers that are still downloading. -set to -1 if the tracker did not -send any scrape data in its announce reply.
+
if the tracker sends scrape info in its announce reply, these fields +will be set to the total number of peers that have the whole file and +the total number of peers that are still downloading. set to -1 if the +tracker did not send any scrape data in its announce reply.
list_seeds list_peers
-
the number of seeds in our peer list -and the total number of peers (including seeds). We are not -necessarily connected to all the peers in our peer list. This is the number -of peers we know of in total, including banned peers and peers that we have -failed to connect to.
+
the number of seeds in our peer list and the total number of peers +(including seeds). We are not necessarily connected to all the peers +in our peer list. This is the number of peers we know of in total, +including banned peers and peers that we have failed to connect to.
connect_candidates
-
the number of peers in this torrent's peer list -that is a candidate to be connected to. i.e. It has fewer connect attempts -than the max fail count, it is not a seed if we are a seed, it is not banned -etc. If this is 0, it means we don't know of any more peers that we can try.
+
the number of peers in this torrent's peer list that is a candidate to +be connected to. i.e. It has fewer connect attempts than the max fail +count, it is not a seed if we are a seed, it is not banned etc. If +this is 0, it means we don't know of any more peers that we can try.
num_pieces
-
the number of pieces that has been downloaded. It is equivalent -to: std::accumulate(pieces->begin(), pieces->end()). So you don't have to -count yourself. This can be used to see if anything has updated since last time -if you want to keep a graph of the pieces up to date.
+
the number of pieces that has been downloaded. It is equivalent to: +std::accumulate(pieces->begin(), pieces->end()). So you don't have +to count yourself. This can be used to see if anything has updated +since last time if you want to keep a graph of the pieces up to date.
distributed_full_copies
-
the number of distributed copies of the torrent. -Note that one copy may be spread out among many peers. It tells how many copies -there are currently of the rarest piece(s) among the peers this client is +
the number of distributed copies of the torrent. Note that one copy +may be spread out among many peers. It tells how many copies there are +currently of the rarest piece(s) among the peers this client is connected to.
distributed_fraction
-

tells the share of pieces that have more copies than -the rarest piece(s). Divide this number by 1000 to get the fraction.

-

For example, if distributed_full_copies is 2 and distrbuted_fraction -is 500, it means that the rarest pieces have only 2 copies among the peers -this torrent is connected to, and that 50% of all the pieces have more than -two copies.

-

If we are a seed, the piece picker is deallocated as an optimization, and -piece availability is no longer tracked. In this case the distributed -copies members are set to -1.

+

tells the share of pieces that have more copies than the rarest +piece(s). Divide this number by 1000 to get the fraction.

+

For example, if distributed_full_copies is 2 and +distrbuted_fraction is 500, it means that the rarest pieces have +only 2 copies among the peers this torrent is connected to, and that +50% of all the pieces have more than two copies.

+

If we are a seed, the piece picker is deallocated as an optimization, +and piece availability is no longer tracked. In this case the +distributed copies members are set to -1.

distributed_copies
-

the number of distributed copies of the file. -note that one copy may be spread out among many peers. -This is a floating point representation of the -distributed copies.

+

the number of distributed copies of the file. note that one copy may +be spread out among many peers. This is a floating point +representation of the distributed copies.

the integer part tells how many copies
there are of the rarest piece(s)
@@ -2636,8 +2667,8 @@ distributed copies.

block_size
-
the size of a block, in bytes. A block is a sub piece, it -is the number of bytes that each piece request asks for and the number of +
the size of a block, in bytes. A block is a sub piece, it 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.
@@ -2648,9 +2679,9 @@ larger if the pieces are larger.
num_connections
-
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.
+
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
@@ -2663,36 +2694,37 @@ always >= num_peers.
up_bandwidth_queue down_bandwidth_queue
-
the number of peers in this -torrent that are waiting for more bandwidth quota from the torrent rate limiter. -This can determine if the rate you get from this torrent is bound by the torrents -limit or not. If there is no limit set on this torrent, the peers might still be -waiting for bandwidth quota from the global limiter, but then they are counted in -the session_status object.
+
the number of peers in this torrent that are waiting for more +bandwidth quota from the torrent rate limiter. This can determine if +the rate you get from this torrent is bound by the torrents limit or +not. If there is no limit set on this torrent, the peers might still +be waiting for bandwidth quota from the global limiter, but then they +are counted in the session_status object.
time_since_upload time_since_download
-
the number of -seconds since any peer last uploaded from this torrent and the last -time a downloaded piece passed the hash check, respectively.
+
the number of seconds since any peer last uploaded from this torrent +and the last time a downloaded piece passed the hash check, +respectively.
active_time finished_time seeding_time
-
These keep track of the number of seconds this torrent has been active (not -paused) and the number of seconds it has been active while being finished and -active while being a seed. seeding_time should be <= finished_time which -should be <= active_time. They are all saved in and restored from resume data, -to keep totals across sessions.
+
These keep track of the number of seconds this torrent has been active +(not paused) and the number of seconds it has been active while being +finished and active while being a seed. seeding_time should be <= +finished_time which should be <= active_time. They are all +saved in and restored from resume data, to keep totals across +sessions.
seed_rank
-
A rank of how important it is to seed the torrent, it is used -to determine which torrents to seed and which to queue. It is based on the peer -to seed ratio from the tracker scrape. For more information, see queuing. -Higher value means more important to seed
+
A rank of how important it is to seed the torrent, it is used to +determine which torrents to seed and which to queue. It is based on +the peer to seed ratio from the tracker scrape. For more information, +see queuing. Higher value means more important to seed
last_scrape
@@ -2701,9 +2733,9 @@ If it has never done that, this value is -1.
sparse_regions
-
the number of regions of non-downloaded pieces in the -torrent. This is an interesting metric on windows vista, since there is -a limit on the number of sparse regions in a single file there.
+
the number of regions of non-downloaded pieces in the torrent. This is +an interesting metric on windows vista, since there is a limit on the +number of sparse regions in a single file there.
priority
@@ -2726,18 +2758,18 @@ to this torrent. This defaults to true.
upload_mode
-
true if the torrent is blocked from downloading. This -typically happens when a disk write operation fails. If the torrent is +
true if the torrent is blocked from downloading. This typically +happens when a disk write operation fails. If the torrent is auto-managed, it will periodically be taken out of this state, in the -hope that the disk condition (be it disk full or permission errors) has -been resolved. If the torrent is not auto-managed, you have to explicitly -take it out of the upload mode by calling set_upload_mode() on the -torrent_handle.
+hope that the disk condition (be it disk full or permission errors) +has been resolved. If the torrent is not auto-managed, you have to +explicitly take it out of the upload mode by calling set_upload_mode() +on the torrent_handle.
share_mode
-
true if the torrent is currently in share-mode, i.e. -not downloading the torrent, but just helping the swarm out.
+
true if the torrent is currently in share-mode, i.e. not downloading +the torrent, but just helping the swarm out.
super_seeding
@@ -2745,21 +2777,22 @@ not downloading the torrent, but just helping the swarm out.
paused
-
set to true if the torrent is paused and false otherwise. It's only true -if the torrent itself is paused. If the torrent is not running because the session is -paused, this is still false. To know if a torrent is active or not, you need to inspect -both torrent_status::paused and session::is_paused().
+
set to true if the torrent is paused and false otherwise. It's only +true if the torrent itself is paused. If the torrent is not running +because the session is paused, this is still false. To know if a +torrent is active or not, you need to inspect both +torrent_status::paused and session::is_paused().
auto_managed
set to true if the torrent is auto managed, i.e. libtorrent is -responsible for determining whether it should be started or queued. For more info -see queuing
+responsible for determining whether it should be started or queued. +For more info see queuing
sequential_download
-
true when the torrent is in sequential download mode. In -this mode pieces are downloaded in order rather than rarest first.
+
true when the torrent is in sequential download mode. In this mode +pieces are downloaded in order rather than rarest first.
is_seeding
@@ -2768,26 +2801,27 @@ this mode pieces are downloaded in order rather than rarest first.
is_finished
true if all pieces that have a priority > 0 are downloaded. There is -only a distinction between finished and seeding if some pieces or files have been -set to priority 0, i.e. are not downloaded.
+only a distinction between finished and seeding if some pieces or +files have been set to priority 0, i.e. are not downloaded.
has_metadata
true if this torrent has metadata (either it was started from a -.torrent file or the metadata has been downloaded). The only scenario where this can be -false is when the torrent was started torrent-less (i.e. with just an info-hash and tracker -ip, a magnet link for instance).
+.torrent file or the metadata has been downloaded). The only scenario +where this can be false is when the torrent was started torrent-less +(i.e. with just an info-hash and tracker ip, a magnet link for +instance).
has_incoming
-
true if there has ever been an incoming connection attempt -to this torrent.
+
true if there has ever been an incoming connection attempt to this +torrent.
seed_mode
-
true if the torrent is in seed_mode. If the torrent was -started in seed mode, it will leave seed mode once all pieces have been -checked or as soon as one piece fails the hash check.
+
true if the torrent is in seed_mode. If the torrent was started in +seed mode, it will leave seed mode once all pieces have been checked +or as soon as one piece fails the hash check.
moving_storage
@@ -2871,7 +2905,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 ();
@@ -3087,7 +3121,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);
@@ -3119,7 +3153,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 ();
@@ -3144,7 +3178,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);
@@ -3229,7 +3263,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;
@@ -3276,7 +3310,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;
@@ -3389,7 +3423,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-Session.html b/docs/reference-Session.html
index d192c31a5..0b144e18a 100644
--- a/docs/reference-Session.html
+++ b/docs/reference-Session.html
@@ -55,14 +55,14 @@
 
 
@@ -517,13 +517,12 @@ is large, a larger cache could significantly improve performance

session_proxy

Declared in "libtorrent/session.hpp"

-

this is a holder for the internal session implementation -object. Once the session destruction is explicitly initiated, -this holder is used to synchronize the completion of the -shutdown. The lifetime of this object may outlive session, -causing the session destructor to not block. -The session_proxy destructor will block however, until the -underlying session is done shutting down.

+

this is a holder for the internal session implementation object. Once the +session destruction is explicitly initiated, this holder is used to +synchronize the completion of the shutdown. The lifetime of this object +may outlive session, causing the session destructor to not block. The +session_proxy destructor will block however, until the underlying session +is done shutting down.

 class session_proxy
 {
@@ -542,10 +541,11 @@ implementation object.

session

Declared in "libtorrent/session.hpp"

-

The session holds all state that spans multiple torrents. Among other things it runs the network -loop and manages all torrents. -Once it's created, the session object will spawn the main thread that will do all the work. -The main thread will be idle as long it doesn't have any torrents to participate in.

+

The session holds all state that spans multiple torrents. Among other +things it runs the network loop and manages all torrents. Once it's +created, the session object will spawn the main thread that will do all +the work. The main thread will be idle as long it doesn't have any +torrents to participate in.

 class session: public boost::noncopyable
 {
@@ -682,29 +682,34 @@ class session: public boost::noncopyable
       , int alert_mask = alert::error_notification
       TORRENT_LOGPATH_ARG_DEFAULT);
 
-

If the fingerprint in the first overload is omited, the client will get a default -fingerprint stating the version of libtorrent. The fingerprint is a short string that will be -used in the peer-id to identify the client and the client's version. For more details see the -fingerprint class. The constructor that only takes a fingerprint will not open a -listen port for the session, to get it running you'll have to call session::listen_on(). -The other constructor, that takes a port range and an interface as well as the fingerprint -will automatically try to listen on a port on the given interface. For more information about -the parameters, see listen_on() function.

-

The flags paramater can be used to start default features (upnp & nat-pmp) and default plugins -(ut_metadata, ut_pex and smart_ban). The default is to start those things. If you do not want -them to start, pass 0 as the flags parameter.

-

The alert_mask is the same mask that you would send to set_alert_mask().

+

If the fingerprint in the first overload is omited, the client will +get a default fingerprint stating the version of libtorrent. The +fingerprint is a short string that will be used in the peer-id to +identify the client and the client's version. For more details see the +fingerprint class. The constructor that only takes a fingerprint will +not open a listen port for the session, to get it running you'll have +to call session::listen_on(). The other constructor, that takes a +port range and an interface as well as the fingerprint will +automatically try to listen on a port on the given interface. For more +information about the parameters, see listen_on() function.

+

The flags paramater can be used to start default features (upnp & +nat-pmp) and default plugins (ut_metadata, ut_pex and smart_ban). The +default is to start those things. If you do not want them to start, +pass 0 as the flags parameter.

+

The alert_mask is the same mask that you would send to +set_alert_mask().

-
+

~session()

 ~session ();
 
-

The destructor of session will notify all trackers that our torrents have been shut down. -If some trackers are down, they will time out. All this before the destructor of session -returns. So, it's advised that any kind of interface (such as windows) are closed before -destructing the session object. Because it can take a few second for it to finish. The -timeout can be set with set_settings().

+

The destructor of session will notify all trackers that our torrents +have been shut down. If some trackers are down, they will time out. +All this before the destructor of session returns. So, it's advised +that any kind of interface (such as windows) are closed before +destructing the session object. Because it can take a few second for +it to finish. The timeout can be set with set_settings().

@@ -713,14 +718,15 @@ timeout can be set with set_settings().

void load_state (lazy_entry const& e); void save_state (entry& e, boost::uint32_t flags = 0xffffffff) const;
-

loads and saves all session settings, including dht_settings, encryption settings and proxy -settings. save_state writes all keys to the entry that's passed in, which needs to -either not be initialized, or initialized as a dictionary.

-

load_state expects a lazy_entry which can be built from a bencoded buffer with -lazy_bdecode().

-

The flags arguments passed in to save_state can be used to filter which parts -of the session state to save. By default, all state is saved (except for the individual -torrents). see save_state_flags_t

+

loads and saves all session settings, including dht_settings, +encryption settings and proxy settings. save_state writes all keys +to the entry that's passed in, which needs to either not be +initialized, or initialized as a dictionary.

+

load_state expects a lazy_entry which can be built from a bencoded +buffer with lazy_bdecode().

+

The flags arguments passed in to save_state can be used to +filter which parts of the session state to save. By default, all state +is saved (except for the individual torrents). see save_state_flags_t

@@ -734,37 +740,39 @@ void get_torrent_status (std::vector<torrent_status>* ret

Note

-

these calls are potentially expensive and won't scale well -with lots of torrents. If you're concerned about performance, consider +

these calls are potentially expensive and won't scale well with +lots of torrents. If you're concerned about performance, consider using post_torrent_updates() instead.

-

get_torrent_status returns a vector of the torrent_status for every -torrent which satisfies pred, which is a predicate function which determines -if a torrent should be included in the returned set or not. Returning true means -it should be included and false means excluded. The flags argument is the same -as to torrent_handle::status(). Since pred is guaranteed to be called for -every torrent, it may be used to count the number of torrents of different categories -as well.

-

refresh_torrent_status takes a vector of torrent_status structs (for instance -the same vector that was returned by get_torrent_status() ) and refreshes the -status based on the handle member. It is possible to use this function by -first setting up a vector of default constructed torrent_status objects, only -initializing the handle member, in order to request the torrent status for -multiple torrents in a single call. This can save a significant amount of time -if you have a lot of torrents.

-

Any torrent_status object whose handle member is not referring to a -valid torrent are ignored.

+

get_torrent_status returns a vector of the torrent_status for +every torrent which satisfies pred, which is a predicate function +which determines if a torrent should be included in the returned set +or not. Returning true means it should be included and false means +excluded. The flags argument is the same as to +torrent_handle::status(). Since pred is guaranteed to be +called for every torrent, it may be used to count the number of +torrents of different categories as well.

+

refresh_torrent_status takes a vector of torrent_status structs +(for instance the same vector that was returned by +get_torrent_status() ) and refreshes the status based on the +handle member. It is possible to use this function by first +setting up a vector of default constructed torrent_status objects, +only initializing the handle member, in order to request the +torrent status for multiple torrents in a single call. This can save a +significant amount of time if you have a lot of torrents.

+

Any torrent_status object whose handle member is not referring to +a valid torrent are ignored.

post_torrent_updates()

 void post_torrent_updates ();
 
-

This functions instructs the session to post the state_update_alert, containing -the status of all torrents whose state changed since the last time this function -was called.

-

Only torrents who has the state subscription flag set will be included. This flag -is on by default. See add_torrent_params.

+

This functions instructs the session to post the state_update_alert, +containing the status of all torrents whose state changed since the +last time this function was called.

+

Only torrents who has the state subscription flag set will be +included. This flag is on by default. See add_torrent_params.

@@ -773,12 +781,14 @@ is on by default. See find_torrent() looks for a torrent with the given info-hash. In case there -is such a torrent in the session, a torrent_handle to that torrent is returned. -In case the torrent cannot be found, an invalid torrent_handle is returned.

-

See torrent_handle::is_valid() to know if the torrent was found or not.

-

get_torrents() returns a vector of torrent_handles to all the torrents -currently in the session.

+

find_torrent() looks for a torrent with the given info-hash. In +case there is such a torrent in the session, a torrent_handle to that +torrent is returned. In case the torrent cannot be found, an invalid +torrent_handle is returned.

+

See torrent_handle::is_valid() to know if the torrent was found or +not.

+

get_torrents() returns a vector of torrent_handles to all the +torrents currently in the session.

@@ -790,20 +800,21 @@ torrent_handle add_torrent (add_torrent_params const& param

You add torrents through the add_torrent() function where you give an object with all the parameters. The add_torrent() overloads will block -until the torrent has been added (or failed to be added) and returns an -error code and a torrent_handle. In order to add torrents more efficiently, -consider using async_add_torrent() which returns immediately, without -waiting for the torrent to add. Notification of the torrent being added is sent -as add_torrent_alert.

+until the torrent has been added (or failed to be added) and returns +an error code and a torrent_handle. In order to add torrents more +efficiently, consider using async_add_torrent() which returns +immediately, without waiting for the torrent to add. Notification of +the torrent being added is sent as add_torrent_alert.

The overload that does not take an error_code throws an exception on error and is not available when building without exception support. -The torrent_handle returned by add_torrent() can be used to retrieve information -about the torrent's progress, its peers etc. It is also used to abort a torrent.

-

If the torrent you are trying to add already exists in the session (is either queued -for checking, being checked or downloading) add_torrent() will throw -libtorrent_exception which derives from std::exception unless duplicate_is_error -is set to false. In that case, add_torrent() will return the handle to the existing -torrent.

+The torrent_handle returned by add_torrent() can be used to retrieve +information about the torrent's progress, its peers etc. It is also +used to abort a torrent.

+

If the torrent you are trying to add already exists in the session (is +either queued for checking, being checked or downloading) +add_torrent() will throw libtorrent_exception which derives from +std::exception unless duplicate_is_error is set to false. In that +case, add_torrent() will return the handle to the existing torrent.

all torrent_handles must be destructed before the session is destructed!

@@ -811,15 +822,17 @@ torrent.

 session_proxy abort ();
 
-

In case you want to destruct the session asynchrounously, you can request a session -destruction proxy. If you don't do this, the destructor of the session object will -block while the trackers are contacted. If you keep one session_proxy to the -session when destructing it, the destructor will not block, but start to close down -the session, the destructor of the proxy will then synchronize the threads. So, the -destruction of the session is performed from the session destructor call until the -session_proxy destructor call. The session_proxy does not have any operations -on it (since the session is being closed down, no operations are allowed on it). The -only valid operation is calling the destructor:

+

In case you want to destruct the session asynchrounously, you can +request a session destruction proxy. If you don't do this, the +destructor of the session object will block while the trackers are +contacted. If you keep one session_proxy to the session when +destructing it, the destructor will not block, but start to close down +the session, the destructor of the proxy will then synchronize the +threads. So, the destruction of the session is performed from the +session destructor call until the session_proxy destructor +call. The session_proxy does not have any operations on it (since +the session is being closed down, no operations are allowed on it). +The only valid operation is calling the destructor:

 class session_proxy
 {
@@ -838,10 +851,11 @@ void resume ();
 void pause ();
 bool is_paused () const;
 
-

Pausing the session has the same effect as pausing every torrent in it, except that -torrents will not be resumed by the auto-manage mechanism. Resuming will restore the -torrents to their previous paused state. i.e. the session pause state is separate from -the torrent pause state. A torrent is inactive if it is paused or if the session is +

Pausing the session has the same effect as pausing every torrent in +it, except that torrents will not be resumed by the auto-manage +mechanism. Resuming will restore the torrents to their previous paused +state. i.e. the session pause state is separate from the torrent pause +state. A torrent is inactive if it is paused or if the session is paused.

@@ -849,15 +863,16 @@ paused.

 session_status status () const;
 
-

returns session wide-statistics and status. For more information, see the session_status struct.

+

returns session wide-statistics and status. For more information, see +the session_status struct.

get_cache_status()

 cache_status get_cache_status () const;
 
-

Returns status of the disk cache for this session. -For more information, see the cache_status type.

+

Returns status of the disk cache for this session. For more +information, see the cache_status type.

get_cache_info()

@@ -877,12 +892,11 @@ feed_handle add_feed (feed_settings const& feed);

This adds an RSS feed to the session. The feed will be refreshed regularly and optionally add all torrents from the feed, as they appear.

-

Before adding the feed, you must set the url field to the -feed's url. It may point to an RSS or an atom feed. -The returned feed_handle is a handle which is used to interact -with the feed, things like forcing a refresh or querying for -information about the items in the feed. For more information, -see feed_handle.

+

Before adding the feed, you must set the url field to the feed's +url. It may point to an RSS or an atom feed. The returned feed_handle +is a handle which is used to interact with the feed, things like +forcing a refresh or querying for information about the items in the +feed. For more information, see feed_handle.

remove_feed()

@@ -911,35 +925,37 @@ void start_dht (); void stop_dht (); void set_dht_settings (dht_settings const& settings); -

starts/stops UPnP, NATPMP or LSD port mappers -they are stopped by default -These functions are not available in case TORRENT_DISABLE_DHT is -defined. start_dht starts the dht node and makes the trackerless service -available to torrents. The startup state is optional and can contain nodes -and the node id from the previous session. The dht node state is a bencoded -dictionary with the following entries:

+

starts/stops UPnP, NATPMP or LSD port mappers they are stopped by +default These functions are not available in case +TORRENT_DISABLE_DHT is defined. start_dht starts the dht node +and makes the trackerless service available to torrents. The startup +state is optional and can contain nodes and the node id from the +previous session. The dht node state is a bencoded dictionary with the +following entries:

nodes
-
A list of strings, where each string is a node endpoint encoded in binary. If -the string is 6 bytes long, it is an IPv4 address of 4 bytes, encoded in -network byte order (big endian), followed by a 2 byte port number (also -network byte order). If the string is 18 bytes long, it is 16 bytes of IPv6 -address followed by a 2 bytes port number (also network byte order).
+
A list of strings, where each string is a node endpoint encoded in +binary. If the string is 6 bytes long, it is an IPv4 address of 4 +bytes, encoded in network byte order (big endian), followed by a 2 +byte port number (also network byte order). If the string is 18 +bytes long, it is 16 bytes of IPv6 address followed by a 2 bytes +port number (also network byte order).
node-id
The node id written as a readable string as a hexadecimal number.
-

dht_state will return the current state of the dht node, this can be used -to start up the node again, passing this entry to start_dht. It is a good -idea to save this to disk when the session is closed, and read it up again -when starting.

-

If the port the DHT is supposed to listen on is already in use, and exception -is thrown, asio::error.

+

dht_state will return the current state of the dht node, this can +be used to start up the node again, passing this entry to +start_dht. It is a good idea to save this to disk when the session +is closed, and read it up again when starting.

+

If the port the DHT is supposed to listen on is already in use, and +exception is thrown, asio::error.

stop_dht stops the dht node.

-

add_dht_node adds a node to the routing table. This can be used if your -client has its own source of bootstrapping nodes.

-

set_dht_settings sets some parameters availavle to the dht node. See -dht_settings for more information.

-

is_dht_running() returns true if the DHT support has been started and false +

add_dht_node adds a node to the routing table. This can be used if +your client has its own source of bootstrapping nodes.

+

set_dht_settings sets some parameters availavle to the dht node. +See dht_settings for more information.

+

is_dht_running() returns true if the DHT support has been started +and false otherwise.

@@ -1030,24 +1046,23 @@ in the database or the ASN database is not loaded, 0 is returned.

ip_filter get_ip_filter () const; void set_ip_filter (ip_filter const& f); -

Sets a filter that will be used to reject and accept incoming as well as outgoing -connections based on their originating ip address. The default filter will allow -connections to any ip address. To build a set of rules for which addresses are -accepted and not, see ip_filter.

-

Each time a peer is blocked because of the IP filter, a peer_blocked_alert is -generated. -get_ip_filter() Returns the ip_filter currently in the session. See ip_filter.

+

Sets a filter that will be used to reject and accept incoming as well +as outgoing connections based on their originating ip address. The +default filter will allow connections to any ip address. To build a +set of rules for which addresses are accepted and not, see ip_filter.

+

Each time a peer is blocked because of the IP filter, a +peer_blocked_alert is generated. get_ip_filter() Returns the +ip_filter currently in the session. See ip_filter.

set_port_filter()

 void set_port_filter (port_filter const& f);
 
-

apply port_filter f to incoming and outgoing peers. -a port filter will reject making outgoing peer connections -to certain remote ports. The main intention is to be able -to avoid triggering certain anti-virus software by connecting -to SMTP, FTP ports.

+

apply port_filter f to incoming and outgoing peers. a port filter +will reject making outgoing peer connections to certain remote ports. +The main intention is to be able to avoid triggering certain +anti-virus software by connecting to SMTP, FTP ports.

@@ -1083,66 +1098,78 @@ bool is_listening () const; unsigned short listen_port () const; unsigned short ssl_listen_port () const; -

is_listening() will tell you whether or not the session has successfully -opened a listening port. If it hasn't, this function will return false, and -then you can use listen_on() to make another attempt.

-

listen_port() returns the port we ended up listening on. Since you just pass -a port-range to the constructor and to listen_on(), to know which port it -ended up using, you have to ask the session using this function.

-

listen_on() will change the listen port and/or the listen interface. If the -session is already listening on a port, this socket will be closed and a new socket -will be opened with these new settings. The port range is the ports it will try -to listen on, if the first port fails, it will continue trying the next port within -the range and so on. The interface parameter can be left as 0, in that case the -os will decide which interface to listen on, otherwise it should be the ip-address -of the interface you want the listener socket bound to. listen_on() returns the -error code of the operation in ec. If this indicates success, the session is -listening on a port within the specified range. If it fails, it will also -generate an appropriate alert (listen_failed_alert).

-

If all ports in the specified range fails to be opened for listening, libtorrent will -try to use port 0 (which tells the operating system to pick a port that's free). If -that still fails you may see a listen_failed_alert with port 0 even if you didn't -ask to listen on it.

-

It is possible to prevent libtorrent from binding to port 0 by passing in the flag -session::no_system_port in the flags argument.

-

The interface parameter can also be a hostname that will resolve to the device you -want to listen on. If you don't specify an interface, libtorrent may attempt to -listen on multiple interfaces (typically 0.0.0.0 and ::). This means that if your -IPv6 interface doesn't work, you may still see a listen_failed_alert, even though -the IPv4 port succeeded.

-

The flags parameter can either be 0 or session::listen_reuse_address, which -will set the reuse address socket option on the listen socket(s). By default, the -listen socket does not use reuse address. If you're running a service that needs -to run on a specific port no matter if it's in use, set this flag.

-

If you're also starting the DHT, it is a good idea to do that after you've called -listen_on(), since the default listen port for the DHT is the same as the tcp -listen socket. If you start the DHT first, it will assume the tcp port is free and -open the udp socket on that port, then later, when listen_on() is called, it -may turn out that the tcp port is in use. That results in the DHT and the bittorrent -socket listening on different ports. If the DHT is active when listen_on is -called, the udp port will be rebound to the new port, if it was configured to use -the same port as the tcp socket, and if the listen_on call failed to bind to the -same port that the udp uses.

-

If you want the OS to pick a port for you, pass in 0 as both first and second.

-

The reason why it's a good idea to run the DHT and the bittorrent socket on the same -port is because that is an assumption that may be used to increase performance. One -way to accelerate the connecting of peers on windows may be to first ping all peers -with a DHT ping packet, and connect to those that responds first. On windows one -can only connect to a few peers at a time because of a built in limitation (in XP -Service pack 2).

+

is_listening() will tell you whether or not the session has +successfully opened a listening port. If it hasn't, this function will +return false, and then you can use listen_on() to make another +attempt.

+

listen_port() returns the port we ended up listening on. Since you +just pass a port-range to the constructor and to listen_on(), to +know which port it ended up using, you have to ask the session using +this function.

+

listen_on() will change the listen port and/or the listen +interface. If the session is already listening on a port, this socket +will be closed and a new socket will be opened with these new +settings. The port range is the ports it will try to listen on, if the +first port fails, it will continue trying the next port within the +range and so on. The interface parameter can be left as 0, in that +case the os will decide which interface to listen on, otherwise it +should be the ip-address of the interface you want the listener socket +bound to. listen_on() returns the error code of the operation in +ec. If this indicates success, the session is listening on a port +within the specified range. If it fails, it will also generate an +appropriate alert (listen_failed_alert).

+

If all ports in the specified range fails to be opened for listening, +libtorrent will try to use port 0 (which tells the operating system to +pick a port that's free). If that still fails you may see a +listen_failed_alert with port 0 even if you didn't ask to listen on +it.

+

It is possible to prevent libtorrent from binding to port 0 by passing +in the flag session::no_system_port in the flags argument.

+

The interface parameter can also be a hostname that will resolve to +the device you want to listen on. If you don't specify an interface, +libtorrent may attempt to listen on multiple interfaces (typically +0.0.0.0 and ::). This means that if your IPv6 interface doesn't work, +you may still see a listen_failed_alert, even though the IPv4 port +succeeded.

+

The flags parameter can either be 0 or +session::listen_reuse_address, which will set the reuse address +socket option on the listen socket(s). By default, the listen socket +does not use reuse address. If you're running a service that needs to +run on a specific port no matter if it's in use, set this flag.

+

If you're also starting the DHT, it is a good idea to do that after +you've called listen_on(), since the default listen port for the +DHT is the same as the tcp listen socket. If you start the DHT first, +it will assume the tcp port is free and open the udp socket on that +port, then later, when listen_on() is called, it may turn out that +the tcp port is in use. That results in the DHT and the bittorrent +socket listening on different ports. If the DHT is active when +listen_on is called, the udp port will be rebound to the new port, +if it was configured to use the same port as the tcp socket, and if +the listen_on call failed to bind to the same port that the udp uses.

+

If you want the OS to pick a port for you, pass in 0 as both first and +second.

+

The reason why it's a good idea to run the DHT and the bittorrent +socket on the same port is because that is an assumption that may be +used to increase performance. One way to accelerate the connecting of +peers on windows may be to first ping all peers with a DHT ping +packet, and connect to those that responds first. On windows one can +only connect to a few peers at a time because of a built in limitation +(in XP Service pack 2).

remove_torrent()

 void remove_torrent (const torrent_handle& h, int options = 0);
 
-

remove_torrent() will close all peer connections associated with the torrent and tell -the tracker that we've stopped participating in the swarm. This operation cannot fail. -When it completes, you will receive a torrent_removed_alert.

-

The optional second argument options can be used to delete all the files downloaded -by this torrent. To do so, pass in the value session::delete_files. The removal -of the torrent is asyncronous, there is no guarantee that adding the same torrent -immediately after it was removed will not throw a libtorrent_exception exception. Once +

remove_torrent() will close all peer connections associated with +the torrent and tell the tracker that we've stopped participating in +the swarm. This operation cannot fail. When it completes, you will +receive a torrent_removed_alert.

+

The optional second argument options can be used to delete all the +files downloaded by this torrent. To do so, pass in the value +session::delete_files. The removal of the torrent is asyncronous, +there is no guarantee that adding the same torrent immediately after +it was removed will not throw a libtorrent_exception exception. Once the torrent is deleted, a torrent_deleted_alert is posted.

@@ -1167,12 +1194,14 @@ options.

void set_proxy (proxy_settings const& s); proxy_settings proxy () const; -

These functions sets and queries the proxy settings to be used for the session.

+

These functions sets and queries the proxy settings to be used for the +session.

For more information on what settings are available for proxies, see proxy_settings. If the session is not in anonymous mode, proxies that -aren't working or fail, will automatically be disabled and packets will -flow without using any proxy. If you want to enforce using a proxy, even when -the proxy doesn't work, enable anonymous_mode in session_settings.

+aren't working or fail, will automatically be disabled and packets +will flow without using any proxy. If you want to enforce using a +proxy, even when the proxy doesn't work, enable anonymous_mode in +session_settings.

@@ -1195,43 +1224,53 @@ void pop_alerts (std::deque<alert*>* alerts); std::auto_ptr<alert> pop_alert (); alert const* wait_for_alert (time_duration max_wait); -

pop_alert() is used to ask the session if any errors or events has occurred. With -set_alert_mask() you can filter which alerts to receive through pop_alert(). -For information about the alert categories, see alerts.

-

pop_alerts() pops all pending alerts in a single call. In high performance environments -with a very high alert churn rate, this can save significant amount of time compared to -popping alerts one at a time. Each call requires one round-trip to the network thread. If -alerts are produced in a higher rate than they can be popped (when popped one at a time) -it's easy to get stuck in an infinite loop, trying to drain the alert queue. Popping the entire -queue at once avoids this problem.

-

However, the pop_alerts function comes with significantly more responsibility. You pass -in an empty std::dequeue<alert*> to it. If it's not empty, all elements in it will -be deleted and then cleared. All currently pending alerts are returned by being swapped -into the passed in container. The responsibility of deleting the alerts is transferred -to the caller. This means you need to call delete for each item in the returned dequeue. -It's probably a good idea to delete the alerts as you handle them, to save one extra -pass over the dequeue.

-

Alternatively, you can pass in the same container the next time you call pop_alerts.

-

wait_for_alert blocks until an alert is available, or for no more than max_wait -time. If wait_for_alert returns because of the time-out, and no alerts are available, -it returns 0. If at least one alert was generated, a pointer to that alert is returned. -The alert is not popped, any subsequent calls to wait_for_alert will return the -same pointer until the alert is popped by calling pop_alert. This is useful for -leaving any alert dispatching mechanism independent of this blocking call, the dispatcher -can be called and it can pop the alert independently.

-

In the python binding, wait_for_alert takes the number of milliseconds to wait as an integer.

+

pop_alert() is used to ask the session if any errors or events has +occurred. With set_alert_mask() you can filter which alerts to receive +through pop_alert(). For information about the alert categories, +see alerts.

+

pop_alerts() pops all pending alerts in a single call. In high +performance environments with a very high alert churn rate, this can +save significant amount of time compared to popping alerts one at a +time. Each call requires one round-trip to the network thread. If +alerts are produced in a higher rate than they can be popped (when +popped one at a time) it's easy to get stuck in an infinite loop, +trying to drain the alert queue. Popping the entire queue at once +avoids this problem.

+

However, the pop_alerts function comes with significantly more +responsibility. You pass in an empty std::dequeue<alert*> to it. +If it's not empty, all elements in it will be deleted and then +cleared. All currently pending alerts are returned by being swapped +into the passed in container. The responsibility of deleting the +alerts is transferred to the caller. This means you need to call +delete for each item in the returned dequeue. It's probably a good +idea to delete the alerts as you handle them, to save one extra pass +over the dequeue.

+

Alternatively, you can pass in the same container the next time you +call pop_alerts.

+

wait_for_alert blocks until an alert is available, or for no more +than max_wait time. If wait_for_alert returns because of the +time-out, and no alerts are available, it returns 0. If at least one +alert was generated, a pointer to that alert is returned. The alert is +not popped, any subsequent calls to wait_for_alert will return the +same pointer until the alert is popped by calling pop_alert. This +is useful for leaving any alert dispatching mechanism independent of +this blocking call, the dispatcher can be called and it can pop the +alert independently.

+

In the python binding, wait_for_alert takes the number of +milliseconds to wait as an integer.

To control the max number of alerts that's queued by the session, see session_settings::alert_queue_size.

-

save_resume_data_alert and save_resume_data_failed_alert are always posted, regardelss -of the alert mask.

+

save_resume_data_alert and save_resume_data_failed_alert are always +posted, regardelss of the alert mask.

set_alert_mask()

 void set_alert_mask (boost::uint32_t m);
 
-

Changes the mask of which alerts to receive. By default only errors are reported. -m is a bitmask where each bit represents a category of alerts.

+

Changes the mask of which alerts to receive. By default only errors +are reported. m is a bitmask where each bit represents a category +of alerts.

See category_t enum for options.

@@ -1239,12 +1278,14 @@ void set_alert_mask (boost::uint32_t m);
 void set_alert_dispatch (boost::function<void(std::auto_ptr<alert>)> const& fun);
 
-

This sets a function to be called (from within libtorrent's netowrk thread) every time an alert -is posted. Since the function (fun) is run in libtorrent's internal thread, it may not call -any of libtorrent's external API functions. Doing so results in a dead lock.

-

The main intention with this function is to support integration with platform-dependent message -queues or signalling systems. For instance, on windows, one could post a message to an HNWD or -on linux, write to a pipe or an eventfd.

+

This sets a function to be called (from within libtorrent's netowrk +thread) every time an alert is posted. Since the function (fun) is +run in libtorrent's internal thread, it may not call any of +libtorrent's external API functions. Doing so results in a dead lock.

+

The main intention with this function is to support integration with +platform-dependent message queues or signalling systems. For instance, +on windows, one could post a message to an HNWD or on linux, write to +a pipe or an eventfd.

@@ -1265,12 +1306,13 @@ look for peers on the same swarm within multicast reach.

void stop_upnp (); void start_upnp (); -

Starts and stops the UPnP service. When started, the listen port and the DHT -port are attempted to be forwarded on local UPnP router devices.

-

The upnp object returned by start_upnp() can be used to add and remove -arbitrary port mappings. Mapping status is returned through the -portmap_alert and the portmap_error_alert. The object will be valid until -stop_upnp() is called. See upnp and nat pmp.

+

Starts and stops the UPnP service. When started, the listen port and +the DHT port are attempted to be forwarded on local UPnP router +devices.

+

The upnp object returned by start_upnp() can be used to add and +remove arbitrary port mappings. Mapping status is returned through the +portmap_alert and the portmap_error_alert. The object will be valid +until stop_upnp() is called. See upnp and nat pmp.

It is off by default.

@@ -1281,8 +1323,8 @@ void delete_port_mapping (int handle); int add_port_mapping (protocol_type t, int external_port, int local_port);

add_port_mapping adds a port forwarding on UPnP and/or NAT-PMP, -whichever is enabled. The return value is a handle referring to -the port mapping that was just created. Pass it to delete_port_mapping() +whichever is enabled. The return value is a handle referring to the +port mapping that was just created. Pass it to delete_port_mapping() to remove it.

@@ -1292,12 +1334,13 @@ to remove it.

void stop_natpmp (); void start_natpmp (); -

Starts and stops the NAT-PMP service. When started, the listen port and the DHT -port are attempted to be forwarded on the router through NAT-PMP.

-

The natpmp object returned by start_natpmp() can be used to add and remove -arbitrary port mappings. Mapping status is returned through the -portmap_alert and the portmap_error_alert. The object will be valid until -stop_natpmp() is called. See upnp and nat pmp.

+

Starts and stops the NAT-PMP service. When started, the listen port +and the DHT port are attempted to be forwarded on the router through +NAT-PMP.

+

The natpmp object returned by start_natpmp() can be used to add +and remove arbitrary port mappings. Mapping status is returned through +the portmap_alert and the portmap_error_alert. The object will be +valid until stop_natpmp() is called. See upnp and nat pmp.

It is off by default.

diff --git a/docs/reference-Settings.html b/docs/reference-Settings.html index 6657f7ff2..b36bb0085 100644 --- a/docs/reference-Settings.html +++ b/docs/reference-Settings.html @@ -55,8 +55,8 @@
@@ -89,7 +89,15 @@ struct proxy_settings bool proxy_peer_connections; }; -
+
+

proxy_settings()

+
+proxy_settings ();
+
+

defaults constructs proxy settings, initializing it to the default +settings.

+
+

enum proxy_type

Declared in "libtorrent/session_settings.hpp"

@@ -151,6 +159,12 @@ user authorization. The username and password will be sent to the proxy. port number the proxy listens to. If required, username and password can be set to authenticate with the proxy. + +
+
username password
+
when using a proy type that requires authentication, the username +and password fields must be set to the credentials for the proxy.
+
type
tells libtorrent what kind of proxy server it is. See proxy_type @@ -402,7 +416,17 @@ struct session_settings bool use_disk_cache_pool; }; -
+ +
+

~session_settings() session_settings()

+
+session_settings (std::string const& user_agent = "libtorrent/"
+      LIBTORRENT_VERSION);
+~session_settings ();
+
+

initializes the session_settings to the default settings.

+
+

enum suggest_mode_t

Declared in "libtorrent/session_settings.hpp"

@@ -1904,22 +1928,26 @@ is low. session_settings min_memory_usage (); session_settings high_performance_seed (); -

The default values of the session settings are set for a regular bittorrent client running -on a desktop system. There are functions that can set the session settings to pre set -settings for other environments. These can be used for the basis, and should be tweaked to -fit your needs better.

-

min_memory_usage returns settings that will use the minimal amount of RAM, at the -potential expense of upload and download performance. It adjusts the socket buffer sizes, -disables the disk cache, lowers the send buffer watermarks so that each connection only has -at most one block in use at any one time. It lowers the outstanding blocks send to the disk -I/O thread so that connections only have one block waiting to be flushed to disk at any given -time. It lowers the max number of peers in the peer list for torrents. It performs multiple -smaller reads when it hashes pieces, instead of reading it all into memory before hashing.

-

This configuration is inteded to be the starting point for embedded devices. It will -significantly reduce memory usage.

-

high_performance_seed returns settings optimized for a seed box, serving many peers -and that doesn't do any downloading. It has a 128 MB disk cache and has a limit of 400 files -in its file pool. It support fast upload rates by allowing large send buffers.

+

The default values of the session settings are set for a regular +bittorrent client running on a desktop system. There are functions that +can set the session settings to pre set settings for other environments. +These can be used for the basis, and should be tweaked to fit your needs +better.

+

min_memory_usage returns settings that will use the minimal amount of +RAM, at the potential expense of upload and download performance. It +adjusts the socket buffer sizes, disables the disk cache, lowers the send +buffer watermarks so that each connection only has at most one block in +use at any one time. It lowers the outstanding blocks send to the disk +I/O thread so that connections only have one block waiting to be flushed +to disk at any given time. It lowers the max number of peers in the peer +list for torrents. It performs multiple smaller reads when it hashes +pieces, instead of reading it all into memory before hashing.

+

This configuration is inteded to be the starting point for embedded +devices. It will significantly reduce memory usage.

+

high_performance_seed returns settings optimized for a seed box, +serving many peers and that doesn't do any downloading. It has a 128 MB +disk cache and has a limit of 400 files in its file pool. It support fast +upload rates by allowing large send buffers.

diff --git a/docs/todo.html b/docs/todo.html index dd9f7cd32..3eac8d2d6 100644 --- a/docs/todo.html +++ b/docs/todo.html @@ -1099,7 +1099,7 @@ use allocate_disk_receive_buffer and release_disk_receive_buffer

../incl }; } -

relevance 0../src/bt_peer_connection.cpp:639this could be optimized using knuth morris pratt
relevance 0../src/bt_peer_connection.cpp:638this could be optimized using knuth morris pratt
relevance 0../src/bt_peer_connection.cpp:2108if we're finished, send upload_only message
relevance 0../src/bt_peer_connection.cpp:2107if we're finished, send upload_only message
relevance 0../src/bt_peer_connection.cpp:3352move the erasing into the loop above remove all payload ranges that has been sent
relevance 0../src/bt_peer_connection.cpp:3351move the erasing into the loop above remove all payload ranges that has been sent