│ │ │ │ +
settings_pack
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │ +
The settings_pack struct, contains the names of all settings as
│ │ │ │ +enum values. These values are passed in to the set_str(),
│ │ │ │ +set_int(), set_bool() functions, to specify the setting to
│ │ │ │ +change.
│ │ │ │ +
The settings_pack only stores values for settings that have been
│ │ │ │ +explicitly set on this object. However, it can still be queried for
│ │ │ │ +settings that have not been set and returns the default value for those
│ │ │ │ +settings.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +user_agent |
│ │ │ │ +string |
│ │ │ │ +libtorrent/ |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
this is the client identification to the tracker. The recommended
│ │ │ │ +format of this string is: "client-name/client-version
│ │ │ │ +libtorrent/libtorrent-version". This name will not only be used when
│ │ │ │ +making HTTP requests, but also when sending extended headers to
│ │ │ │ +peers that support that extension. It may not contain r or n
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +announce_ip |
│ │ │ │ +string |
│ │ │ │ +nullptr |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
announce_ip is the ip address passed along to trackers as the
│ │ │ │ +&ip= parameter. If left as the default, that parameter is
│ │ │ │ +omitted.
│ │ │ │ +
│ │ │ │ +
Note
│ │ │ │ +
This setting is only meant for very special cases where a seed is
│ │ │ │ +running on the same host as the tracker, and the tracker accepts
│ │ │ │ +the IP parameter (which normal trackers don't). Do not set this
│ │ │ │ +option unless you also control the tracker.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +handshake_client_version |
│ │ │ │ +string |
│ │ │ │ +nullptr |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
this is the client name and version identifier sent to peers in the
│ │ │ │ +handshake message. If this is an empty string, the user_agent is
│ │ │ │ +used instead. This string must be a UTF-8 encoded unicode string.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +outgoing_interfaces |
│ │ │ │ +string |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
This controls which IP address outgoing TCP peer connections are bound
│ │ │ │ +to, in addition to controlling whether such connections are also
│ │ │ │ +bound to a specific network interface/adapter (bind-to-device).
│ │ │ │ +
This string is a comma-separated list of IP addresses and
│ │ │ │ +interface names. An empty string will not bind TCP sockets to a
│ │ │ │ +device, and let the network stack assign the local address.
│ │ │ │ +
A list of names will be used to bind outgoing TCP sockets in a
│ │ │ │ +round-robin fashion. An IP address will simply be used to bind()
│ │ │ │ +the socket. An interface name will attempt to bind the socket to
│ │ │ │ +that interface. If that fails, or is unsupported, one of the IP
│ │ │ │ +addresses configured for that interface is used to bind() the
│ │ │ │ +socket to. If the interface or adapter doesn't exist, the
│ │ │ │ +outgoing peer connection will fail with an error message suggesting
│ │ │ │ +the device cannot be found. Adapter names on Unix systems are of
│ │ │ │ +the form "eth0", "eth1", "tun0", etc. This may be useful for
│ │ │ │ +clients that are multi-homed. Binding an outgoing connection to a
│ │ │ │ +local IP does not necessarily make the connection via the
│ │ │ │ +associated NIC/Adapter.
│ │ │ │ +
When outgoing interfaces are specified, incoming connections or
│ │ │ │ +packets sent to a local interface or IP that's not in this list
│ │ │ │ +will be rejected with a peer_blocked_alert with
│ │ │ │ +invalid_local_interface as the reason.
│ │ │ │ +
Note that these are just interface/adapter names or IP addresses.
│ │ │ │ +There are no ports specified in this list. IPv6 addresses without
│ │ │ │ +port should be specified without enclosing [, ].
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +listen_interfaces |
│ │ │ │ +string |
│ │ │ │ +0.0.0.0:6881,[::]:6881 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
a comma-separated list of (IP or device name, port) pairs. These are
│ │ │ │ +the listen ports that will be opened for accepting incoming uTP and
│ │ │ │ +TCP peer connections. These are also used for outgoing uTP and UDP
│ │ │ │ +tracker connections and DHT nodes.
│ │ │ │ +
It is possible to listen on multiple interfaces and
│ │ │ │ +multiple ports. Binding to port 0 will make the operating system
│ │ │ │ +pick the port.
│ │ │ │ +
│ │ │ │ +
Note
│ │ │ │ +
There are reasons to stick to the same port across sessions,
│ │ │ │ +which would mean only using port 0 on the first start, and
│ │ │ │ +recording the port that was picked for subsequent startups.
│ │ │ │ +Trackers, the DHT and other peers will remember the port they see
│ │ │ │ +you use and hand that port out to other peers trying to connect
│ │ │ │ +to you, as well as trying to connect to you themselves.
│ │ │ │ +
│ │ │ │ +
A port that has an "s" suffix will accept SSL peer connections. (note
│ │ │ │ +that SSL sockets are only available in builds with SSL support)
│ │ │ │ +
A port that has an "l" suffix will be considered a local network.
│ │ │ │ +i.e. it's assumed to only be able to reach hosts in the same local
│ │ │ │ +network as the IP address (based on the netmask associated with the
│ │ │ │ +IP, queried from the operating system).
│ │ │ │ +
if binding fails, the listen_failed_alert is posted. Once a
│ │ │ │ +socket binding succeeds (if it does), the listen_succeeded_alert
│ │ │ │ +is posted. There may be multiple failures before a success.
│ │ │ │ +
If a device name that does not exist is configured, no listen
│ │ │ │ +socket will be opened for that interface. If this is the only
│ │ │ │ +interface configured, it will be as if no listen ports are
│ │ │ │ +configured.
│ │ │ │ +
If no listen ports are configured (e.g. listen_interfaces is an
│ │ │ │ +empty string), networking will be disabled. No DHT will start, no
│ │ │ │ +outgoing uTP or tracker connections will be made. No incoming TCP
│ │ │ │ +or uTP connections will be accepted. (outgoing TCP connections
│ │ │ │ +will still be possible, depending on
│ │ │ │ +settings_pack::outgoing_interfaces).
│ │ │ │ +
For example:
│ │ │ │ +[::1]:8888 - will only accept connections on the IPv6 loopback
│ │ │ │ +address on port 8888.
│ │ │ │ +
eth0:4444,eth1:4444 - will accept connections on port 4444 on
│ │ │ │ +any IP address bound to device eth0 or eth1.
│ │ │ │ +
[::]:0s - will accept SSL connections on a port chosen by the
│ │ │ │ +OS. And not accept non-SSL connections at all.
│ │ │ │ +
0.0.0.0:6881,[::]:6881 - binds to all interfaces on port 6881.
│ │ │ │ +
10.0.1.13:6881l - binds to the local IP address, port 6881, but
│ │ │ │ +only allow talking to peers on the same local network. The netmask
│ │ │ │ +is queried from the operating system. Interfaces marked l are
│ │ │ │ +not announced to trackers, unless the tracker is also on the same
│ │ │ │ +local network.
│ │ │ │ +
Windows OS network adapter device name must be specified with GUID.
│ │ │ │ +It can be obtained from "netsh lan show interfaces" command output.
│ │ │ │ +GUID must be uppercased string embraced in curly brackets.
│ │ │ │ +{E4F0B674-0DFC-48BB-98A5-2AA730BDB6D6}:7777 - will accept
│ │ │ │ +connections on port 7777 on adapter with this GUID.
│ │ │ │ +
For more information, see the Multi-homed hosts section.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +proxy_hostname |
│ │ │ │ +string |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when using a proxy, this is the hostname where the proxy is running
│ │ │ │ +see proxy_type. Note that when using a proxy, the
│ │ │ │ +settings_pack::listen_interfaces setting is overridden and only a
│ │ │ │ +single interface is created, just to contact the proxy. This
│ │ │ │ +means a proxy cannot be combined with SSL torrents or multiple
│ │ │ │ +listen interfaces. This proxy listen interface will not accept
│ │ │ │ +incoming TCP connections, will not map ports with any gateway and
│ │ │ │ +will not enable local service discovery. All traffic is supposed
│ │ │ │ +to be channeled through the proxy.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +proxy_username |
│ │ │ │ +string |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +proxy_password |
│ │ │ │ +string |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when using a proxy, these are the credentials (if any) to use when
│ │ │ │ +connecting to it. see proxy_type
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +i2p_hostname |
│ │ │ │ +string |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
sets the i2p SAM bridge to connect to. set the port with the
│ │ │ │ +i2p_port setting. Unless this is set, i2p torrents are not
│ │ │ │ +supported. This setting is separate from the other proxy settings
│ │ │ │ +since i2p torrents and their peers are orthogonal. You can have
│ │ │ │ +i2p peers as well as regular peers via a proxy.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +peer_fingerprint |
│ │ │ │ +string |
│ │ │ │ +-LT20B0- |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
this is the fingerprint for the client. It will be used as the
│ │ │ │ +prefix to the peer_id. If this is 20 bytes (or longer) it will be
│ │ │ │ +truncated to 20 bytes and used as the entire peer-id
│ │ │ │ +
There is a utility function, generate_fingerprint() that can be used
│ │ │ │ +to generate a standard client peer ID fingerprint prefix.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_bootstrap_nodes |
│ │ │ │ +string |
│ │ │ │ +dht.libtorrent.org:25401 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
This is a comma-separated list of IP port-pairs. They will be added
│ │ │ │ +to the DHT node (if it's enabled) as back-up nodes in case we don't
│ │ │ │ +know of any.
│ │ │ │ +
Changing these after the DHT has been started may not have any
│ │ │ │ +effect until the DHT is restarted.
│ │ │ │ +Here are some other bootstrap nodes that may work:
│ │ │ │ +router.bittorrent.com:6881,
│ │ │ │ +dht.transmissionbt.com:6881
│ │ │ │ +router.bt.ouinet.work:6881,
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +allow_multiple_connections_per_ip |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
determines if connections from the same IP address as existing
│ │ │ │ +connections should be rejected or not. Rejecting multiple connections
│ │ │ │ +from the same IP address will prevent abusive
│ │ │ │ +behavior by peers. The logic for determining whether connections are
│ │ │ │ +to the same peer is more complicated with this enabled, and more
│ │ │ │ +likely to fail in some edge cases. It is not recommended to enable
│ │ │ │ +this feature.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +send_redundant_have |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
send_redundant_have controls if have messages will be sent to
│ │ │ │ +peers that already have the piece. This is typically not necessary,
│ │ │ │ +but it might be necessary for collecting statistics in some cases.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +use_dht_as_fallback |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
use_dht_as_fallback determines how the DHT is used. If this is
│ │ │ │ +true, the DHT will only be used for torrents where all trackers in
│ │ │ │ +its tracker list has failed. Either by an explicit error message or
│ │ │ │ +a time out. If this is false, the DHT is used regardless of if the
│ │ │ │ +trackers fail or not.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +upnp_ignore_nonrouters |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
upnp_ignore_nonrouters indicates whether or not the UPnP
│ │ │ │ +implementation should ignore any broadcast response from a device
│ │ │ │ +whose address is not on our subnet. i.e.
│ │ │ │ +it's a way to not talk to other people's routers by mistake.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +use_parole_mode |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
use_parole_mode specifies if parole mode should be used. Parole
│ │ │ │ +mode means that peers that participate in pieces that fail the hash
│ │ │ │ +check are put in a mode where they are only allowed to download
│ │ │ │ +whole pieces. If the whole piece a peer in parole mode fails the
│ │ │ │ +hash check, it is banned. If a peer participates in a piece that
│ │ │ │ +passes the hash check, it is taken out of parole mode.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +auto_manage_prefer_seeds |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if true, prefer seeding torrents when determining which torrents to give
│ │ │ │ +active slots to. If false, give preference to downloading torrents
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dont_count_slow_torrents |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if dont_count_slow_torrents is true, torrents without any
│ │ │ │ +payload transfers are not subject to the active_seeds and
│ │ │ │ +active_downloads limits. This is intended to make it more
│ │ │ │ +likely to utilize all available bandwidth, and avoid having
│ │ │ │ +torrents that don't transfer anything block the active slots.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +close_redundant_connections |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
close_redundant_connections specifies whether libtorrent should
│ │ │ │ +close connections where both ends have no utility in keeping the
│ │ │ │ +connection open. For instance if both ends have completed their
│ │ │ │ +downloads, there's no point in keeping it open.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +prioritize_partial_pieces |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
If prioritize_partial_pieces is true, partial pieces are picked
│ │ │ │ +before pieces that are more rare. If false, rare pieces are always
│ │ │ │ +prioritized, unless the number of partial pieces is growing out of
│ │ │ │ +proportion.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +rate_limit_ip_overhead |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if set to true, the estimated TCP/IP overhead is drained from the
│ │ │ │ +rate limiters, to avoid exceeding the limits with the total traffic
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +announce_to_all_tiers |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +announce_to_all_trackers |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
announce_to_all_trackers controls how multi tracker torrents
│ │ │ │ +are treated. If this is set to true, all trackers in the same tier
│ │ │ │ +are announced to in parallel. If all trackers in tier 0 fails, all
│ │ │ │ +trackers in tier 1 are announced as well. If it's set to false, the
│ │ │ │ +behavior is as defined by the multi tracker specification.
│ │ │ │ +
announce_to_all_tiers also controls how multi tracker torrents
│ │ │ │ +are treated. When this is set to true, one tracker from each tier
│ │ │ │ +is announced to. This is the uTorrent behavior. To be compliant
│ │ │ │ +with the Multi-tracker specification, set it to false.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +prefer_udp_trackers |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
prefer_udp_trackers: true means that trackers
│ │ │ │ +may be rearranged in a way that udp trackers are always tried
│ │ │ │ +before http trackers for the same hostname. Setting this to false
│ │ │ │ +means that the tracker's tier is respected and there's no
│ │ │ │ +preference of one protocol over another.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +disable_hash_checks |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when set to true, all data downloaded from peers will be assumed to
│ │ │ │ +be correct, and not tested to match the hashes in the torrent this
│ │ │ │ +is only useful for simulation and testing purposes (typically
│ │ │ │ +combined with disabled_storage)
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +allow_i2p_mixed |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if this is true, i2p torrents are allowed to also get peers from
│ │ │ │ +other sources than the tracker, and connect to regular IPs, not
│ │ │ │ +providing any anonymization. This may be useful if the user is not
│ │ │ │ +interested in the anonymization of i2p, but still wants to be able
│ │ │ │ +to connect to i2p peers.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +no_atime_storage |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
no_atime_storage this is a Linux-only option and passes in the
│ │ │ │ +O_NOATIME to open() when opening files. This may lead to
│ │ │ │ +some disk performance improvements.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +incoming_starts_queued_torrents |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
incoming_starts_queued_torrents. If a torrent
│ │ │ │ +has been paused by the auto managed feature in libtorrent, i.e. the
│ │ │ │ +torrent is paused and auto managed, this feature affects whether or
│ │ │ │ +not it is automatically started on an incoming connection. The main
│ │ │ │ +reason to queue torrents, is not to make them unavailable, but to
│ │ │ │ +save on the overhead of announcing to the trackers, the DHT and to
│ │ │ │ +avoid spreading one's unchoke slots too thin. If a peer managed to
│ │ │ │ +find us, even though we're no in the torrent anymore, this setting
│ │ │ │ +can make us start the torrent and serve it.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +report_true_downloaded |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when set to true, the downloaded counter sent to trackers will
│ │ │ │ +include the actual number of payload bytes downloaded including
│ │ │ │ +redundant bytes. If set to false, it will not include any redundancy
│ │ │ │ +bytes
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +strict_end_game_mode |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
strict_end_game_mode controls when a
│ │ │ │ +block may be requested twice. If this is true, a block may only
│ │ │ │ +be requested twice when there's at least one request to every piece
│ │ │ │ +that's left to download in the torrent. This may slow down progress
│ │ │ │ +on some pieces sometimes, but it may also avoid downloading a lot
│ │ │ │ +of redundant bytes. If this is false, libtorrent attempts to
│ │ │ │ +use each peer connection to its max, by always requesting
│ │ │ │ +something, even if it means requesting something that has been
│ │ │ │ +requested from another peer already.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +enable_outgoing_utp |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +enable_incoming_utp |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +enable_outgoing_tcp |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +enable_incoming_tcp |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
Enables incoming and outgoing, TCP and uTP peer connections.
│ │ │ │ +false is disabled and true is enabled. When outgoing
│ │ │ │ +connections are disabled, libtorrent will simply not make
│ │ │ │ +outgoing peer connections with the specific transport protocol.
│ │ │ │ +Disabled incoming peer connections will simply be rejected.
│ │ │ │ +These options only apply to peer connections, not tracker- or any
│ │ │ │ +other kinds of connections.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +no_recheck_incomplete_resume |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
no_recheck_incomplete_resume determines if the storage should
│ │ │ │ +check the whole files when resume data is incomplete or missing or
│ │ │ │ +whether it should simply assume we don't have any of the data. If
│ │ │ │ +false, any existing files will be checked.
│ │ │ │ +By setting this setting to true, the files won't be checked, but
│ │ │ │ +will go straight to download mode.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +anonymous_mode |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
anonymous_mode: When set to true, the client tries to hide
│ │ │ │ +its identity to a certain degree.
│ │ │ │ +
│ │ │ │ +- A generic user-agent will be
│ │ │ │ +used for trackers (except for private torrents).
│ │ │ │ +- Your local IPv4 and IPv6 address won't be sent as query string
│ │ │ │ +parameters to private trackers.
│ │ │ │ +- If announce_ip is configured, it will not be sent to trackers
│ │ │ │ +- The client version will not be sent to peers in the extension
│ │ │ │ +handshake.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +report_web_seed_downloads |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
specifies whether downloads from web seeds is reported to the
│ │ │ │ +tracker or not. Turning it off also excludes web
│ │ │ │ +seed traffic from other stats and download rate reporting via the
│ │ │ │ +libtorrent API.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +seeding_outgoing_connections |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
seeding_outgoing_connections determines if seeding (and
│ │ │ │ +finished) torrents should attempt to make outgoing connections or
│ │ │ │ +not. It may be set to false in very
│ │ │ │ +specific applications where the cost of making outgoing connections
│ │ │ │ +is high, and there are no or small benefits of doing so. For
│ │ │ │ +instance, if no nodes are behind a firewall or a NAT, seeds don't
│ │ │ │ +need to make outgoing connections.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +no_connect_privileged_ports |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when this is true, libtorrent will not attempt to make outgoing
│ │ │ │ +connections to peers whose port is < 1024. This is a safety
│ │ │ │ +precaution to avoid being part of a DDoS attack
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +smooth_connects |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
smooth_connects means the number of
│ │ │ │ +connection attempts per second may be limited to below the
│ │ │ │ +connection_speed, in case we're close to bump up against the
│ │ │ │ +limit of number of connections. The intention of this setting is to
│ │ │ │ +more evenly distribute our connection attempts over time, instead
│ │ │ │ +of attempting to connect in batches, and timing them out in
│ │ │ │ +batches.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +always_send_user_agent |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
always send user-agent in every web seed request. If false, only
│ │ │ │ +the first request per http connection will include the user agent
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +apply_ip_filter_to_trackers |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
apply_ip_filter_to_trackers determines
│ │ │ │ +whether the IP filter applies to trackers as well as peers. If this
│ │ │ │ +is set to false, trackers are exempt from the IP filter (if there
│ │ │ │ +is one). If no IP filter is set, this setting is irrelevant.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +ban_web_seeds |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when true, web seeds sending bad data will be banned
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +support_share_mode |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if false, prevents libtorrent to advertise share-mode support
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +report_redundant_bytes |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if this is true, the number of redundant bytes is sent to the
│ │ │ │ +tracker
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +listen_system_port_fallback |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if this is true, libtorrent will fall back to listening on a port
│ │ │ │ +chosen by the operating system (i.e. binding to port 0). If a
│ │ │ │ +failure is preferred, set this to false.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +announce_crypto_support |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when this is true, and incoming encrypted connections are enabled,
│ │ │ │ +&supportcrypt=1 is included in http tracker announces
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +enable_upnp |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
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.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +enable_natpmp |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
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.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +enable_lsd |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
Starts and stops Local Service Discovery. This service will
│ │ │ │ +broadcast the info-hashes of all the non-private torrents on the
│ │ │ │ +local network to look for peers on the same swarm within multicast
│ │ │ │ +reach.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +enable_dht |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
starts the dht node and makes the trackerless service available to
│ │ │ │ +torrents.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +prefer_rc4 |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if the allowed encryption level is both, setting this to true will
│ │ │ │ +prefer RC4 if both methods are offered, plain text otherwise
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +proxy_hostnames |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if true, hostname lookups are done via the configured proxy (if
│ │ │ │ +any). This is only supported by SOCKS5 and HTTP.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +proxy_peer_connections |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if true, peer connections are made (and accepted) over the
│ │ │ │ +configured proxy, if any. Web seeds as well as regular bittorrent
│ │ │ │ +peer connections are considered "peer connections". Anything
│ │ │ │ +transporting actual torrent payload (trackers and DHT traffic are
│ │ │ │ +not considered peer connections).
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +auto_sequential |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if this setting is true, torrents with a very high availability of
│ │ │ │ +pieces (and seeds) are downloaded sequentially. This is more
│ │ │ │ +efficient for the disk I/O. With many seeds, the download order is
│ │ │ │ +unlikely to matter anyway
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +proxy_tracker_connections |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if true, tracker connections are made over the configured proxy, if
│ │ │ │ +any.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +enable_ip_notifier |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
Starts and stops the internal IP table route changes notifier.
│ │ │ │ +
The current implementation supports multiple platforms, and it is
│ │ │ │ +recommended to have it enable, but you may want to disable it if
│ │ │ │ +it's supported but unreliable, or if you have a better way to
│ │ │ │ +detect the changes. In the later case, you should manually call
│ │ │ │ +session_handle::reopen_network_sockets to ensure network
│ │ │ │ +changes are taken in consideration.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_prefer_verified_node_ids |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when this is true, nodes whose IDs are derived from their source
│ │ │ │ +IP according to BEP 42 are preferred in the routing table.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_restrict_routing_ips |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
determines if the routing table entries should restrict entries to one
│ │ │ │ +per IP. This defaults to true, which helps mitigate some attacks on
│ │ │ │ +the DHT. It prevents adding multiple nodes with IPs with a very close
│ │ │ │ +CIDR distance.
│ │ │ │ +
when set, nodes whose IP address that's in the same /24 (or /64 for
│ │ │ │ +IPv6) range in the same routing table bucket. This is an attempt to
│ │ │ │ +mitigate node ID spoofing attacks also restrict any IP to only have a
│ │ │ │ +single entry in the whole routing table
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_restrict_search_ips |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
determines if DHT searches should prevent adding nodes with IPs with
│ │ │ │ +very close CIDR distance. This also defaults to true and helps
│ │ │ │ +mitigate certain attacks on the DHT.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_extended_routing_table |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
makes the first buckets in the DHT routing table fit 128, 64, 32 and
│ │ │ │ +16 nodes respectively, as opposed to the standard size of 8. All other
│ │ │ │ +buckets have size 8 still.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_aggressive_lookups |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
slightly changes the lookup behavior in terms of how many outstanding
│ │ │ │ +requests we keep. Instead of having branch factor be a hard limit, we
│ │ │ │ +always keep branch factor outstanding requests to the closest nodes.
│ │ │ │ +i.e. every time we get results back with closer nodes, we query them
│ │ │ │ +right away. It lowers the lookup times at the cost of more outstanding
│ │ │ │ +queries.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_privacy_lookups |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when set, perform lookups in a way that is slightly more expensive,
│ │ │ │ +but which minimizes the amount of information leaked about you.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_enforce_node_id |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when set, node's whose IDs that are not correctly generated based on
│ │ │ │ +its external IP are ignored. When a query arrives from such node, an
│ │ │ │ +error message is returned with a message saying "invalid node ID".
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_ignore_dark_internet |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
ignore DHT messages from parts of the internet we wouldn't expect to
│ │ │ │ +see any traffic from
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_read_only |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when set, the other nodes won't keep this node in their routing
│ │ │ │ +tables, it's meant for low-power and/or ephemeral devices that
│ │ │ │ +cannot support the DHT, it is also useful for mobile devices which
│ │ │ │ +are sensitive to network traffic and battery life.
│ │ │ │ +this node no longer responds to 'query' messages, and will place a
│ │ │ │ +'ro' key (value = 1) in the top-level message dictionary of outgoing
│ │ │ │ +query messages.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +piece_extent_affinity |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when this is true, create an affinity for downloading 4 MiB extents
│ │ │ │ +of adjacent pieces. This is an attempt to achieve better disk I/O
│ │ │ │ +throughput by downloading larger extents of bytes, for torrents with
│ │ │ │ +small piece sizes
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +validate_https_trackers |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when set to true, the certificate of HTTPS trackers and HTTPS web
│ │ │ │ +seeds will be validated against the system's certificate store
│ │ │ │ +(as defined by OpenSSL). If the system does not have a
│ │ │ │ +certificate store, this option may have to be disabled in order
│ │ │ │ +to get trackers and web seeds to work).
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +ssrf_mitigation |
│ │ │ │ +bool |
│ │ │ │ +true |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when enabled, tracker and web seed requests are subject to
│ │ │ │ +certain restrictions.
│ │ │ │ +
An HTTP(s) tracker requests to localhost (loopback)
│ │ │ │ +must have the request path start with "/announce". This is the
│ │ │ │ +conventional bittorrent tracker request. Any other HTTP(S)
│ │ │ │ +tracker request to loopback will be rejected. This applies to
│ │ │ │ +trackers that redirect to loopback as well.
│ │ │ │ +
Web seeds that end up on the client's local network (i.e. in a
│ │ │ │ +private IP address range) may not include query string arguments.
│ │ │ │ +This applies to web seeds redirecting to the local network as
│ │ │ │ +well.
│ │ │ │ +
Web seeds on global IPs (i.e. not local network) may not redirect
│ │ │ │ +to a local network address
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +allow_idna |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when disabled, any tracker or web seed with an IDNA hostname
│ │ │ │ +(internationalized domain name) is ignored. This is a security
│ │ │ │ +precaution to avoid various unicode encoding attacks that might
│ │ │ │ +happen at the application level.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +enable_set_file_valid_data |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when set to true, enables the attempt to use SetFileValidData()
│ │ │ │ +to pre-allocate disk space. This system call will only work when
│ │ │ │ +running with Administrator privileges on Windows, and so this
│ │ │ │ +setting is only relevant in that scenario. Using
│ │ │ │ +SetFileValidData() poses a security risk, as it may reveal
│ │ │ │ +previously deleted information from the disk.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +socks5_udp_send_local_ep |
│ │ │ │ +bool |
│ │ │ │ +false |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
When using a SOCKS5 proxy, UDP traffic is routed through the
│ │ │ │ +proxy by sending a UDP ASSOCIATE command. If this option is true,
│ │ │ │ +the UDP ASSOCIATE command will include the IP address and
│ │ │ │ +listen port to the local UDP socket. This indicates to the proxy
│ │ │ │ +which source endpoint to expect our packets from. The benefit is
│ │ │ │ +that incoming packets can be forwarded correctly, before any
│ │ │ │ +outgoing packets are sent. The risk is that if there's a NAT
│ │ │ │ +between the client and the proxy, the IP address specified in the
│ │ │ │ +protocol may not be valid from the proxy's point of view.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +tracker_completion_timeout |
│ │ │ │ +int |
│ │ │ │ +30 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
tracker_completion_timeout is the number of seconds the tracker
│ │ │ │ +connection will wait from when it sent the request until it
│ │ │ │ +considers the tracker to have timed-out.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +tracker_receive_timeout |
│ │ │ │ +int |
│ │ │ │ +10 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
tracker_receive_timeout is the number of seconds to wait to
│ │ │ │ +receive any data from the tracker. If no data is received for this
│ │ │ │ +number of seconds, the tracker will be considered as having timed
│ │ │ │ +out. If a tracker is down, this is the kind of timeout that will
│ │ │ │ +occur.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +stop_tracker_timeout |
│ │ │ │ +int |
│ │ │ │ +5 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
stop_tracker_timeout is the number of seconds to wait when
│ │ │ │ +sending a stopped message before considering a tracker to have
│ │ │ │ +timed out. This is usually shorter, to make the client quit faster.
│ │ │ │ +If the value is set to 0, the connections to trackers with the
│ │ │ │ +stopped event are suppressed.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +tracker_maximum_response_length |
│ │ │ │ +int |
│ │ │ │ +1024*1024 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
this is the maximum number of bytes in a tracker response. If a
│ │ │ │ +response size passes this number of bytes it will be rejected and
│ │ │ │ +the connection will be closed. On gzipped responses this size is
│ │ │ │ +measured on the uncompressed data. So, if you get 20 bytes of gzip
│ │ │ │ +response that'll expand to 2 megabytes, it will be interrupted
│ │ │ │ +before the entire response has been uncompressed (assuming the
│ │ │ │ +limit is lower than 2 MiB).
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +piece_timeout |
│ │ │ │ +int |
│ │ │ │ +20 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of seconds from a request is sent until it times out if
│ │ │ │ +no piece response is returned.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +request_timeout |
│ │ │ │ +int |
│ │ │ │ +60 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of seconds one block (16 kiB) is expected to be received
│ │ │ │ +within. If it's not, the block is requested from a different peer
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +request_queue_time |
│ │ │ │ +int |
│ │ │ │ +3 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the length of the request queue given in the number of seconds it
│ │ │ │ +should take for the other end to send all the pieces. i.e. the
│ │ │ │ +actual number of requests depends on the download rate and this
│ │ │ │ +number.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_allowed_in_request_queue |
│ │ │ │ +int |
│ │ │ │ +2000 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of outstanding block requests a peer is allowed to queue
│ │ │ │ +up in the client. If a peer sends more requests than this (before
│ │ │ │ +the first one has been sent) the last request will be dropped. the
│ │ │ │ +higher this is, the faster upload speeds the client can get to a
│ │ │ │ +single peer.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_out_request_queue |
│ │ │ │ +int |
│ │ │ │ +500 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
max_out_request_queue is the maximum number of outstanding
│ │ │ │ +requests to send to a peer. This limit takes precedence over
│ │ │ │ +request_queue_time. i.e. no matter the download speed, the
│ │ │ │ +number of outstanding requests will never exceed this limit.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +whole_pieces_threshold |
│ │ │ │ +int |
│ │ │ │ +20 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if a whole piece can be downloaded in this number of seconds, or
│ │ │ │ +less, the peer_connection will prefer to request whole pieces at a
│ │ │ │ +time from this peer. The benefit of this is to better utilize disk
│ │ │ │ +caches by doing localized accesses and also to make it easier to
│ │ │ │ +identify bad peers if a piece fails the hash check.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +peer_timeout |
│ │ │ │ +int |
│ │ │ │ +120 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
peer_timeout is the number of seconds the peer connection
│ │ │ │ +should wait (for any activity on the peer connection) before
│ │ │ │ +closing it due to time out. 120 seconds is
│ │ │ │ +specified in the protocol specification. After half
│ │ │ │ +the time out, a keep alive message is sent.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +urlseed_timeout |
│ │ │ │ +int |
│ │ │ │ +20 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
same as peer_timeout, but only applies to url-seeds. this is
│ │ │ │ +usually set lower, because web servers are expected to be more
│ │ │ │ +reliable.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +urlseed_pipeline_size |
│ │ │ │ +int |
│ │ │ │ +5 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
controls the pipelining size of url and http seeds. i.e. the number of HTTP
│ │ │ │ +request to keep outstanding before waiting for the first one to
│ │ │ │ +complete. It's common for web servers to limit this to a relatively
│ │ │ │ +low number, like 5
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +urlseed_wait_retry |
│ │ │ │ +int |
│ │ │ │ +30 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
number of seconds until a new retry of a url-seed takes place.
│ │ │ │ +Default retry value for http-seeds that don't provide
│ │ │ │ +a valid retry-after header.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +file_pool_size |
│ │ │ │ +int |
│ │ │ │ +40 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
sets the upper limit on the total number of files this session will
│ │ │ │ +keep open. The reason why files are left open at all is that some
│ │ │ │ +anti virus software hooks on every file close, and scans the file
│ │ │ │ +for viruses. deferring the closing of the files will be the
│ │ │ │ +difference between a usable system and a completely hogged down
│ │ │ │ +system. Most operating systems also has a limit on the total number
│ │ │ │ +of file descriptors a process may have open.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_failcount |
│ │ │ │ +int |
│ │ │ │ +3 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
max_failcount is the maximum times we try to
│ │ │ │ +connect to a peer before stop connecting again. If a
│ │ │ │ +peer succeeds, the failure counter is reset. If a
│ │ │ │ +peer is retrieved from a peer source (other than DHT)
│ │ │ │ +the failcount is decremented by one, allowing another
│ │ │ │ +try.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +min_reconnect_time |
│ │ │ │ +int |
│ │ │ │ +60 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of seconds to wait to reconnect to a peer. this time is
│ │ │ │ +multiplied with the failcount.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +peer_connect_timeout |
│ │ │ │ +int |
│ │ │ │ +15 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
peer_connect_timeout the number of seconds to wait after a
│ │ │ │ +connection attempt is initiated to a peer until it is considered as
│ │ │ │ +having timed out. This setting is especially important in case the
│ │ │ │ +number of half-open connections are limited, since stale half-open
│ │ │ │ +connection may delay the connection of other peers considerably.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +connection_speed |
│ │ │ │ +int |
│ │ │ │ +30 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
connection_speed is the number of connection attempts that are
│ │ │ │ +made per second. If a number < 0 is specified, it will default to
│ │ │ │ +200 connections per second. If 0 is specified, it means don't make
│ │ │ │ +outgoing connections at all.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +inactivity_timeout |
│ │ │ │ +int |
│ │ │ │ +600 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if a peer is uninteresting and uninterested for longer than this
│ │ │ │ +number of seconds, it will be disconnected.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +unchoke_interval |
│ │ │ │ +int |
│ │ │ │ +15 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
unchoke_interval is the number of seconds between
│ │ │ │ +chokes/unchokes. On this interval, peers are re-evaluated for being
│ │ │ │ +choked/unchoked. This is defined as 30 seconds in the protocol, and
│ │ │ │ +it should be significantly longer than what it takes for TCP to
│ │ │ │ +ramp up to it's max rate.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +optimistic_unchoke_interval |
│ │ │ │ +int |
│ │ │ │ +30 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
optimistic_unchoke_interval is the number of seconds between
│ │ │ │ +each optimistic unchoke. On this timer, the currently
│ │ │ │ +optimistically unchoked peer will change.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +num_want |
│ │ │ │ +int |
│ │ │ │ +200 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
num_want is the number of peers we want from each tracker
│ │ │ │ +request. It defines what is sent as the &num_want= parameter to
│ │ │ │ +the tracker.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +initial_picker_threshold |
│ │ │ │ +int |
│ │ │ │ +4 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
initial_picker_threshold specifies the number of pieces we need
│ │ │ │ +before we switch to rarest first picking. The first
│ │ │ │ +initial_picker_threshold pieces in any torrent are picked at random
│ │ │ │ +, the following pieces are picked in rarest first order.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +allowed_fast_set_size |
│ │ │ │ +int |
│ │ │ │ +5 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of allowed pieces to send to peers that supports the
│ │ │ │ +fast extensions
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +suggest_mode |
│ │ │ │ +int |
│ │ │ │ +settings_pack::no_piece_suggestions |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
suggest_mode controls whether or not libtorrent will send out
│ │ │ │ +suggest messages to create a bias of its peers to request certain
│ │ │ │ +pieces. The modes are:
│ │ │ │ +
│ │ │ │ +- no_piece_suggestions which will not send out suggest messages.
│ │ │ │ +- suggest_read_cache which will send out suggest messages for
│ │ │ │ +the most recent pieces that are in the read cache.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_queued_disk_bytes |
│ │ │ │ +int |
│ │ │ │ +1024 * 1024 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
max_queued_disk_bytes is the maximum number of bytes, to
│ │ │ │ +be written to disk, that can wait in the disk I/O thread queue.
│ │ │ │ +This queue is only for waiting for the disk I/O thread to receive
│ │ │ │ +the job and either write it to disk or insert it in the write
│ │ │ │ +cache. When this limit is reached, the peer connections will stop
│ │ │ │ +reading data from their sockets, until the disk thread catches up.
│ │ │ │ +Setting this too low will severely limit your download rate.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +handshake_timeout |
│ │ │ │ +int |
│ │ │ │ +10 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of seconds to wait for a handshake response from a peer.
│ │ │ │ +If no response is received within this time, the peer is
│ │ │ │ +disconnected.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +send_buffer_low_watermark |
│ │ │ │ +int |
│ │ │ │ +10 * 1024 |
│ │ │ │ +
│ │ │ │ +send_buffer_watermark |
│ │ │ │ +int |
│ │ │ │ +500 * 1024 |
│ │ │ │ +
│ │ │ │ +send_buffer_watermark_factor |
│ │ │ │ +int |
│ │ │ │ +50 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
send_buffer_low_watermark the minimum send buffer target size
│ │ │ │ +(send buffer includes bytes pending being read from disk). For good
│ │ │ │ +and snappy seeding performance, set this fairly high, to at least
│ │ │ │ +fit a few blocks. This is essentially the initial window size which
│ │ │ │ +will determine how fast we can ramp up the send rate
│ │ │ │ +
if the send buffer has fewer bytes than send_buffer_watermark,
│ │ │ │ +we'll read another 16 kiB block onto it. If set too small, upload
│ │ │ │ +rate capacity will suffer. If set too high, memory will be wasted.
│ │ │ │ +The actual watermark may be lower than this in case the upload rate
│ │ │ │ +is low, this is the upper limit.
│ │ │ │ +
the current upload rate to a peer is multiplied by this factor to
│ │ │ │ +get the send buffer watermark. The factor is specified as a
│ │ │ │ +percentage. i.e. 50 -> 0.5 This product is clamped to the
│ │ │ │ +send_buffer_watermark setting to not exceed the max. For high
│ │ │ │ +speed upload, this should be set to a greater value than 100. For
│ │ │ │ +high capacity connections, setting this higher can improve upload
│ │ │ │ +performance and disk throughput. Setting it too high may waste RAM
│ │ │ │ +and create a bias towards read jobs over write jobs.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +choking_algorithm |
│ │ │ │ +int |
│ │ │ │ +settings_pack::fixed_slots_choker |
│ │ │ │ +
│ │ │ │ +seed_choking_algorithm |
│ │ │ │ +int |
│ │ │ │ +settings_pack::round_robin |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
choking_algorithm specifies which algorithm to use to determine
│ │ │ │ +how many peers to unchoke. The unchoking algorithm for
│ │ │ │ +downloading torrents is always "tit-for-tat", i.e. the peers we
│ │ │ │ +download the fastest from are unchoked.
│ │ │ │ +
The options for choking algorithms are defined in the
│ │ │ │ +choking_algorithm_t enum.
│ │ │ │ +
seed_choking_algorithm controls the seeding unchoke behavior.
│ │ │ │ +i.e. How we select which peers to unchoke for seeding torrents.
│ │ │ │ +Since a seeding torrent isn't downloading anything, the
│ │ │ │ +tit-for-tat mechanism cannot be used. The available options are
│ │ │ │ +defined in the seed_choking_algorithm_t enum.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +disk_io_write_mode |
│ │ │ │ +int |
│ │ │ │ +DISK_WRITE_MODE |
│ │ │ │ +
│ │ │ │ +disk_io_read_mode |
│ │ │ │ +int |
│ │ │ │ +settings_pack::enable_os_cache |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
determines how files are opened when they're in read only mode
│ │ │ │ +versus read and write mode. The options are:
│ │ │ │ +
│ │ │ │ +- enable_os_cache
│ │ │ │ +- Files are opened normally, with the OS caching reads and writes.
│ │ │ │ +- disable_os_cache
│ │ │ │ +- This opens all files in no-cache mode. This corresponds to the
│ │ │ │ +OS not letting blocks for the files linger in the cache. This
│ │ │ │ +makes sense in order to avoid the bittorrent client to
│ │ │ │ +potentially evict all other processes' cache by simply handling
│ │ │ │ +high throughput and large files. If libtorrent's read cache is
│ │ │ │ +disabled, enabling this may reduce performance.
│ │ │ │ +- write_through
│ │ │ │ +- flush pieces to disk as they complete validation.
│ │ │ │ +
│ │ │ │ +
One reason to disable caching is that it may help the operating
│ │ │ │ +system from growing its file cache indefinitely.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +outgoing_port |
│ │ │ │ +int |
│ │ │ │ +0 |
│ │ │ │ +
│ │ │ │ +num_outgoing_ports |
│ │ │ │ +int |
│ │ │ │ +0 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
this is the first port to use for binding outgoing connections to.
│ │ │ │ +This is useful for users that have routers that allow QoS settings
│ │ │ │ +based on local port. when binding outgoing connections to specific
│ │ │ │ +ports, num_outgoing_ports is the size of the range. It should
│ │ │ │ +be more than a few
│ │ │ │ +
│ │ │ │ +
Warning
│ │ │ │ +
setting outgoing ports will limit the ability to keep
│ │ │ │ +multiple connections to the same client, even for different
│ │ │ │ +torrents. It is not recommended to change this setting. Its main
│ │ │ │ +purpose is to use as an escape hatch for cheap routers with QoS
│ │ │ │ +capability but can only classify flows based on port numbers.
│ │ │ │ +
│ │ │ │ +
It is a range instead of a single port because of the problems with
│ │ │ │ +failing to reconnect to peers if a previous socket to that peer and
│ │ │ │ +port is in TIME_WAIT state.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +peer_dscp |
│ │ │ │ +int |
│ │ │ │ +0x04 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
peer_dscp determines the DSCP field in the IP header of every
│ │ │ │ +packet sent to peers (including web seeds). 0x0 means no marking,
│ │ │ │ +0x04 represents Lower Effort. For more details see RFC 8622.
│ │ │ │ +
peer_tos is the backwards compatible name for this setting.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +active_downloads |
│ │ │ │ +int |
│ │ │ │ +3 |
│ │ │ │ +
│ │ │ │ +active_seeds |
│ │ │ │ +int |
│ │ │ │ +5 |
│ │ │ │ +
│ │ │ │ +active_checking |
│ │ │ │ +int |
│ │ │ │ +1 |
│ │ │ │ +
│ │ │ │ +active_dht_limit |
│ │ │ │ +int |
│ │ │ │ +88 |
│ │ │ │ +
│ │ │ │ +active_tracker_limit |
│ │ │ │ +int |
│ │ │ │ +1600 |
│ │ │ │ +
│ │ │ │ +active_lsd_limit |
│ │ │ │ +int |
│ │ │ │ +60 |
│ │ │ │ +
│ │ │ │ +active_limit |
│ │ │ │ +int |
│ │ │ │ +500 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
for auto managed torrents, these are the limits they are subject
│ │ │ │ +to. If there are too many torrents some of the auto managed ones
│ │ │ │ +will be paused until some slots free up. active_downloads and
│ │ │ │ +active_seeds controls how many active seeding and downloading
│ │ │ │ +torrents the queuing mechanism allows. The target number of active
│ │ │ │ +torrents is min(active_downloads + active_seeds, active_limit).
│ │ │ │ +active_downloads and active_seeds are upper limits on the
│ │ │ │ +number of downloading torrents and seeding torrents respectively.
│ │ │ │ +Setting the value to -1 means unlimited.
│ │ │ │ +
For example if there are 10 seeding torrents and 10 downloading
│ │ │ │ +torrents, and active_downloads is 4 and active_seeds is 4,
│ │ │ │ +there will be 4 seeds active and 4 downloading torrents. If the
│ │ │ │ +settings are active_downloads = 2 and active_seeds = 4,
│ │ │ │ +then there will be 2 downloading torrents and 4 seeding torrents
│ │ │ │ +active. Torrents that are not auto managed are not counted against
│ │ │ │ +these limits.
│ │ │ │ +
active_checking is the limit of number of simultaneous checking
│ │ │ │ +torrents.
│ │ │ │ +
active_limit is a hard limit on the number of active (auto
│ │ │ │ +managed) torrents. This limit also applies to slow torrents.
│ │ │ │ +
active_dht_limit is the max number of torrents to announce to
│ │ │ │ +the DHT.
│ │ │ │ +
active_tracker_limit is the max number of torrents to announce
│ │ │ │ +to their trackers.
│ │ │ │ +
active_lsd_limit is the max number of torrents to announce to
│ │ │ │ +the local network over the local service discovery protocol.
│ │ │ │ +
You can have more torrents active, even though they are not
│ │ │ │ +announced to the DHT, lsd or their tracker. If some peer knows
│ │ │ │ +about you for any reason and tries to connect, it will still be
│ │ │ │ +accepted, unless the torrent is paused, which means it won't accept
│ │ │ │ +any connections.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +auto_manage_interval |
│ │ │ │ +int |
│ │ │ │ +30 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
auto_manage_interval is the number of seconds between the
│ │ │ │ +torrent queue is updated, and rotated.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +seed_time_limit |
│ │ │ │ +int |
│ │ │ │ +24 * 60 * 60 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
this is the limit on the time a torrent has been an active seed
│ │ │ │ +(specified in seconds) before it is considered having met the seed
│ │ │ │ +limit criteria. See queuing.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +auto_scrape_interval |
│ │ │ │ +int |
│ │ │ │ +1800 |
│ │ │ │ +
│ │ │ │ +auto_scrape_min_interval |
│ │ │ │ +int |
│ │ │ │ +300 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
auto_scrape_interval is the number of seconds between scrapes
│ │ │ │ +of queued torrents (auto managed and paused torrents). Auto managed
│ │ │ │ +torrents that are paused, are scraped regularly in order to keep
│ │ │ │ +track of their downloader/seed ratio. This ratio is used to
│ │ │ │ +determine which torrents to seed and which to pause.
│ │ │ │ +
auto_scrape_min_interval is the minimum number of seconds
│ │ │ │ +between any automatic scrape (regardless of torrent). In case there
│ │ │ │ +are a large number of paused auto managed torrents, this puts a
│ │ │ │ +limit on how often a scrape request is sent.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_peerlist_size |
│ │ │ │ +int |
│ │ │ │ +3000 |
│ │ │ │ +
│ │ │ │ +max_paused_peerlist_size |
│ │ │ │ +int |
│ │ │ │ +1000 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
max_peerlist_size is the maximum number of peers in the list of
│ │ │ │ +known peers. These peers are not necessarily connected, so this
│ │ │ │ +number should be much greater than the maximum number of connected
│ │ │ │ +peers. Peers are evicted from the cache when the list grows passed
│ │ │ │ +90% of this limit, and once the size hits the limit, peers are no
│ │ │ │ +longer added to the list. If this limit is set to 0, there is no
│ │ │ │ +limit on how many peers we'll keep in the peer list.
│ │ │ │ +
max_paused_peerlist_size is the max peer list size used for
│ │ │ │ +torrents that are paused. This can be used to save memory for paused
│ │ │ │ +torrents, since it's not as important for them to keep a large peer
│ │ │ │ +list.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +min_announce_interval |
│ │ │ │ +int |
│ │ │ │ +5 * 60 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
this is the minimum allowed announce interval for a tracker. This
│ │ │ │ +is specified in seconds and is used as a sanity check on what is
│ │ │ │ +returned from a tracker. It mitigates hammering mis-configured
│ │ │ │ +trackers.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +auto_manage_startup |
│ │ │ │ +int |
│ │ │ │ +60 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
this is the number of seconds a torrent is considered active after
│ │ │ │ +it was started, regardless of upload and download speed. This is so
│ │ │ │ +that newly started torrents are not considered inactive until they
│ │ │ │ +have a fair chance to start downloading.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +seeding_piece_quota |
│ │ │ │ +int |
│ │ │ │ +20 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
seeding_piece_quota is the number of pieces to send to a peer,
│ │ │ │ +when seeding, before rotating in another peer to the unchoke set.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_rejects |
│ │ │ │ +int |
│ │ │ │ +50 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
max_rejects is the number of piece requests we will reject in a
│ │ │ │ +row while a peer is choked before the peer is considered abusive
│ │ │ │ +and is disconnected.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +recv_socket_buffer_size |
│ │ │ │ +int |
│ │ │ │ +0 |
│ │ │ │ +
│ │ │ │ +send_socket_buffer_size |
│ │ │ │ +int |
│ │ │ │ +0 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
specifies the buffer sizes set on peer sockets. 0 means the OS
│ │ │ │ +default (i.e. don't change the buffer sizes).
│ │ │ │ +The socket buffer sizes are changed using setsockopt() with
│ │ │ │ +SOL_SOCKET/SO_RCVBUF and SO_SNDBUFFER.
│ │ │ │ +
Note that uTP peers share a single UDP socket buffer for each of the
│ │ │ │ +listen_interfaces, along with DHT and UDP tracker traffic.
│ │ │ │ +If the buffer size is too small for the combined traffic through the
│ │ │ │ +socket, packets may be dropped.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_peer_recv_buffer_size |
│ │ │ │ +int |
│ │ │ │ +2 * 1024 * 1024 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the max number of bytes a single peer connection's receive buffer is
│ │ │ │ +allowed to grow to.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +optimistic_disk_retry |
│ │ │ │ +int |
│ │ │ │ +10 * 60 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
optimistic_disk_retry is the number of seconds from a disk
│ │ │ │ +write errors occur on a torrent until libtorrent will take it out
│ │ │ │ +of the upload mode, to test if the error condition has been fixed.
│ │ │ │ +
libtorrent will only do this automatically for auto managed
│ │ │ │ +torrents.
│ │ │ │ +
You can explicitly take a torrent out of upload only mode using
│ │ │ │ +set_upload_mode().
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_suggest_pieces |
│ │ │ │ +int |
│ │ │ │ +16 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
max_suggest_pieces is the max number of suggested piece indices
│ │ │ │ +received from a peer that's remembered. If a peer floods suggest
│ │ │ │ +messages, this limit prevents libtorrent from using too much RAM.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +local_service_announce_interval |
│ │ │ │ +int |
│ │ │ │ +5 * 60 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
local_service_announce_interval is the time between local
│ │ │ │ +network announces for a torrent.
│ │ │ │ +This interval is specified in seconds.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_announce_interval |
│ │ │ │ +int |
│ │ │ │ +15 * 60 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
dht_announce_interval is the number of seconds between
│ │ │ │ +announcing torrents to the distributed hash table (DHT).
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +udp_tracker_token_expiry |
│ │ │ │ +int |
│ │ │ │ +60 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
udp_tracker_token_expiry is the number of seconds libtorrent
│ │ │ │ +will keep UDP tracker connection tokens around for. This is
│ │ │ │ +specified to be 60 seconds. The higher this
│ │ │ │ +value is, the fewer packets have to be sent to the UDP tracker. In
│ │ │ │ +order for higher values to work, the tracker needs to be configured
│ │ │ │ +to match the expiration time for tokens.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +num_optimistic_unchoke_slots |
│ │ │ │ +int |
│ │ │ │ +0 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
num_optimistic_unchoke_slots is the number of optimistic
│ │ │ │ +unchoke slots to use.
│ │ │ │ +Having a higher number of optimistic unchoke slots mean you will
│ │ │ │ +find the good peers faster but with the trade-off to use up more
│ │ │ │ +bandwidth. 0 means automatic, where libtorrent opens up 20% of your
│ │ │ │ +allowed upload slots as optimistic unchoke slots.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_pex_peers |
│ │ │ │ +int |
│ │ │ │ +50 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the max number of peers we accept from pex messages from a single
│ │ │ │ +peer. this limits the number of concurrent peers any of our peers
│ │ │ │ +claims to be connected to. If they claim to be connected to more
│ │ │ │ +than this, we'll ignore any peer that exceeds this limit
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +tick_interval |
│ │ │ │ +int |
│ │ │ │ +500 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
tick_interval specifies the number of milliseconds between
│ │ │ │ +internal ticks. This is the frequency with which bandwidth quota is
│ │ │ │ +distributed to peers. It should not be more than one second (i.e.
│ │ │ │ +1000 ms). Setting this to a low value (around 100) means higher
│ │ │ │ +resolution bandwidth quota distribution, setting it to a higher
│ │ │ │ +value saves CPU cycles.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +share_mode_target |
│ │ │ │ +int |
│ │ │ │ +3 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
share_mode_target specifies the target share ratio for share
│ │ │ │ +mode torrents. If set to 3, we'll try to upload 3
│ │ │ │ +times as much as we download. Setting this very high, will make it
│ │ │ │ +very conservative and you might end up not downloading anything
│ │ │ │ +ever (and not affecting your share ratio). It does not make any
│ │ │ │ +sense to set this any lower than 2. For instance, if only 3 peers
│ │ │ │ +need to download the rarest piece, it's impossible to download a
│ │ │ │ +single piece and upload it more than 3 times. If the
│ │ │ │ +share_mode_target is set to more than 3, nothing is downloaded.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +upload_rate_limit |
│ │ │ │ +int |
│ │ │ │ +0 |
│ │ │ │ +
│ │ │ │ +download_rate_limit |
│ │ │ │ +int |
│ │ │ │ +0 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
upload_rate_limit and download_rate_limit sets
│ │ │ │ +the session-global limits of upload and download rate limits, in
│ │ │ │ +bytes per second. By default peers on the local network are not rate
│ │ │ │ +limited.
│ │ │ │ +
A value of 0 means unlimited.
│ │ │ │ +
For fine grained control over rate limits, including making them apply
│ │ │ │ +to local peers, see peer classes.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_upload_rate_limit |
│ │ │ │ +int |
│ │ │ │ +8000 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of bytes per second (on average) the DHT is allowed to send.
│ │ │ │ +If the incoming requests causes to many bytes to be sent in responses,
│ │ │ │ +incoming requests will be dropped until the quota has been replenished.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +unchoke_slots_limit |
│ │ │ │ +int |
│ │ │ │ +8 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
unchoke_slots_limit is the max number of unchoked peers in the
│ │ │ │ +session. The number of unchoke slots may be ignored depending on
│ │ │ │ +what choking_algorithm is set to. Setting this limit to -1
│ │ │ │ +means unlimited, i.e. all peers will always be unchoked.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +connections_limit |
│ │ │ │ +int |
│ │ │ │ +200 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
connections_limit sets a global limit on the number of
│ │ │ │ +connections opened. The number of connections is set to a hard
│ │ │ │ +minimum of at least two per torrent, so if you set a too low
│ │ │ │ +connections limit, and open too many torrents, the limit will not
│ │ │ │ +be met.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +connections_slack |
│ │ │ │ +int |
│ │ │ │ +10 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
connections_slack is the number of incoming connections
│ │ │ │ +exceeding the connection limit to accept in order to potentially
│ │ │ │ +replace existing ones.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +utp_target_delay |
│ │ │ │ +int |
│ │ │ │ +100 |
│ │ │ │ +
│ │ │ │ +utp_gain_factor |
│ │ │ │ +int |
│ │ │ │ +3000 |
│ │ │ │ +
│ │ │ │ +utp_min_timeout |
│ │ │ │ +int |
│ │ │ │ +500 |
│ │ │ │ +
│ │ │ │ +utp_syn_resends |
│ │ │ │ +int |
│ │ │ │ +2 |
│ │ │ │ +
│ │ │ │ +utp_fin_resends |
│ │ │ │ +int |
│ │ │ │ +2 |
│ │ │ │ +
│ │ │ │ +utp_num_resends |
│ │ │ │ +int |
│ │ │ │ +3 |
│ │ │ │ +
│ │ │ │ +utp_connect_timeout |
│ │ │ │ +int |
│ │ │ │ +3000 |
│ │ │ │ +
│ │ │ │ +utp_loss_multiplier |
│ │ │ │ +int |
│ │ │ │ +50 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
utp_target_delay is the target delay for uTP sockets in
│ │ │ │ +milliseconds. A high value will make uTP connections more
│ │ │ │ +aggressive and cause longer queues in the upload bottleneck. It
│ │ │ │ +cannot be too low, since the noise in the measurements would cause
│ │ │ │ +it to send too slow.
│ │ │ │ +utp_gain_factor is the number of bytes the uTP congestion
│ │ │ │ +window can increase at the most in one RTT.
│ │ │ │ +If this is set too high, the congestion controller reacts
│ │ │ │ +too hard to noise and will not be stable, if it's set too low, it
│ │ │ │ +will react slow to congestion and not back off as fast.
│ │ │ │ +
utp_min_timeout is the shortest allowed uTP socket timeout,
│ │ │ │ +specified in milliseconds. The
│ │ │ │ +timeout depends on the RTT of the connection, but is never smaller
│ │ │ │ +than this value. A connection times out when every packet in a
│ │ │ │ +window is lost, or when a packet is lost twice in a row (i.e. the
│ │ │ │ +resent packet is lost as well).
│ │ │ │ +
The shorter the timeout is, the faster the connection will recover
│ │ │ │ +from this situation, assuming the RTT is low enough.
│ │ │ │ +utp_syn_resends is the number of SYN packets that are sent (and
│ │ │ │ +timed out) before giving up and closing the socket.
│ │ │ │ +utp_num_resends is the number of times a packet is sent (and
│ │ │ │ +lost or timed out) before giving up and closing the connection.
│ │ │ │ +utp_connect_timeout is the number of milliseconds of timeout
│ │ │ │ +for the initial SYN packet for uTP connections. For each timed out
│ │ │ │ +packet (in a row), the timeout is doubled. utp_loss_multiplier
│ │ │ │ +controls how the congestion window is changed when a packet loss is
│ │ │ │ +experienced. It's specified as a percentage multiplier for
│ │ │ │ +cwnd. Do not change this value unless you know what you're doing.
│ │ │ │ +Never set it higher than 100.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +mixed_mode_algorithm |
│ │ │ │ +int |
│ │ │ │ +settings_pack::peer_proportional |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
The mixed_mode_algorithm determines how to treat TCP
│ │ │ │ +connections when there are uTP connections. Since uTP is designed
│ │ │ │ +to yield to TCP, there's an inherent problem when using swarms that
│ │ │ │ +have both TCP and uTP connections. If nothing is done, uTP
│ │ │ │ +connections would often be starved out for bandwidth by the TCP
│ │ │ │ +connections. This mode is prefer_tcp. The peer_proportional
│ │ │ │ +mode simply looks at the current throughput and rate limits all TCP
│ │ │ │ +connections to their proportional share based on how many of the
│ │ │ │ +connections are TCP. This works best if uTP connections are not
│ │ │ │ +rate limited by the global rate limiter (which they aren't by
│ │ │ │ +default).
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +listen_queue_size |
│ │ │ │ +int |
│ │ │ │ +5 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
listen_queue_size is the value passed in to listen() for the
│ │ │ │ +listen socket. It is the number of outstanding incoming connections
│ │ │ │ +to queue up while we're not actively waiting for a connection to be
│ │ │ │ +accepted. 5 should be sufficient for any
│ │ │ │ +normal client. If this is a high performance server which expects
│ │ │ │ +to receive a lot of connections, or used in a simulator or test, it
│ │ │ │ +might make sense to raise this number. It will not take affect
│ │ │ │ +until the listen_interfaces settings is updated.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +torrent_connect_boost |
│ │ │ │ +int |
│ │ │ │ +30 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
torrent_connect_boost is the number of peers to try to connect
│ │ │ │ +to immediately when the first tracker response is received for a
│ │ │ │ +torrent. This is a boost to given to new torrents to accelerate
│ │ │ │ +them starting up. The normal connect scheduler is run once every
│ │ │ │ +second, this allows peers to be connected immediately instead of
│ │ │ │ +waiting for the session tick to trigger connections.
│ │ │ │ +This may not be set higher than 255.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +alert_queue_size |
│ │ │ │ +int |
│ │ │ │ +2000 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
alert_queue_size is the maximum number of alerts queued up
│ │ │ │ +internally. If alerts are not popped, the queue will eventually
│ │ │ │ +fill up to this level. Once the alert queue is full, additional
│ │ │ │ +alerts will be dropped, and not delivered to the client. Once the
│ │ │ │ +client drains the queue, new alerts may be delivered again. In order
│ │ │ │ +to know that alerts have been dropped, see
│ │ │ │ +session_handle::dropped_alerts().
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_metadata_size |
│ │ │ │ +int |
│ │ │ │ +3 * 1024 * 10240 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
max_metadata_size is the maximum allowed size (in bytes) to be
│ │ │ │ +received by the metadata extension, i.e. magnet links.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +hashing_threads |
│ │ │ │ +int |
│ │ │ │ +1 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
hashing_threads is the number of disk I/O threads to use for
│ │ │ │ +piece hash verification. These threads are in addition to the
│ │ │ │ +regular disk I/O threads specified by settings_pack::aio_threads.
│ │ │ │ +These threads are only used for full checking of torrents. The
│ │ │ │ +hash checking done while downloading are done by the regular disk
│ │ │ │ +I/O threads.
│ │ │ │ +The hasher threads do not only compute hashes, but also perform
│ │ │ │ +the read from disk. On storage optimal for sequential access,
│ │ │ │ +such as hard drives, this setting should be set to 1, which is
│ │ │ │ +also the default.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +checking_mem_usage |
│ │ │ │ +int |
│ │ │ │ +256 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of blocks to keep outstanding at any given time when
│ │ │ │ +checking torrents. Higher numbers give faster re-checks but uses
│ │ │ │ +more memory. Specified in number of 16 kiB blocks
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +predictive_piece_announce |
│ │ │ │ +int |
│ │ │ │ +0 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if set to > 0, pieces will be announced to other peers before they
│ │ │ │ +are fully downloaded (and before they are hash checked). The
│ │ │ │ +intention is to gain 1.5 potential round trip times per downloaded
│ │ │ │ +piece. When non-zero, this indicates how many milliseconds in
│ │ │ │ +advance pieces should be announced, before they are expected to be
│ │ │ │ +completed.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +aio_threads |
│ │ │ │ +int |
│ │ │ │ +10 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
for some aio back-ends, aio_threads specifies the number of
│ │ │ │ +io-threads to use.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +tracker_backoff |
│ │ │ │ +int |
│ │ │ │ +250 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
tracker_backoff determines how aggressively to back off from
│ │ │ │ +retrying failing trackers. This value determines x in the
│ │ │ │ +following formula, determining the number of seconds to wait until
│ │ │ │ +the next retry:
│ │ │ │ +
│ │ │ │ +delay = 5 + 5 * x / 100 * fails^2
│ │ │ │ +
This setting may be useful to make libtorrent more or less
│ │ │ │ +aggressive in hitting trackers.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +share_ratio_limit |
│ │ │ │ +int |
│ │ │ │ +200 |
│ │ │ │ +
│ │ │ │ +seed_time_ratio_limit |
│ │ │ │ +int |
│ │ │ │ +700 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when a seeding torrent reaches either the share ratio (bytes up /
│ │ │ │ +bytes down) or the seed time ratio (seconds as seed / seconds as
│ │ │ │ +downloader) or the seed time limit (seconds as seed) it is
│ │ │ │ +considered done, and it will leave room for other torrents. These
│ │ │ │ +are specified as percentages. Torrents that are considered done will
│ │ │ │ +still be allowed to be seeded, they just won't have priority anymore.
│ │ │ │ +For more, see queuing.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +peer_turnover |
│ │ │ │ +int |
│ │ │ │ +4 |
│ │ │ │ +
│ │ │ │ +peer_turnover_cutoff |
│ │ │ │ +int |
│ │ │ │ +90 |
│ │ │ │ +
│ │ │ │ +peer_turnover_interval |
│ │ │ │ +int |
│ │ │ │ +300 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
peer_turnover is the percentage of peers to disconnect every
│ │ │ │ +turnover peer_turnover_interval (if we're at the peer limit), this
│ │ │ │ +is specified in percent when we are connected to more than limit *
│ │ │ │ +peer_turnover_cutoff peers disconnect peer_turnover fraction of the
│ │ │ │ +peers. It is specified in percent peer_turnover_interval is the
│ │ │ │ +interval (in seconds) between optimistic disconnects if the
│ │ │ │ +disconnects happen and how many peers are disconnected is
│ │ │ │ +controlled by peer_turnover and peer_turnover_cutoff
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +connect_seed_every_n_download |
│ │ │ │ +int |
│ │ │ │ +10 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
this setting controls the priority of downloading torrents over
│ │ │ │ +seeding or finished torrents when it comes to making peer
│ │ │ │ +connections. Peer connections are throttled by the connection_speed
│ │ │ │ +and the half-open connection limit. This makes peer connections a
│ │ │ │ +limited resource. Torrents that still have pieces to download are
│ │ │ │ +prioritized by default, to avoid having many seeding torrents use
│ │ │ │ +most of the connection attempts and only give one peer every now
│ │ │ │ +and then to the downloading torrent. libtorrent will loop over the
│ │ │ │ +downloading torrents to connect a peer each, and every n:th
│ │ │ │ +connection attempt, a finished torrent is picked to be allowed to
│ │ │ │ +connect to a peer. This setting controls n.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_http_recv_buffer_size |
│ │ │ │ +int |
│ │ │ │ +4*1024*204 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the max number of bytes to allow an HTTP response to be when
│ │ │ │ +announcing to trackers or downloading .torrent files via the
│ │ │ │ +url provided in add_torrent_params.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_retry_port_bind |
│ │ │ │ +int |
│ │ │ │ +10 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
if binding to a specific port fails, should the port be incremented
│ │ │ │ +by one and tried again? This setting specifies how many times to
│ │ │ │ +retry a failed port bind
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +alert_mask |
│ │ │ │ +int |
│ │ │ │ +int |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
a bitmask combining flags from alert_category_t defining which
│ │ │ │ +kinds of alerts to receive
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +out_enc_policy |
│ │ │ │ +int |
│ │ │ │ +settings_pack::pe_enabled |
│ │ │ │ +
│ │ │ │ +in_enc_policy |
│ │ │ │ +int |
│ │ │ │ +settings_pack::pe_enabled |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
control the settings for incoming and outgoing connections
│ │ │ │ +respectively. see enc_policy enum for the available options.
│ │ │ │ +Keep in mind that protocol encryption degrades performance in
│ │ │ │ +several respects:
│ │ │ │ +
│ │ │ │ +- It prevents "zero copy" disk buffers being sent to peers, since
│ │ │ │ +each peer needs to mutate the data (i.e. encrypt it) the data
│ │ │ │ +must be copied per peer connection rather than sending the same
│ │ │ │ +buffer to multiple peers.
│ │ │ │ +- The encryption itself requires more CPU than plain bittorrent
│ │ │ │ +protocol. The highest cost is the Diffie Hellman exchange on
│ │ │ │ +connection setup.
│ │ │ │ +- The encryption handshake adds several round-trips to the
│ │ │ │ +connection setup, and delays transferring data.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +allowed_enc_level |
│ │ │ │ +int |
│ │ │ │ +settings_pack::pe_both |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
determines the encryption level of the connections. This setting
│ │ │ │ +will adjust which encryption scheme is offered to the other peer,
│ │ │ │ +as well as which encryption scheme is selected by the client. See
│ │ │ │ +enc_level enum for options.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +inactive_down_rate |
│ │ │ │ +int |
│ │ │ │ +2048 |
│ │ │ │ +
│ │ │ │ +inactive_up_rate |
│ │ │ │ +int |
│ │ │ │ +2048 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
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 started.
│ │ │ │ +This logic is disabled if dont_count_slow_torrents is false.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +proxy_type |
│ │ │ │ +int |
│ │ │ │ +settings_pack::none |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
proxy to use. see proxy_type_t.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +proxy_port |
│ │ │ │ +int |
│ │ │ │ +0 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the port of the proxy server
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +i2p_port |
│ │ │ │ +int |
│ │ │ │ +0 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
sets the i2p SAM bridge port to connect to. set the hostname with
│ │ │ │ +the i2p_hostname setting.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +urlseed_max_request_bytes |
│ │ │ │ +int |
│ │ │ │ +16 * 1024 * 1024 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
The maximum request range of an url seed in bytes. This value
│ │ │ │ +defines the largest possible sequential web seed request. Lower values
│ │ │ │ +are possible but will be ignored if they are lower then piece size.
│ │ │ │ +This value should be related to your download speed to prevent
│ │ │ │ +libtorrent from creating too many expensive http requests per
│ │ │ │ +second. You can select a value as high as you want but keep in mind
│ │ │ │ +that libtorrent can't create parallel requests if the first request
│ │ │ │ +did already select the whole file.
│ │ │ │ +If you combine bittorrent seeds with web seeds and pick strategies
│ │ │ │ +like rarest first you may find your web seed requests split into
│ │ │ │ +smaller parts because we don't download already picked pieces
│ │ │ │ +twice.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +web_seed_name_lookup_retry |
│ │ │ │ +int |
│ │ │ │ +1800 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
time to wait until a new retry of a web seed name lookup
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +close_file_interval |
│ │ │ │ +int |
│ │ │ │ +CLOSE_FILE_INTERVAL |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of seconds between closing the file opened the longest
│ │ │ │ +ago. 0 means to disable the feature. The purpose of this is to
│ │ │ │ +periodically close files to trigger the operating system flushing
│ │ │ │ +disk cache. Specifically it has been observed to be required on
│ │ │ │ +windows to not have the disk cache grow indefinitely.
│ │ │ │ +This defaults to 240 seconds on windows, and disabled on other
│ │ │ │ +systems.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +utp_cwnd_reduce_timer |
│ │ │ │ +int |
│ │ │ │ +100 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
When uTP experiences packet loss, it will reduce the congestion
│ │ │ │ +window, and not reduce it again for this many milliseconds, even if
│ │ │ │ +experiencing another lost packet.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_web_seed_connections |
│ │ │ │ +int |
│ │ │ │ +3 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the max number of web seeds to have connected per torrent at any
│ │ │ │ +given time.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +resolver_cache_timeout |
│ │ │ │ +int |
│ │ │ │ +1200 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of seconds before the internal host name resolver
│ │ │ │ +considers a cache value timed out, negative values are interpreted
│ │ │ │ +as zero.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +send_not_sent_low_watermark |
│ │ │ │ +int |
│ │ │ │ +16384 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
specify the not-sent low watermark for socket send buffers. This
│ │ │ │ +corresponds to the, Linux-specific, TCP_NOTSENT_LOWAT TCP socket
│ │ │ │ +option.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +rate_choker_initial_threshold |
│ │ │ │ +int |
│ │ │ │ +1024 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the rate based choker compares the upload rate to peers against a
│ │ │ │ +threshold that increases proportionally by its size for every
│ │ │ │ +peer it visits, visiting peers in decreasing upload rate. The
│ │ │ │ +number of upload slots is determined by the number of peers whose
│ │ │ │ +upload rate exceeds the threshold. This option sets the start
│ │ │ │ +value for this threshold. A higher value leads to fewer unchoke
│ │ │ │ +slots, a lower value leads to more.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +upnp_lease_duration |
│ │ │ │ +int |
│ │ │ │ +3600 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
The expiration time of UPnP port-mappings, specified in seconds. 0
│ │ │ │ +means permanent lease. Some routers do not support expiration times
│ │ │ │ +on port-maps (nor correctly returning an error indicating lack of
│ │ │ │ +support). In those cases, set this to 0. Otherwise, don't set it any
│ │ │ │ +lower than 5 minutes.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_concurrent_http_announces |
│ │ │ │ +int |
│ │ │ │ +50 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
limits the number of concurrent HTTP tracker announces. Once the
│ │ │ │ +limit is hit, tracker requests are queued and issued when an
│ │ │ │ +outstanding announce completes.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_max_peers_reply |
│ │ │ │ +int |
│ │ │ │ +100 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the maximum number of peers to send in a reply to get_peers
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_search_branching |
│ │ │ │ +int |
│ │ │ │ +5 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of concurrent search request the node will send when
│ │ │ │ +announcing and refreshing the routing table. This parameter is called
│ │ │ │ +alpha in the kademlia paper
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_max_fail_count |
│ │ │ │ +int |
│ │ │ │ +20 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the maximum number of failed tries to contact a node before it is
│ │ │ │ +removed from the routing table. If there are known working nodes that
│ │ │ │ +are ready to replace a failing node, it will be replaced immediately,
│ │ │ │ +this limit is only used to clear out nodes that don't have any node
│ │ │ │ +that can replace them.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_max_torrents |
│ │ │ │ +int |
│ │ │ │ +2000 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the total number of torrents to track from the DHT. This is simply an
│ │ │ │ +upper limit to make sure malicious DHT nodes cannot make us allocate
│ │ │ │ +an unbounded amount of memory.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_max_dht_items |
│ │ │ │ +int |
│ │ │ │ +700 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
max number of items the DHT will store
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_max_peers |
│ │ │ │ +int |
│ │ │ │ +500 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the max number of peers to store per torrent (for the DHT)
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_max_torrent_search_reply |
│ │ │ │ +int |
│ │ │ │ +20 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the max number of torrents to return in a torrent search query to the
│ │ │ │ +DHT
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_block_timeout |
│ │ │ │ +int |
│ │ │ │ +5 * 60 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of seconds a DHT node is banned if it exceeds the rate
│ │ │ │ +limit. The rate limit is averaged over 10 seconds to allow for bursts
│ │ │ │ +above the limit.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_block_ratelimit |
│ │ │ │ +int |
│ │ │ │ +5 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the max number of packets per second a DHT node is allowed to send
│ │ │ │ +without getting banned.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_item_lifetime |
│ │ │ │ +int |
│ │ │ │ +0 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the number of seconds a immutable/mutable item will be expired.
│ │ │ │ +default is 0, means never expires.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_sample_infohashes_interval |
│ │ │ │ +int |
│ │ │ │ +21600 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the info-hashes sample recomputation interval (in seconds).
│ │ │ │ +The node will precompute a subset of the tracked info-hashes and return
│ │ │ │ +that instead of calculating it upon each request. The permissible range
│ │ │ │ +is between 0 and 21600 seconds (inclusive).
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +dht_max_infohashes_sample_count |
│ │ │ │ +int |
│ │ │ │ +20 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
the maximum number of elements in the sampled subset of info-hashes.
│ │ │ │ +If this number is too big, expect the DHT storage implementations
│ │ │ │ +to clamp it in order to allow UDP packets go through
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +max_piece_count |
│ │ │ │ +int |
│ │ │ │ +0x200000 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
max_piece_count is the maximum allowed number of pieces in
│ │ │ │ +metadata received via magnet links. Loading large torrents (with
│ │ │ │ +more pieces than the default limit) may also require passing in
│ │ │ │ +a higher limit to read_resume_data() and
│ │ │ │ +torrent_info::parse_info_section(), if those are used.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +metadata_token_limit |
│ │ │ │ +int |
│ │ │ │ +2500000 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when receiving metadata (torrent file) from peers, this is the
│ │ │ │ +max number of bencoded tokens we're willing to parse. This limit
│ │ │ │ +is meant to prevent DoS attacks on peers. For very large
│ │ │ │ +torrents, this limit may have to be raised.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +disk_write_mode |
│ │ │ │ +int |
│ │ │ │ +settings_pack::mmap_write_mode_t::auto_mmap_write |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
controls whether disk writes will be made through a memory mapped
│ │ │ │ +file or via normal write calls. This only affects the
│ │ │ │ +mmap_disk_io. When saving to a non-local drive (network share,
│ │ │ │ +NFS or NAS) using memory mapped files is most likely inferior.
│ │ │ │ +When writing to a local SSD (especially in DAX mode) using memory
│ │ │ │ +mapped files likely gives the best performance.
│ │ │ │ +The values for this setting are specified as mmap_write_mode_t.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +mmap_file_size_cutoff |
│ │ │ │ +int |
│ │ │ │ +40 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
when using mmap_disk_io, files smaller than this number of blocks
│ │ │ │ +will not be memory mapped, but will use normal pread/pwrite
│ │ │ │ +operations. This file size limit is specified in 16 kiB blocks.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +i2p_inbound_quantity |
│ │ │ │ +int |
│ │ │ │ +3 |
│ │ │ │ +
│ │ │ │ +i2p_outbound_quantity |
│ │ │ │ +int |
│ │ │ │ +3 |
│ │ │ │ +
│ │ │ │ +i2p_inbound_length |
│ │ │ │ +int |
│ │ │ │ +3 |
│ │ │ │ +
│ │ │ │ +i2p_outbound_length |
│ │ │ │ +int |
│ │ │ │ +3 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
Configures the SAM session
│ │ │ │ +quantity of I2P inbound and outbound tunnels [1..16].
│ │ │ │ +number of hops for I2P inbound and outbound tunnels [0..7]
│ │ │ │ +Changing these will not trigger a reconnect to the SAM bridge,
│ │ │ │ +they will take effect the next time the SAM connection is
│ │ │ │ +re-established (by restarting or changing i2p_hostname or
│ │ │ │ +i2p_port).
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +type |
│ │ │ │ +default |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +announce_port |
│ │ │ │ +int |
│ │ │ │ +0 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
announce_port is the port passed along as the port parameter
│ │ │ │ +to remote trackers such as HTTP or DHT. This setting does not affect
│ │ │ │ +the effective listening port nor local service discovery announcements.
│ │ │ │ +If left as zero (default), the listening port value is used.
│ │ │ │ +
│ │ │ │ +
Note
│ │ │ │ +
This setting is only meant for very special cases where a
│ │ │ │ +seed's listening port differs from the external port. As an
│ │ │ │ +example, if a local proxy is used and that the proxy supports
│ │ │ │ +reverse tunnels through NAT-PMP, the tracker must connect to
│ │ │ │ +the external NAT-PMP port (configured using announce_port)
│ │ │ │ +instead of the actual local listening port.
│ │ │ │
│ │ │ │ -
│ │ │ │ -
entry
│ │ │ │ -
Declared in "libtorrent/entry.hpp"
│ │ │ │ -
The entry class represents one node in a bencoded hierarchy. It works as a
│ │ │ │ -variant type, it can be either a list, a dictionary (std::map), an integer
│ │ │ │ -or a string.
│ │ │ │ -
│ │ │ │ -class entry
│ │ │ │ -{
│ │ │ │ - data_type type () const;
│ │ │ │ - entry (preformatted_type);
│ │ │ │ - entry (integer_type);
│ │ │ │ - entry (dictionary_type);
│ │ │ │ - entry (span<char const>);
│ │ │ │ - entry (list_type);
│ │ │ │ - entry (U v);
│ │ │ │ - entry (data_type t);
│ │ │ │ - entry (bdecode_node const& n);
│ │ │ │ - entry& operator= (preformatted_type) &;
│ │ │ │ - entry& operator= (bdecode_node const&) &;
│ │ │ │ - entry& operator= (entry const&) &;
│ │ │ │ - entry& operator= (integer_type) &;
│ │ │ │ - entry& operator= (span<char const>) &;
│ │ │ │ - entry& operator= (entry&&) & noexcept;
│ │ │ │ - entry& operator= (dictionary_type) &;
│ │ │ │ - entry& operator= (list_type) &;
│ │ │ │ - entry& operator= (U v) &;
│ │ │ │ - integer_type& integer ();
│ │ │ │ - string_type const& string () const;
│ │ │ │ - preformatted_type const& preformatted () const;
│ │ │ │ - list_type& list ();
│ │ │ │ - string_type& string ();
│ │ │ │ - preformatted_type& preformatted ();
│ │ │ │ - integer_type const& integer () const;
│ │ │ │ - dictionary_type& dict ();
│ │ │ │ - dictionary_type const& dict () const;
│ │ │ │ - list_type const& list () const;
│ │ │ │ - void swap (entry& e);
│ │ │ │ - entry& operator[] (string_view key);
│ │ │ │ - entry const& operator[] (string_view key) const;
│ │ │ │ - entry* find_key (string_view key);
│ │ │ │ - entry const* find_key (string_view key) const;
│ │ │ │ - std::string to_string (bool single_line = false) const;
│ │ │ │ -
│ │ │ │ - enum data_type
│ │ │ │ - {
│ │ │ │ - int_t,
│ │ │ │ - string_t,
│ │ │ │ - list_t,
│ │ │ │ - dictionary_t,
│ │ │ │ - undefined_t,
│ │ │ │ - preformatted_t,
│ │ │ │ - };
│ │ │ │ -};
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
type()
│ │ │ │ -
│ │ │ │ -data_type type () const;
│ │ │ │ -
│ │ │ │ -
returns the concrete type of the entry
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
entry()
│ │ │ │ -
│ │ │ │ -entry (preformatted_type);
│ │ │ │ -entry (integer_type);
│ │ │ │ -entry (dictionary_type);
│ │ │ │ -entry (span<char const>);
│ │ │ │ -entry (list_type);
│ │ │ │ -
│ │ │ │ -
constructors directly from a specific type.
│ │ │ │ -The content of the argument is copied into the
│ │ │ │ -newly constructed entry
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
entry()
│ │ │ │ -
│ │ │ │ -entry (data_type t);
│ │ │ │ -
│ │ │ │ -
construct an empty entry of the specified type.
│ │ │ │ -see data_type enum.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
entry()
│ │ │ │ -
│ │ │ │ -entry (bdecode_node const& n);
│ │ │ │ -
│ │ │ │ -
construct from bdecode_node parsed form (see bdecode())
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
operator=()
│ │ │ │
│ │ │ │ -entry& operator= (preformatted_type) &;
│ │ │ │ -entry& operator= (bdecode_node const&) &;
│ │ │ │ -entry& operator= (entry const&) &;
│ │ │ │ -entry& operator= (integer_type) &;
│ │ │ │ -entry& operator= (span<char const>) &;
│ │ │ │ -entry& operator= (entry&&) & noexcept;
│ │ │ │ -entry& operator= (dictionary_type) &;
│ │ │ │ -entry& operator= (list_type) &;
│ │ │ │ +struct settings_pack final : settings_interface
│ │ │ │ +{
│ │ │ │ + friend void apply_pack_impl (settings_pack const*
│ │ │ │ + , aux::session_settings_single_thread&
│ │ │ │ + , std::vector<void(aux::session_impl::*)()>*);
│ │ │ │ + void set_str (int name, std::string val) override;
│ │ │ │ + void set_int (int name, int val) override;
│ │ │ │ + void set_int (int name, flags::bitfield_flag<Type, Tag> const val);
│ │ │ │ + void set_bool (int name, bool val) override;
│ │ │ │ + bool has_val (int name) const override;
│ │ │ │ + void clear ();
│ │ │ │ + void clear (int name);
│ │ │ │ + int get_int (int name) const override;
│ │ │ │ + std::string const& get_str (int name) const override;
│ │ │ │ + bool get_bool (int name) const override;
│ │ │ │ + void for_each (Fun&& f) const;
│ │ │ │ +
│ │ │ │ + enum type_bases
│ │ │ │ + {
│ │ │ │ + string_type_base,
│ │ │ │ + int_type_base,
│ │ │ │ + bool_type_base,
│ │ │ │ + type_mask,
│ │ │ │ + index_mask,
│ │ │ │ + };
│ │ │ │ +
│ │ │ │ + enum mmap_write_mode_t
│ │ │ │ + {
│ │ │ │ + always_pwrite,
│ │ │ │ + always_mmap_write,
│ │ │ │ + auto_mmap_write,
│ │ │ │ + };
│ │ │ │ +
│ │ │ │ + enum suggest_mode_t
│ │ │ │ + {
│ │ │ │ + no_piece_suggestions,
│ │ │ │ + suggest_read_cache,
│ │ │ │ + };
│ │ │ │ +
│ │ │ │ + enum choking_algorithm_t
│ │ │ │ + {
│ │ │ │ + fixed_slots_choker,
│ │ │ │ + rate_based_choker,
│ │ │ │ + deprecated_bittyrant_choker,
│ │ │ │ + };
│ │ │ │ +
│ │ │ │ + enum seed_choking_algorithm_t
│ │ │ │ + {
│ │ │ │ + round_robin,
│ │ │ │ + fastest_upload,
│ │ │ │ + anti_leech,
│ │ │ │ + };
│ │ │ │ +
│ │ │ │ + enum io_buffer_mode_t
│ │ │ │ + {
│ │ │ │ + enable_os_cache,
│ │ │ │ + deprecated_disable_os_cache_for_aligned_files,
│ │ │ │ + disable_os_cache,
│ │ │ │ + write_through,
│ │ │ │ + };
│ │ │ │ +
│ │ │ │ + enum bandwidth_mixed_algo_t
│ │ │ │ + {
│ │ │ │ + prefer_tcp,
│ │ │ │ + peer_proportional,
│ │ │ │ + };
│ │ │ │ +
│ │ │ │ + enum enc_policy
│ │ │ │ + {
│ │ │ │ + pe_forced,
│ │ │ │ + pe_enabled,
│ │ │ │ + pe_disabled,
│ │ │ │ + };
│ │ │ │ +
│ │ │ │ + enum enc_level
│ │ │ │ + {
│ │ │ │ + pe_plaintext,
│ │ │ │ + pe_rc4,
│ │ │ │ + pe_both,
│ │ │ │ + };
│ │ │ │ +
│ │ │ │ + enum proxy_type_t
│ │ │ │ + {
│ │ │ │ + none,
│ │ │ │ + socks4,
│ │ │ │ + socks5,
│ │ │ │ + socks5_pw,
│ │ │ │ + http,
│ │ │ │ + http_pw,
│ │ │ │ + };
│ │ │ │ +};
│ │ │ │
│ │ │ │ -
copies the structure of the right hand side into this
│ │ │ │ -entry.
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
list() preformatted() dict() integer() string()
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
[report issue]
│ │ │ │ +
set_int() set_str() set_bool()
│ │ │ │
│ │ │ │ -integer_type& integer ();
│ │ │ │ -string_type const& string () const;
│ │ │ │ -preformatted_type const& preformatted () const;
│ │ │ │ -list_type& list ();
│ │ │ │ -string_type& string ();
│ │ │ │ -preformatted_type& preformatted ();
│ │ │ │ -integer_type const& integer () const;
│ │ │ │ -dictionary_type& dict ();
│ │ │ │ -dictionary_type const& dict () const;
│ │ │ │ -list_type const& list () const;
│ │ │ │ -
│ │ │ │ -
The integer(), string(), list() and dict() functions
│ │ │ │ -are accessors that return the respective type. If the entry object
│ │ │ │ -isn't of the type you request, the accessor will throw
│ │ │ │ -system_error. You can ask an entry for its type through the
│ │ │ │ -type() function.
│ │ │ │ -
If you want to create an entry you give it the type you want it to
│ │ │ │ -have in its constructor, and then use one of the non-const accessors
│ │ │ │ -to get a reference which you then can assign the value you want it to
│ │ │ │ -have.
│ │ │ │ -
The typical code to get info from a torrent file will then look like
│ │ │ │ -this:
│ │ │ │ -
│ │ │ │ -entry torrent_file;
│ │ │ │ -
│ │ │ │ -entry::dictionary_type const& dict = torrent_file.dict();
│ │ │ │ -entry::dictionary_type::const_iterator i;
│ │ │ │ -i = dict.find("announce");
│ │ │ │ -if (i != dict.end())
│ │ │ │ -{
│ │ │ │ - std::string tracker_url = i->second.string();
│ │ │ │ - std::cout << tracker_url << "\n";
│ │ │ │ -}
│ │ │ │ -
│ │ │ │ -
The following code is equivalent, but a little bit shorter:
│ │ │ │ -
│ │ │ │ -entry torrent_file;
│ │ │ │ -
│ │ │ │ -if (entry* i = torrent_file.find_key("announce"))
│ │ │ │ -{
│ │ │ │ - std::string tracker_url = i->string();
│ │ │ │ - std::cout << tracker_url << "\n";
│ │ │ │ -}
│ │ │ │ +void set_str (int name, std::string val) override;
│ │ │ │ +void set_int (int name, int val) override;
│ │ │ │ +void set_int (int name, flags::bitfield_flag<Type, Tag> const val);
│ │ │ │ +void set_bool (int name, bool val) override;
│ │ │ │
│ │ │ │ -
To make it easier to extract information from a torrent file, the
│ │ │ │ -class torrent_info exists.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
swap()
│ │ │ │ +
set a configuration option in the settings_pack. name is one of
│ │ │ │ +the enum values from string_types, int_types or bool_types. They must
│ │ │ │ +match the respective type of the set_* function.
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
has_val()
│ │ │ │
│ │ │ │ -void swap (entry& e);
│ │ │ │ +bool has_val (int name) const override;
│ │ │ │
│ │ │ │ -
swaps the content of this with e.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
operator[]()
│ │ │ │ +
queries whether the specified configuration option has a value set in
│ │ │ │ +this pack. name can be any enumeration value from string_types,
│ │ │ │ +int_types or bool_types.
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
clear()
│ │ │ │
│ │ │ │ -entry& operator[] (string_view key);
│ │ │ │ -entry const& operator[] (string_view key) const;
│ │ │ │ +void clear ();
│ │ │ │
│ │ │ │ -
All of these functions requires the entry to be a dictionary, if it
│ │ │ │ -isn't they will throw system_error.
│ │ │ │ -
The non-const versions of the operator[] will return a reference
│ │ │ │ -to either the existing element at the given key or, if there is no
│ │ │ │ -element with the given key, a reference to a newly inserted element at
│ │ │ │ -that key.
│ │ │ │ -
The const version of operator[] will only return a reference to an
│ │ │ │ -existing element at the given key. If the key is not found, it will
│ │ │ │ -throw system_error.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
find_key()
│ │ │ │ +
clear the settings pack from all settings
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
clear()
│ │ │ │
│ │ │ │ -entry* find_key (string_view key);
│ │ │ │ -entry const* find_key (string_view key) const;
│ │ │ │ +void clear (int name);
│ │ │ │
│ │ │ │ -
These functions requires the entry to be a dictionary, if it isn't
│ │ │ │ -they will throw system_error.
│ │ │ │ -
They will look for an element at the given key in the dictionary, if
│ │ │ │ -the element cannot be found, they will return nullptr. If an element
│ │ │ │ -with the given key is found, the return a pointer to it.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
to_string()
│ │ │ │ +
clear a specific setting from the pack
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
get_bool() get_str() get_int()
│ │ │ │
│ │ │ │ -std::string to_string (bool single_line = false) const;
│ │ │ │ +int get_int (int name) const override;
│ │ │ │ +std::string const& get_str (int name) const override;
│ │ │ │ +bool get_bool (int name) const override;
│ │ │ │
│ │ │ │ -
returns a pretty-printed string representation
│ │ │ │ -of the bencoded structure, with JSON-style syntax
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
enum data_type
│ │ │ │ -
Declared in "libtorrent/entry.hpp"
│ │ │ │ +
queries the current configuration option from the settings_pack.
│ │ │ │ +name is one of the enumeration values from string_types, int_types
│ │ │ │ +or bool_types. The enum value must match the type of the get_*
│ │ │ │ +function. If the specified setting field has not been set, the default
│ │ │ │ +value is returned.
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
enum type_bases
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +value |
│ │ │ │ +description |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +string_type_base |
│ │ │ │ +0 |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +int_type_base |
│ │ │ │ +16384 |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +bool_type_base |
│ │ │ │ +32768 |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +type_mask |
│ │ │ │ +49152 |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +index_mask |
│ │ │ │ +16383 |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
enum mmap_write_mode_t
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +value |
│ │ │ │ +description |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +always_pwrite |
│ │ │ │ +0 |
│ │ │ │ +disable writing to disk via mmap, always use normal write calls |
│ │ │ │ +
│ │ │ │ +always_mmap_write |
│ │ │ │ +1 |
│ │ │ │ +prefer using memory mapped files for disk writes (at least for
│ │ │ │ +large files where it might make sense) |
│ │ │ │ +
│ │ │ │ +auto_mmap_write |
│ │ │ │ +2 |
│ │ │ │ +determine whether to use pwrite or memory mapped files for disk
│ │ │ │ +writes depending on the kind of storage behind the save path |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
enum suggest_mode_t
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +value |
│ │ │ │ +description |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +no_piece_suggestions |
│ │ │ │ +0 |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +suggest_read_cache |
│ │ │ │ +1 |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
enum choking_algorithm_t
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +value |
│ │ │ │ +description |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +fixed_slots_choker |
│ │ │ │ +0 |
│ │ │ │ +This is the traditional choker with a fixed number of unchoke
│ │ │ │ +slots (as specified by settings_pack::unchoke_slots_limit). |
│ │ │ │ +
│ │ │ │ +rate_based_choker |
│ │ │ │ +2 |
│ │ │ │ +This opens up unchoke slots based on the upload rate achieved to
│ │ │ │ +peers. The more slots that are opened, the marginal upload rate
│ │ │ │ +required to open up another slot increases. Configure the initial
│ │ │ │ +threshold with settings_pack::rate_choker_initial_threshold.
│ │ │ │ +For more information, see rate based choking.
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +deprecated_bittyrant_choker |
│ │ │ │ +3 |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
enum seed_choking_algorithm_t
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +value |
│ │ │ │ +description |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +round_robin |
│ │ │ │ +0 |
│ │ │ │ +which round-robins the peers that are unchoked
│ │ │ │ +when seeding. This distributes the upload bandwidth uniformly and
│ │ │ │ +fairly. It minimizes the ability for a peer to download everything
│ │ │ │ +without redistributing it. |
│ │ │ │ +
│ │ │ │ +fastest_upload |
│ │ │ │ +1 |
│ │ │ │ +unchokes the peers we can send to the fastest. This might be a
│ │ │ │ +bit more reliable in utilizing all available capacity. |
│ │ │ │ +
│ │ │ │ +anti_leech |
│ │ │ │ +2 |
│ │ │ │ +prioritizes peers who have just started or are
│ │ │ │ +just about to finish the download. The intention is to force
│ │ │ │ +peers in the middle of the download to trade with each other.
│ │ │ │ +This does not just take into account the pieces a peer is
│ │ │ │ +reporting having downloaded, but also the pieces we have sent
│ │ │ │ +to it. |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
enum io_buffer_mode_t
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │
│ │ │ │
│ │ │ │ name |
│ │ │ │ value |
│ │ │ │ description |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -int_t |
│ │ │ │ +
enable_os_cache |
│ │ │ │ 0 |
│ │ │ │ |
│ │ │ │
│ │ │ │ -string_t |
│ │ │ │ +
deprecated_disable_os_cache_for_aligned_files |
│ │ │ │ 1 |
│ │ │ │ |
│ │ │ │
│ │ │ │ -list_t |
│ │ │ │ +
disable_os_cache |
│ │ │ │ 2 |
│ │ │ │ |
│ │ │ │
│ │ │ │ -dictionary_t |
│ │ │ │ +
write_through |
│ │ │ │ 3 |
│ │ │ │ |
│ │ │ │
│ │ │ │ -undefined_t |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
enum bandwidth_mixed_algo_t
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +value |
│ │ │ │ +description |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +prefer_tcp |
│ │ │ │ +0 |
│ │ │ │ +disables the mixed mode bandwidth balancing |
│ │ │ │ +
│ │ │ │ +peer_proportional |
│ │ │ │ +1 |
│ │ │ │ +does not throttle uTP, throttles TCP to the same proportion
│ │ │ │ +of throughput as there are TCP connections |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
enum enc_policy
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +value |
│ │ │ │ +description |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +pe_forced |
│ │ │ │ +0 |
│ │ │ │ +Only encrypted connections are allowed. Incoming connections that
│ │ │ │ +are not encrypted are closed and if the encrypted outgoing
│ │ │ │ +connection fails, a non-encrypted retry will not be made. |
│ │ │ │ +
│ │ │ │ +pe_enabled |
│ │ │ │ +1 |
│ │ │ │ +encrypted connections are enabled, but non-encrypted connections
│ │ │ │ +are allowed. An incoming non-encrypted connection will be accepted,
│ │ │ │ +and if an outgoing encrypted connection fails, a non- encrypted
│ │ │ │ +connection will be tried. |
│ │ │ │ +
│ │ │ │ +pe_disabled |
│ │ │ │ +2 |
│ │ │ │ +only non-encrypted connections are allowed. |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
enum enc_level
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +value |
│ │ │ │ +description |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +pe_plaintext |
│ │ │ │ +1 |
│ │ │ │ +use only plain text encryption |
│ │ │ │ +
│ │ │ │ +pe_rc4 |
│ │ │ │ +2 |
│ │ │ │ +use only RC4 encryption |
│ │ │ │ +
│ │ │ │ +pe_both |
│ │ │ │ +3 |
│ │ │ │ +allow both |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
enum proxy_type_t
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +name |
│ │ │ │ +value |
│ │ │ │ +description |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +none |
│ │ │ │ +0 |
│ │ │ │ +No proxy server is used and all other fields are ignored. |
│ │ │ │ +
│ │ │ │ +socks4 |
│ │ │ │ +1 |
│ │ │ │ +The server is assumed to be a SOCKS4 server that requires a
│ │ │ │ +username. |
│ │ │ │ +
│ │ │ │ +socks5 |
│ │ │ │ +2 |
│ │ │ │ +The server is assumed to be a SOCKS5 server (RFC 1928) that does
│ │ │ │ +not require any authentication. The username and password are
│ │ │ │ +ignored. |
│ │ │ │ +
│ │ │ │ +socks5_pw |
│ │ │ │ +3 |
│ │ │ │ +The server is assumed to be a SOCKS5 server that supports plain
│ │ │ │ +text username and password authentication (RFC 1929). The
│ │ │ │ +username and password specified may be sent to the proxy if it
│ │ │ │ +requires. |
│ │ │ │ +
│ │ │ │ +http |
│ │ │ │ 4 |
│ │ │ │ - |
│ │ │ │ +The server is assumed to be an HTTP proxy. If the transport used
│ │ │ │ +for the connection is non-HTTP, the server is assumed to support
│ │ │ │ +the CONNECT method. i.e. for web seeds and HTTP trackers, a plain
│ │ │ │ +proxy will suffice. The proxy is assumed to not require
│ │ │ │ +authorization. The username and password will not be used. |
│ │ │ │
│ │ │ │ -preformatted_t |
│ │ │ │ +
http_pw |
│ │ │ │ 5 |
│ │ │ │ - |
│ │ │ │ +The server is assumed to be an HTTP proxy that requires user
│ │ │ │ +authorization. The username and password will be sent to the proxy. |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
operator<<()
│ │ │ │ -
Declared in "libtorrent/entry.hpp"
│ │ │ │ -
│ │ │ │ -inline std::ostream& operator<< (std::ostream& os, const entry& e);
│ │ │ │ -
│ │ │ │ -
prints the bencoded structure to the ostream as a JSON-style structure.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
bencode()
│ │ │ │ -
Declared in "libtorrent/bencode.hpp"
│ │ │ │ -
│ │ │ │ -template<class OutIt> int bencode (OutIt out, const entry& e);
│ │ │ │ -
│ │ │ │ -
This function will encode data to bencoded form.
│ │ │ │ -
The entry class is the internal representation of the bencoded data
│ │ │ │ -and it can be used to retrieve information, an entry can also be build by
│ │ │ │ -the program and given to bencode() to encode it into the OutIt
│ │ │ │ -iterator.
│ │ │ │ -
OutIt is an OutputIterator. It's a template and usually
│ │ │ │ -instantiated as ostream_iterator or back_insert_iterator. This
│ │ │ │ -function assumes the value_type of the iterator is a char.
│ │ │ │ -In order to encode entry e into a buffer, do:
│ │ │ │ -
│ │ │ │ -std::vector<char> buf;
│ │ │ │ -bencode(std::back_inserter(buf), e);
│ │ │ │ -
│ │ │ │ -
libtorrent has a plugin interface for implementing extensions to the protocol.
│ │ │ │ -These can be general extensions for transferring metadata or peer exchange
│ │ │ │ -extensions, or it could be used to provide a way to customize the protocol
│ │ │ │ -to fit a particular (closed) network.
│ │ │ │ -
In short, the plugin interface makes it possible to:
│ │ │ │ -
│ │ │ │ -- register extension messages (sent in the extension handshake), see
│ │ │ │ -extensions.
│ │ │ │ -- add data and parse data from the extension handshake.
│ │ │ │ -- send extension messages and standard bittorrent messages.
│ │ │ │ -- override or block the handling of standard bittorrent messages.
│ │ │ │ -- save and restore state via the session state
│ │ │ │ -- see all alerts that are posted
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
a word of caution
│ │ │ │ -
Writing your own plugin is a very easy way to introduce serious bugs such as
│ │ │ │ -dead locks and race conditions. Since a plugin has access to internal
│ │ │ │ -structures it is also quite easy to sabotage libtorrent's operation.
│ │ │ │ -
All the callbacks are always called from the libtorrent network thread. In
│ │ │ │ -case portions of your plugin are called from other threads, typically the main
│ │ │ │ -thread, you cannot use any of the member functions on the internal structures
│ │ │ │ -in libtorrent, since those require being called from the libtorrent network
│ │ │ │ -thread . Furthermore, you also need to synchronize your own shared data
│ │ │ │ -within the plugin, to make sure it is not accessed at the same time from the
│ │ │ │ -libtorrent thread (through a callback). If you need to send out a message
│ │ │ │ -from another thread, it is advised to use an internal queue, and do the
│ │ │ │ -actual sending in tick().
│ │ │ │ -
Since the plugin interface gives you easy access to internal structures, it
│ │ │ │ -is not supported as a stable API. Plugins should be considered specific to a
│ │ │ │ -specific version of libtorrent. Although, in practice the internals mostly
│ │ │ │ -don't change that dramatically.
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
plugin-interface
│ │ │ │ -
The plugin interface consists of three base classes that the plugin may
│ │ │ │ -implement. These are called plugin, torrent_plugin and peer_plugin.
│ │ │ │ -They are found in the <libtorrent/extensions.hpp> header.
│ │ │ │ -
These plugins are instantiated for each session, torrent and possibly each peer,
│ │ │ │ -respectively.
│ │ │ │ -
For plugins that only need per torrent state, it is enough to only implement
│ │ │ │ -torrent_plugin and pass a constructor function or function object to
│ │ │ │ -session::add_extension() or torrent_handle::add_extension() (if the
│ │ │ │ -torrent has already been started and you want to hook in the extension at
│ │ │ │ -run-time).
│ │ │ │ -
The signature of the function is:
│ │ │ │ -
│ │ │ │ -std::shared_ptr<torrent_plugin> (*)(torrent_handle const&, client_data_t);
│ │ │ │ -
│ │ │ │ -
The second argument is the userdata passed to session::add_torrent() or
│ │ │ │ -torrent_handle::add_extension().
│ │ │ │ -
The function should return a std::shared_ptr<torrent_plugin> which
│ │ │ │ -may or may not be 0. If it is a nullptr, the extension is simply ignored
│ │ │ │ -for this torrent. If it is a valid pointer (to a class inheriting
│ │ │ │ -torrent_plugin), it will be associated with this torrent and callbacks
│ │ │ │ -will be made on torrent events.
│ │ │ │ -
For more elaborate plugins which require session wide state, you would
│ │ │ │ -implement plugin, construct an object (in a std::shared_ptr) and pass
│ │ │ │ -it in to session::add_extension().
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
custom alerts
│ │ │ │ -
Since plugins are running within internal libtorrent threads, one convenient
│ │ │ │ -way to communicate with the client is to post custom alerts.
│ │ │ │ -
The expected interface of any alert, apart from deriving from the alert
│ │ │ │ -base class, looks like this:
│ │ │ │ -
│ │ │ │ -static const int alert_type = <unique alert ID>;
│ │ │ │ -virtual int type() const { return alert_type; }
│ │ │ │ -
│ │ │ │ -virtual std::string message() const;
│ │ │ │ -
│ │ │ │ -static const alert_category_t static_category = <bitmask of alert::category_t flags>;
│ │ │ │ -virtual alert_category_t category() const { return static_category; }
│ │ │ │ -
│ │ │ │ -virtual char const* what() const { return <string literal of the name of this alert>; }
│ │ │ │ -
│ │ │ │ -
The alert_type is used for the type-checking in alert_cast. It must
│ │ │ │ -not collide with any other alert. The built-in alerts in libtorrent will
│ │ │ │ -not use alert type IDs greater than user_alert_id. When defining your
│ │ │ │ -own alert, make sure it's greater than this constant.
│ │ │ │ -
type() is the run-time equivalence of the alert_type.
│ │ │ │ -
The message() virtual function is expected to construct a useful
│ │ │ │ -string representation of the alert and the event or data it represents.
│ │ │ │ -Something convenient to put in a log file for instance.
│ │ │ │ -
clone() is used internally to copy alerts. The suggested implementation
│ │ │ │ -of simply allocating a new instance as a copy of *this is all that's
│ │ │ │ -expected.
│ │ │ │ -
The static category is required for checking whether or not the category
│ │ │ │ -for a specific alert is enabled or not, without instantiating the alert.
│ │ │ │ -The category virtual function is the run-time equivalence.
│ │ │ │ -
The what() virtual function may simply be a string literal of the class
│ │ │ │ -name of your alert.
│ │ │ │ -
For more information, see the alert section.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
plugin
│ │ │ │ -
Declared in "libtorrent/extensions.hpp"
│ │ │ │ -
this is the base class for a session plugin. One primary feature
│ │ │ │ -is that it is notified of all torrents that are added to the session,
│ │ │ │ -and can add its own torrent_plugins.
│ │ │ │ -
│ │ │ │ -struct plugin
│ │ │ │ -{
│ │ │ │ - virtual feature_flags_t implemented_features ();
│ │ │ │ - virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);
│ │ │ │ - virtual void added (session_handle const&);
│ │ │ │ - virtual void abort ();
│ │ │ │ - virtual bool on_dht_request (string_view /* query */
│ │ │ │ - , udp::endpoint const& /* source */, bdecode_node const& /* message */
│ │ │ │ - , entry& /* response */);
│ │ │ │ - virtual void on_alert (alert const*);
│ │ │ │ - virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */
│ │ │ │ - , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);
│ │ │ │ - virtual void on_tick ();
│ │ │ │ - virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);
│ │ │ │ - virtual std::map<std::string, std::string> save_state () const;
│ │ │ │ - virtual void load_state (std::map<std::string, std::string> const&);
│ │ │ │ -
│ │ │ │ - static constexpr feature_flags_t optimistic_unchoke_feature = 1_bit;
│ │ │ │ - static constexpr feature_flags_t tick_feature = 2_bit;
│ │ │ │ - static constexpr feature_flags_t dht_request_feature = 3_bit;
│ │ │ │ - static constexpr feature_flags_t alert_feature = 4_bit;
│ │ │ │ - static constexpr feature_flags_t unknown_torrent_feature = 5_bit;
│ │ │ │ -};
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
implemented_features()
│ │ │ │ -
│ │ │ │ -virtual feature_flags_t implemented_features ();
│ │ │ │ -
│ │ │ │ -
This function is expected to return a bitmask indicating which features
│ │ │ │ -this plugin implements. Some callbacks on this object may not be called
│ │ │ │ -unless the corresponding feature flag is returned here. Note that
│ │ │ │ -callbacks may still be called even if the corresponding feature is not
│ │ │ │ -specified in the return value here. See feature_flags_t for possible
│ │ │ │ -flags to return.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
new_torrent()
│ │ │ │ -
│ │ │ │ -virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);
│ │ │ │ -
│ │ │ │ -
this is called by the session every time a new torrent is added.
│ │ │ │ -The torrent* points to the internal torrent object created
│ │ │ │ -for the new torrent. The client_data_t is the userdata pointer as
│ │ │ │ -passed in via add_torrent_params.
│ │ │ │ -
If the plugin returns a torrent_plugin instance, it will be added
│ │ │ │ -to the new torrent. Otherwise, return an empty shared_ptr to a
│ │ │ │ -torrent_plugin (the default).
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
added()
│ │ │ │ -
│ │ │ │ -virtual void added (session_handle const&);
│ │ │ │ -
│ │ │ │ -
called when plugin is added to a session
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
abort()
│ │ │ │ -
│ │ │ │ -virtual void abort ();
│ │ │ │ -
│ │ │ │ -
called when the session is aborted
│ │ │ │ -the plugin should perform any cleanup necessary to allow the session's
│ │ │ │ -destruction (e.g. cancel outstanding async operations)
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_dht_request()
│ │ │ │ -
│ │ │ │ -virtual bool on_dht_request (string_view /* query */
│ │ │ │ - , udp::endpoint const& /* source */, bdecode_node const& /* message */
│ │ │ │ - , entry& /* response */);
│ │ │ │ -
│ │ │ │ -
called when a dht request is received.
│ │ │ │ -If your plugin expects this to be called, make sure to include the flag
│ │ │ │ -dht_request_feature in the return value from implemented_features().
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_alert()
│ │ │ │ -
│ │ │ │ -virtual void on_alert (alert const*);
│ │ │ │ -
│ │ │ │ -
called when an alert is posted alerts that are filtered are not posted.
│ │ │ │ -If your plugin expects this to be called, make sure to include the flag
│ │ │ │ -alert_feature in the return value from implemented_features().
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_unknown_torrent()
│ │ │ │ -
│ │ │ │ -virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */
│ │ │ │ - , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);
│ │ │ │ -
│ │ │ │ -
return true if the add_torrent_params should be added
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_tick()
│ │ │ │ -
│ │ │ │ -virtual void on_tick ();
│ │ │ │ -
│ │ │ │ -
called once per second.
│ │ │ │ -If your plugin expects this to be called, make sure to include the flag
│ │ │ │ -tick_feature in the return value from implemented_features().
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
get_unchoke_priority()
│ │ │ │ -
│ │ │ │ -virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);
│ │ │ │ -
│ │ │ │ -
called when choosing peers to optimistically unchoke. The return value
│ │ │ │ -indicates the peer's priority for unchoking. Lower return values
│ │ │ │ -correspond to higher priority. Priorities above 2^63-1 are reserved.
│ │ │ │ -If your plugin has no priority to assign a peer it should return 2^64-1.
│ │ │ │ -If your plugin expects this to be called, make sure to include the flag
│ │ │ │ -optimistic_unchoke_feature in the return value from implemented_features().
│ │ │ │ -If multiple plugins implement this function the lowest return value
│ │ │ │ -(i.e. the highest priority) is used.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
load_state()
│ │ │ │ -
│ │ │ │ -virtual void load_state (std::map<std::string, std::string> const&);
│ │ │ │ -
│ │ │ │ -
called on startup while loading settings state from the session_params
│ │ │ │ -
[report issue]
│ │ │ │ -- optimistic_unchoke_feature
│ │ │ │ -- include this bit if your plugin needs to alter the order of the
│ │ │ │ -optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()
│ │ │ │ -callback be called.
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -- tick_feature
│ │ │ │ -- include this bit if your plugin needs to have on_tick() called
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -- dht_request_feature
│ │ │ │ -- include this bit if your plugin needs to have on_dht_request()
│ │ │ │ -called
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -- alert_feature
│ │ │ │ -- include this bit if your plugin needs to have on_alert()
│ │ │ │ -called
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -- unknown_torrent_feature
│ │ │ │ -- include this bit if your plugin needs to have on_unknown_torrent()
│ │ │ │ -called even if there is no active torrent in the session
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
torrent_plugin
│ │ │ │ -
Declared in "libtorrent/extensions.hpp"
│ │ │ │ -
Torrent plugins are associated with a single torrent and have a number
│ │ │ │ -of functions called at certain events. Many of its functions have the
│ │ │ │ -ability to change or override the default libtorrent behavior.
│ │ │ │ -
│ │ │ │ -struct torrent_plugin
│ │ │ │ -{
│ │ │ │ - virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);
│ │ │ │ - virtual void on_piece_pass (piece_index_t);
│ │ │ │ - virtual void on_piece_failed (piece_index_t);
│ │ │ │ - virtual void tick ();
│ │ │ │ - virtual bool on_pause ();
│ │ │ │ - virtual bool on_resume ();
│ │ │ │ - virtual void on_files_checked ();
│ │ │ │ - virtual void on_state (torrent_status::state_t);
│ │ │ │ - virtual void on_add_peer (tcp::endpoint const&,
│ │ │ │ - peer_source_flags_t, add_peer_flags_t);
│ │ │ │ -
│ │ │ │ - static constexpr add_peer_flags_t first_time = 1_bit;
│ │ │ │ - static constexpr add_peer_flags_t filtered = 2_bit;
│ │ │ │ -};
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
new_connection()
│ │ │ │ -
│ │ │ │ -virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);
│ │ │ │ -
│ │ │ │ -
This function is called each time a new peer is connected to the torrent. You
│ │ │ │ -may choose to ignore this by just returning a default constructed
│ │ │ │ -shared_ptr (in which case you don't need to override this member
│ │ │ │ -function).
│ │ │ │ -
If you need an extension to the peer connection (which most plugins do) you
│ │ │ │ -are supposed to return an instance of your peer_plugin class. Which in
│ │ │ │ -turn will have its hook functions called on event specific to that peer.
│ │ │ │ -
The peer_connection_handle will be valid as long as the shared_ptr
│ │ │ │ -is being held by the torrent object. So, it is generally a good idea to not
│ │ │ │ -keep a shared_ptr to your own peer_plugin. If you want to keep references
│ │ │ │ -to it, use weak_ptr.
│ │ │ │ -
If this function throws an exception, the connection will be closed.
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_piece_pass() on_piece_failed()
│ │ │ │ -
│ │ │ │ -virtual void on_piece_pass (piece_index_t);
│ │ │ │ -virtual void on_piece_failed (piece_index_t);
│ │ │ │ -
│ │ │ │ -
These hooks are called when a piece passes the hash check or fails the hash
│ │ │ │ -check, respectively. The index is the piece index that was downloaded.
│ │ │ │ -It is possible to access the list of peers that participated in sending the
│ │ │ │ -piece through the torrent and the piece_picker.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
tick()
│ │ │ │ -
│ │ │ │ -virtual void tick ();
│ │ │ │ -
│ │ │ │ -
This hook is called approximately once per second. It is a way of making it
│ │ │ │ -easy for plugins to do timed events, for sending messages or whatever.
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_resume() on_pause()
│ │ │ │ -
│ │ │ │ -virtual bool on_pause ();
│ │ │ │ -virtual bool on_resume ();
│ │ │ │ -
│ │ │ │ -
These hooks are called when the torrent is paused and resumed respectively.
│ │ │ │ -The return value indicates if the event was handled. A return value of
│ │ │ │ -true indicates that it was handled, and no other plugin after this one
│ │ │ │ -will have this hook function called, and the standard handler will also not be
│ │ │ │ -invoked. So, returning true effectively overrides the standard behavior of
│ │ │ │ -pause or resume.
│ │ │ │ -
Note that if you call pause() or resume() on the torrent from your
│ │ │ │ -handler it will recurse back into your handler, so in order to invoke the
│ │ │ │ -standard handler, you have to keep your own state on whether you want standard
│ │ │ │ -behavior or overridden behavior.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_files_checked()
│ │ │ │ -
│ │ │ │ -virtual void on_files_checked ();
│ │ │ │ -
│ │ │ │ -
This function is called when the initial files of the torrent have been
│ │ │ │ -checked. If there are no files to check, this function is called immediately.
│ │ │ │ -
i.e. This function is always called when the torrent is in a state where it
│ │ │ │ -can start downloading.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_state()
│ │ │ │ -
│ │ │ │ -virtual void on_state (torrent_status::state_t);
│ │ │ │ -
│ │ │ │ -
called when the torrent changes state
│ │ │ │ -the state is one of torrent_status::state_t
│ │ │ │ -enum members
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_add_peer()
│ │ │ │ -
│ │ │ │ -virtual void on_add_peer (tcp::endpoint const&,
│ │ │ │ - peer_source_flags_t, add_peer_flags_t);
│ │ │ │ -
│ │ │ │ -
called every time a new peer is added to the peer list.
│ │ │ │ -This is before the peer is connected to. For flags, see
│ │ │ │ -torrent_plugin::flags_t. The source argument refers to
│ │ │ │ -the source where we learned about this peer from. It's a
│ │ │ │ -bitmask, because many sources may have told us about the same
│ │ │ │ -peer. For peer source flags, see peer_info::peer_source_flags.
│ │ │ │ -
[report issue]
│ │ │ │ -- first_time
│ │ │ │ -- this is the first time we see this peer
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -- filtered
│ │ │ │ -- this peer was not added because it was
│ │ │ │ -filtered by the IP filter
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
peer_plugin
│ │ │ │ -
Declared in "libtorrent/extensions.hpp"
│ │ │ │ -
peer plugins are associated with a specific peer. A peer could be
│ │ │ │ -both a regular bittorrent peer (bt_peer_connection) or one of the
│ │ │ │ -web seed connections (web_peer_connection or http_seed_connection).
│ │ │ │ -In order to only attach to certain peers, make your
│ │ │ │ -torrent_plugin::new_connection only return a plugin for certain peer
│ │ │ │ -connection types
│ │ │ │ -
│ │ │ │ -struct peer_plugin
│ │ │ │ -{
│ │ │ │ - virtual string_view type () const;
│ │ │ │ - virtual void add_handshake (entry&);
│ │ │ │ - virtual void on_disconnect (error_code const&);
│ │ │ │ - virtual void on_connected ();
│ │ │ │ - virtual bool on_handshake (span<char const>);
│ │ │ │ - virtual bool on_extension_handshake (bdecode_node const&);
│ │ │ │ - virtual bool on_bitfield (bitfield const& /*bitfield*/);
│ │ │ │ - virtual bool on_have_none ();
│ │ │ │ - virtual bool on_allowed_fast (piece_index_t);
│ │ │ │ - virtual bool on_request (peer_request const&);
│ │ │ │ - virtual bool on_unchoke ();
│ │ │ │ - virtual bool on_have (piece_index_t);
│ │ │ │ - virtual bool on_not_interested ();
│ │ │ │ - virtual bool on_have_all ();
│ │ │ │ - virtual bool on_choke ();
│ │ │ │ - virtual bool on_dont_have (piece_index_t);
│ │ │ │ - virtual bool on_interested ();
│ │ │ │ - virtual bool on_piece (peer_request const& /*piece*/
│ │ │ │ - , span<char const> /*buf*/);
│ │ │ │ - virtual bool on_suggest (piece_index_t);
│ │ │ │ - virtual bool on_cancel (peer_request const&);
│ │ │ │ - virtual bool on_reject (peer_request const&);
│ │ │ │ - virtual void sent_request (peer_request const&);
│ │ │ │ - virtual void sent_suggest (piece_index_t);
│ │ │ │ - virtual void sent_cancel (peer_request const&);
│ │ │ │ - virtual void sent_have_all ();
│ │ │ │ - virtual void sent_choke ();
│ │ │ │ - virtual void sent_have_none ();
│ │ │ │ - virtual void sent_allow_fast (piece_index_t);
│ │ │ │ - virtual void sent_reject_request (peer_request const&);
│ │ │ │ - virtual void sent_unchoke ();
│ │ │ │ - virtual void sent_have (piece_index_t);
│ │ │ │ - virtual void sent_not_interested ();
│ │ │ │ - virtual void sent_interested ();
│ │ │ │ - virtual void sent_piece (peer_request const&);
│ │ │ │ - virtual void sent_payload (int /* bytes */);
│ │ │ │ - virtual bool can_disconnect (error_code const& /*ec*/);
│ │ │ │ - virtual bool on_extended (int /*length*/, int /*msg*/,
│ │ │ │ - span<char const> /*body*/);
│ │ │ │ - virtual bool on_unknown_message (int /*length*/, int /*msg*/,
│ │ │ │ - span<char const> /*body*/);
│ │ │ │ - virtual void on_piece_pass (piece_index_t);
│ │ │ │ - virtual void on_piece_failed (piece_index_t);
│ │ │ │ - virtual void tick ();
│ │ │ │ - virtual bool write_request (peer_request const&);
│ │ │ │ -};
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
type()
│ │ │ │ -
│ │ │ │ -virtual string_view type () const;
│ │ │ │ -
│ │ │ │ -
This function is expected to return the name of
│ │ │ │ -the plugin.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
add_handshake()
│ │ │ │ -
│ │ │ │ -virtual void add_handshake (entry&);
│ │ │ │ -
│ │ │ │ -
can add entries to the extension handshake
│ │ │ │ -this is not called for web seeds
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_disconnect()
│ │ │ │ -
│ │ │ │ -virtual void on_disconnect (error_code const&);
│ │ │ │ -
│ │ │ │ -
called when the peer is being disconnected.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_connected()
│ │ │ │ -
│ │ │ │ -virtual void on_connected ();
│ │ │ │ -
│ │ │ │ -
called when the peer is successfully connected. Note that
│ │ │ │ -incoming connections will have been connected by the time
│ │ │ │ -the peer plugin is attached to it, and won't have this hook
│ │ │ │ -called.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_handshake()
│ │ │ │ -
│ │ │ │ -virtual bool on_handshake (span<char const>);
│ │ │ │ -
│ │ │ │ -
this is called when the initial bittorrent handshake is received.
│ │ │ │ -Returning false means that the other end doesn't support this extension
│ │ │ │ -and will remove it from the list of plugins. this is not called for web
│ │ │ │ -seeds
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_extension_handshake()
│ │ │ │ -
│ │ │ │ -virtual bool on_extension_handshake (bdecode_node const&);
│ │ │ │ -
│ │ │ │ -
called when the extension handshake from the other end is received
│ │ │ │ -if this returns false, it means that this extension isn't
│ │ │ │ -supported by this peer. It will result in this peer_plugin
│ │ │ │ -being removed from the peer_connection and destructed.
│ │ │ │ -this is not called for web seeds
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_dont_have() on_have_all() on_have_none() on_bitfield() on_allowed_fast() on_unchoke() on_request() on_have() on_choke() on_not_interested() on_interested()
│ │ │ │ -
│ │ │ │ -virtual bool on_bitfield (bitfield const& /*bitfield*/);
│ │ │ │ -virtual bool on_have_none ();
│ │ │ │ -virtual bool on_allowed_fast (piece_index_t);
│ │ │ │ -virtual bool on_request (peer_request const&);
│ │ │ │ -virtual bool on_unchoke ();
│ │ │ │ -virtual bool on_have (piece_index_t);
│ │ │ │ -virtual bool on_not_interested ();
│ │ │ │ -virtual bool on_have_all ();
│ │ │ │ -virtual bool on_choke ();
│ │ │ │ -virtual bool on_dont_have (piece_index_t);
│ │ │ │ -virtual bool on_interested ();
│ │ │ │ -
│ │ │ │ -
returning true from any of the message handlers
│ │ │ │ -indicates that the plugin has handled the message.
│ │ │ │ -it will break the plugin chain traversing and not let
│ │ │ │ -anyone else handle the message, including the default
│ │ │ │ -handler.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_piece()
│ │ │ │ -
│ │ │ │ -virtual bool on_piece (peer_request const& /*piece*/
│ │ │ │ - , span<char const> /*buf*/);
│ │ │ │ -
│ │ │ │ -
This function is called when the peer connection is receiving
│ │ │ │ -a piece. buf points (non-owning pointer) to the data in an
│ │ │ │ -internal immutable disk buffer. The length of the data is specified
│ │ │ │ -in the length member of the piece parameter.
│ │ │ │ -returns true to indicate that the piece is handled and the
│ │ │ │ -rest of the logic should be ignored.
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
sent_have() sent_not_interested() sent_interested() sent_unchoke() sent_piece()
│ │ │ │ -
│ │ │ │ -virtual void sent_unchoke ();
│ │ │ │ -virtual void sent_have (piece_index_t);
│ │ │ │ -virtual void sent_not_interested ();
│ │ │ │ -virtual void sent_interested ();
│ │ │ │ -virtual void sent_piece (peer_request const&);
│ │ │ │ -
│ │ │ │ -
called after a choke message has been sent to the peer
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
sent_payload()
│ │ │ │ -
│ │ │ │ -virtual void sent_payload (int /* bytes */);
│ │ │ │ -
│ │ │ │ -
called after piece data has been sent to the peer
│ │ │ │ -this can be used for stats book keeping
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
can_disconnect()
│ │ │ │ -
│ │ │ │ -virtual bool can_disconnect (error_code const& /*ec*/);
│ │ │ │ -
│ │ │ │ -
called when libtorrent think this peer should be disconnected.
│ │ │ │ -if the plugin returns false, the peer will not be disconnected.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_extended()
│ │ │ │ -
│ │ │ │ -virtual bool on_extended (int /*length*/, int /*msg*/,
│ │ │ │ - span<char const> /*body*/);
│ │ │ │ -
│ │ │ │ -
called when an extended message is received. If returning true,
│ │ │ │ -the message is not processed by any other plugin and if false
│ │ │ │ -is returned the next plugin in the chain will receive it to
│ │ │ │ -be able to handle it. This is not called for web seeds.
│ │ │ │ -thus function may be called more than once per incoming message, but
│ │ │ │ -only the last of the calls will the body size equal the length.
│ │ │ │ -i.e. Every time another fragment of the message is received, this
│ │ │ │ -function will be called, until finally the whole message has been
│ │ │ │ -received. The purpose of this is to allow early disconnects for invalid
│ │ │ │ -messages and for reporting progress of receiving large messages.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_unknown_message()
│ │ │ │ -
│ │ │ │ -virtual bool on_unknown_message (int /*length*/, int /*msg*/,
│ │ │ │ - span<char const> /*body*/);
│ │ │ │ -
│ │ │ │ -
this is not called for web seeds
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
on_piece_pass() on_piece_failed()
│ │ │ │ -
│ │ │ │ -virtual void on_piece_pass (piece_index_t);
│ │ │ │ -virtual void on_piece_failed (piece_index_t);
│ │ │ │ -
│ │ │ │ -
called when a piece that this peer participated in either
│ │ │ │ -fails or passes the hash_check
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
tick()
│ │ │ │ -
│ │ │ │ -virtual void tick ();
│ │ │ │ -
│ │ │ │ -
called approximately once every second
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
write_request()
│ │ │ │ -
│ │ │ │ -virtual bool write_request (peer_request const&);
│ │ │ │ -
│ │ │ │ -
called each time a request message is to be sent. If true
│ │ │ │ -is returned, the original request message won't be sent and
│ │ │ │ -no other plugin will have this function called.
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
crypto_plugin
│ │ │ │ -
Declared in "libtorrent/extensions.hpp"
│ │ │ │ -
│ │ │ │ -struct crypto_plugin
│ │ │ │ -{
│ │ │ │ - virtual void set_incoming_key (span<char const> key) = 0;
│ │ │ │ - virtual void set_outgoing_key (span<char const> key) = 0;
│ │ │ │ - encrypt (span<span<char>> /*send_vec*/) = 0;
│ │ │ │ - virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;
│ │ │ │ -};
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
decrypt()
│ │ │ │ -
│ │ │ │ -virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;
│ │ │ │ -
│ │ │ │ -
decrypt the provided buffers.
│ │ │ │ -returns is a tuple representing the values
│ │ │ │ -(consume, produce, packet_size)
│ │ │ │ -
consume is set to the number of bytes which should be trimmed from the
│ │ │ │ -head of the buffers, default is 0
│ │ │ │ -
produce is set to the number of bytes of payload which are now ready to
│ │ │ │ -be sent to the upper layer. default is the number of bytes passed in receive_vec
│ │ │ │ -
packet_size is set to the minimum number of bytes which must be read to
│ │ │ │ -advance the next step of decryption. default is 0
│ │ │ │ -
[report issue]
│ │ │ │ +
[report issue]
│ │ │ │
│ │ │ │ -
│ │ │ │ -
peer_connection_handle
│ │ │ │ -
Declared in "libtorrent/peer_connection_handle.hpp"
│ │ │ │ -
the peer_connection_handle class provides a handle to the internal peer
│ │ │ │ -connection object, to be used by plugins. This is a low level interface that
│ │ │ │ -may not be stable across libtorrent versions
│ │ │ │ -
│ │ │ │ -struct peer_connection_handle
│ │ │ │ -{
│ │ │ │ - explicit peer_connection_handle (std::weak_ptr<peer_connection> impl);
│ │ │ │ - connection_type type () const;
│ │ │ │ - void add_extension (std::shared_ptr<peer_plugin>);
│ │ │ │ - peer_plugin const* find_plugin (string_view type) const;
│ │ │ │ - bool is_seed () const;
│ │ │ │ - bool upload_only () const;
│ │ │ │ - bool has_piece (piece_index_t i) const;
│ │ │ │ - peer_id const& pid () const;
│ │ │ │ - bool is_choked () const;
│ │ │ │ - bool is_interesting () const;
│ │ │ │ - bool has_peer_choked () const;
│ │ │ │ - bool is_peer_interested () const;
│ │ │ │ - void maybe_unchoke_this_peer ();
│ │ │ │ - void choke_this_peer ();
│ │ │ │ - void get_peer_info (peer_info& p) const;
│ │ │ │ - torrent_handle associated_torrent () const;
│ │ │ │ - tcp::endpoint local_endpoint () const;
│ │ │ │ - tcp::endpoint const& remote () const;
│ │ │ │ - bool is_outgoing () const;
│ │ │ │ - bool is_disconnecting () const;
│ │ │ │ - bool is_connecting () const;
│ │ │ │ - void disconnect (error_code const& ec, operation_t op
│ │ │ │ - , disconnect_severity_t = peer_connection_interface::normal);
│ │ │ │ - bool ignore_unchoke_slots () const;
│ │ │ │ - bool on_local_network () const;
│ │ │ │ - bool failed () const;
│ │ │ │ - bool should_log (peer_log_alert::direction_t direction) const;
│ │ │ │ - void peer_log (peer_log_alert::direction_t direction
│ │ │ │ - , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);
│ │ │ │ - bool can_disconnect (error_code const& ec) const;
│ │ │ │ - bool has_metadata () const;
│ │ │ │ - bool in_handshake () const;
│ │ │ │ - void send_buffer (char const* begin, int size);
│ │ │ │ - time_point time_of_last_unchoke () const;
│ │ │ │ - std::time_t last_seen_complete () const;
│ │ │ │ - bool operator== (peer_connection_handle const& o) const;
│ │ │ │ - bool operator< (peer_connection_handle const& o) const;
│ │ │ │ - bool operator!= (peer_connection_handle const& o) const;
│ │ │ │ - std::shared_ptr<peer_connection> native_handle () const;
│ │ │ │ -};
│ │ │ │ -
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
bt_peer_connection_handle
│ │ │ │ -
Declared in "libtorrent/peer_connection_handle.hpp"
│ │ │ │ -
The bt_peer_connection_handle provides a handle to the internal bittorrent
│ │ │ │ -peer connection object to plugins. It's low level and may not be a stable API
│ │ │ │ -across libtorrent versions.
│ │ │ │ +
│ │ │ │ +
generate_fingerprint()
│ │ │ │ +
Declared in "libtorrent/fingerprint.hpp"
│ │ │ │
│ │ │ │ -struct bt_peer_connection_handle : peer_connection_handle
│ │ │ │ -{
│ │ │ │ - explicit bt_peer_connection_handle (peer_connection_handle pc);
│ │ │ │ - bool packet_finished () const;
│ │ │ │ - bool support_extensions () const;
│ │ │ │ - bool supports_encryption () const;
│ │ │ │ - void switch_recv_crypto (std::shared_ptr<crypto_plugin> crypto);
│ │ │ │ - void switch_send_crypto (std::shared_ptr<crypto_plugin> crypto);
│ │ │ │ - std::shared_ptr<bt_peer_connection> native_handle () const;
│ │ │ │ -};
│ │ │ │ +std::string generate_fingerprint (std::string name
│ │ │ │ + , int major, int minor = 0, int revision = 0, int tag = 0);
│ │ │ │
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ +
│ │ │ │ -
│ │ │ │ -
create_smart_ban_plugin()
│ │ │ │ -
Declared in "libtorrent/extensions/smart_ban.hpp"
│ │ │ │ +
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 intended 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.
│ │ │ │ +
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
setting_by_name() name_for_setting()
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │
│ │ │ │ -std::shared_ptr<torrent_plugin> create_smart_ban_plugin (torrent_handle const&, client_data_t);
│ │ │ │ +int setting_by_name (string_view name);
│ │ │ │ +char const* name_for_setting (int s);
│ │ │ │
│ │ │ │ -
constructor function for the smart ban extension. The extension keeps
│ │ │ │ -track of the data peers have sent us for failing pieces and once the
│ │ │ │ -piece completes and passes the hash check bans the peers that turned
│ │ │ │ -out to have sent corrupt data.
│ │ │ │ -This function can either be passed in the add_torrent_params::extensions
│ │ │ │ -field, or via torrent_handle::add_extension().
│ │ │ │ -
[report issue]
│ │ │ │ -
│ │ │ │ -
create_ut_pex_plugin()
│ │ │ │ -
Declared in "libtorrent/extensions/ut_pex.hpp"
│ │ │ │ +
converts a setting integer (from the enums string_types, int_types or
│ │ │ │ +bool_types) to a string, and vice versa.
│ │ │ │ +
[report issue]
│ │ │ │ +
│ │ │ │ +
default_settings()
│ │ │ │ +
Declared in "libtorrent/settings_pack.hpp"
│ │ │ │
│ │ │ │ -std::shared_ptr<torrent_plugin> create_ut_pex_plugin (torrent_handle const&, client_data_t);
│ │ │ │ +settings_pack default_settings ();
│ │ │ │
│ │ │ │ -
constructor function for the ut_pex extension. The ut_pex
│ │ │ │ -extension allows peers to gossip about their connections, allowing
│ │ │ │ -the swarm stay well connected and peers aware of more peers in the
│ │ │ │ -swarm. This extension is enabled by default unless explicitly disabled in
│ │ │ │ -the session constructor.
│ │ │ │ -
This can either be passed in the add_torrent_params::extensions field, or
│ │ │ │ -via torrent_handle::add_extension().
│ │ │ │ +
returns a settings_pack with every setting set to its default value
│ │ │ │
[report issue]
│ │ │ │
│ │ │ │
ip_filter
│ │ │ │
Declared in "libtorrent/ip_filter.hpp"
│ │ │ │
The ip_filter class is a set of rules that uniquely categorizes all
│ │ │ │ ip addresses as allowed or disallowed. The default constructor creates
│ │ │ │ a single rule that allows all addresses (0.0.0.0 - 255.255.255.255 for
│ │ │ │ @@ -16819,18 +19925,18 @@
│ │ │ │ IPv6 range).
│ │ │ │
A default constructed ip_filter does not filter any address.
│ │ │ │
│ │ │ │ struct ip_filter
│ │ │ │ {
│ │ │ │ ip_filter (ip_filter&&);
│ │ │ │ ip_filter ();
│ │ │ │ - ip_filter (ip_filter const&);
│ │ │ │ ip_filter& operator= (ip_filter const&);
│ │ │ │ - ip_filter& operator= (ip_filter&&);
│ │ │ │ ~ip_filter ();
│ │ │ │ + ip_filter (ip_filter const&);
│ │ │ │ + ip_filter& operator= (ip_filter&&);
│ │ │ │ bool empty () const;
│ │ │ │ void add_rule (address const& first, address const& last, std::uint32_t flags);
│ │ │ │ std::uint32_t access (address const& addr) const;
│ │ │ │ filter_tuple_t export_filter () const;
│ │ │ │
│ │ │ │ enum access_flags
│ │ │ │ {
│ │ │ │ @@ -16914,20 +20020,20 @@
│ │ │ │ the port filter maps non-overlapping port ranges to flags. This
│ │ │ │ is primarily used to indicate whether a range of ports should
│ │ │ │ be connected to or not. The default is to have the full port
│ │ │ │ range (0-65535) set to flag 0.
│ │ │ │
│ │ │ │ class port_filter
│ │ │ │ {
│ │ │ │ - port_filter& operator= (port_filter const&);
│ │ │ │ - port_filter ();
│ │ │ │ port_filter (port_filter const&);
│ │ │ │ + port_filter (port_filter&&);
│ │ │ │ + port_filter ();
│ │ │ │ ~port_filter ();
│ │ │ │ port_filter& operator= (port_filter&&);
│ │ │ │ - port_filter (port_filter&&);
│ │ │ │ + port_filter& operator= (port_filter const&);
│ │ │ │ void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);
│ │ │ │ std::uint32_t access (std::uint16_t port) const;
│ │ │ │
│ │ │ │ enum access_flags
│ │ │ │ {
│ │ │ │ blocked,
│ │ │ │ };
│ │ │ │ @@ -16970,3122 +20076,16 @@
│ │ │ │ blocked |
│ │ │ │ 1 |
│ │ │ │ this flag indicates that destination ports in the
│ │ │ │ range should not be connected to |
│ │ │ │
│ │ │ │
│ │ │ │