merged RC_1_1 into master
This commit is contained in:
commit
5ce798197c
|
@ -81,6 +81,7 @@
|
|||
* resume data no longer has timestamps of files
|
||||
* require C++11 to build libtorrent
|
||||
|
||||
* fix issue with receiving interested before metadata
|
||||
* fix IPv6 tracker announce issue
|
||||
* restore path sanitization behavior of ":"
|
||||
* fix listen socket issue when disabling "force_proxy" mode
|
||||
|
|
|
@ -18,13 +18,9 @@ print('starting', s.name)
|
|||
while (not s.is_seeding):
|
||||
s = h.status()
|
||||
|
||||
state_str = [
|
||||
'queued', 'checking', 'downloading metadata',
|
||||
'downloading', 'finished', 'seeding', 'allocating',
|
||||
'checking fastresume']
|
||||
print('\r%.2f%% complete (down: %.1f kB/s up: %.1f kB/s peers: %d) %s' % (
|
||||
s.progress * 100, s.download_rate / 1000, s.upload_rate / 1000,
|
||||
s.num_peers, state_str[s.state]), end=' ')
|
||||
s.num_peers, s.state), end=' ')
|
||||
|
||||
alerts = ses.pop_alerts()
|
||||
for a in alerts:
|
||||
|
|
|
@ -775,6 +775,12 @@ The default peer class IDs are defined as enums in the ``session`` class:
|
|||
local_peer_class_id
|
||||
};
|
||||
|
||||
The default peer classes are automatically created on session startup, and
|
||||
configured to apply to each respective type of connection. There's nothing
|
||||
preventing a client from reconfiguring the peer class ip- and type filters
|
||||
to disable or customize which peers they apply to. See set_peer_class_filter()
|
||||
and set_peer_class_type_filter().
|
||||
|
||||
A peer class can be considered a more general form of *lables* that some
|
||||
clients have. Peer classes however are not just applied to torrents, but
|
||||
ultimately the peers.
|
||||
|
@ -784,9 +790,9 @@ object), and deleted with the delete_peer_class() call.
|
|||
|
||||
Peer classes are configured with the set_peer_class() get_peer_class() calls.
|
||||
|
||||
Custom peer classes can be assigned to torrents, with the ??? call, in which
|
||||
case all its peers will belong to the class. They can also be assigned based on
|
||||
the peer's IP address. See set_peer_class_filter() for more information.
|
||||
Custom peer classes can be assigned based on the peer's IP address or the type
|
||||
of transport protocol used. See set_peer_class_filter() and
|
||||
set_peer_class_type_filter() for more information.
|
||||
|
||||
peer class examples
|
||||
-------------------
|
||||
|
|
|
@ -114,31 +114,10 @@ In order to interpret the statistics array, in C++ it is required to call ``sess
|
|||
For an example python program, see ``client.py`` in the ``bindings/python``
|
||||
directory.
|
||||
|
||||
A very simple example usage of the module would be something like this::
|
||||
A very simple example usage of the module would be something like this:
|
||||
|
||||
import libtorrent as lt
|
||||
import time
|
||||
|
||||
ses = lt.session()
|
||||
ses.listen_on(6881, 6891)
|
||||
|
||||
e = lt.bdecode(open("test.torrent", 'rb').read())
|
||||
info = lt.torrent_info(e)
|
||||
|
||||
params = { 'save_path': '.', \
|
||||
'storage_mode': lt.storage_mode_t.storage_mode_sparse, \
|
||||
'ti': info }
|
||||
h = ses.add_torrent(params)
|
||||
|
||||
s = h.status()
|
||||
while (not s.is_seeding):
|
||||
s = h.status()
|
||||
|
||||
state_str = ['queued', 'checking', 'downloading metadata', \
|
||||
'downloading', 'finished', 'seeding', 'allocating']
|
||||
print '%.2f%% complete (down: %.1f kb/s up: %.1f kB/s peers: %d) %s' % \
|
||||
(s.progress * 100, s.download_rate / 1000, s.upload_rate / 1000, \
|
||||
s.num_peers, state_str[s.state])
|
||||
|
||||
time.sleep(1)
|
||||
.. include:: ../bindings/python/simple_client.py
|
||||
:code: python
|
||||
:tab-width: 2
|
||||
:start-after: from __future__ import print_function
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ TORRENT_EXPORT void assert_fail(const char* expr, int line
|
|||
#if TORRENT_USE_ASSERTS
|
||||
|
||||
#ifdef TORRENT_PRODUCTION_ASSERTS
|
||||
extern char const* libtorrent_assert_log;
|
||||
extern TORRENT_EXPORT char const* libtorrent_assert_log;
|
||||
#endif
|
||||
|
||||
#if TORRENT_USE_IOSTREAM
|
||||
|
|
|
@ -42,8 +42,12 @@ namespace sim { namespace asio {
|
|||
}}
|
||||
#else
|
||||
namespace boost { namespace asio {
|
||||
|
||||
#if BOOST_VERSION < 106600
|
||||
class io_service;
|
||||
#else
|
||||
class io_context;
|
||||
typedef io_context io_service;
|
||||
#endif
|
||||
}}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -53,7 +53,9 @@ namespace libtorrent {
|
|||
|
||||
using peer_class_t = aux::strong_typedef<std::uint32_t, aux::peer_class_tag>;
|
||||
|
||||
struct peer_class_info
|
||||
// holds settings for a peer class. Used in set_peer_class() and
|
||||
// get_peer_class() calls.
|
||||
struct TORRENT_EXPORT peer_class_info
|
||||
{
|
||||
// ``ignore_unchoke_slots`` determines whether peers should always
|
||||
// unchoke a peer, regardless of the choking algorithm, or if it should
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace libtorrent {
|
|||
// ``peer_class_type_filter`` is a simple container for rules for adding and subtracting
|
||||
// peer-classes from peers. It is applied *after* the peer class filter is applied (which
|
||||
// is based on the peer's IP address).
|
||||
struct peer_class_type_filter
|
||||
struct TORRENT_EXPORT peer_class_type_filter
|
||||
{
|
||||
peer_class_type_filter()
|
||||
{
|
||||
|
|
|
@ -700,7 +700,7 @@ namespace libtorrent {
|
|||
// return value of ``get_peer_class()`` is undefined.
|
||||
//
|
||||
// ``set_peer_class()`` sets all the information in the
|
||||
// ``peer_class_info`` object in the specified peer class. There is no
|
||||
// peer_class_info object in the specified peer class. There is no
|
||||
// option to only update a single property.
|
||||
//
|
||||
// A peer or torrent belonging to more than one class, the highest
|
||||
|
|
|
@ -542,6 +542,14 @@ namespace libtorrent {
|
|||
std::shared_ptr<torrent> t = m_torrent.lock();
|
||||
TORRENT_ASSERT(t);
|
||||
|
||||
if (!t->valid_metadata())
|
||||
{
|
||||
#ifndef TORRENT_DISABLE_LOGGING
|
||||
peer_log(peer_log_alert::info, "ALLOWED", "skipping allowed set because we don't have metadata");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
if (t->super_seeding())
|
||||
{
|
||||
#ifndef TORRENT_DISABLE_LOGGING
|
||||
|
|
Loading…
Reference in New Issue