Giter VIP home page Giter VIP logo

libtorrent's People

Contributors

0xd34df00d avatar ajax16384 avatar aldenml avatar allseeingeyetolledewesew avatar amirabrams avatar aresch avatar arvidn avatar cas-- avatar chocobo1 avatar d-komarov avatar daniel-w avatar falcosc avatar franciscopombal avatar glassez avatar gubatron avatar john-peterson avatar jpetso avatar kolcha avatar magnusjonsson avatar mlt avatar moodyjon avatar paullouisageneau avatar pavel-pimenov avatar silverqx avatar sledgehammer999 avatar ssiloti avatar thomasyuan avatar thrnz avatar wojci avatar zeule avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libtorrent's Issues

TORRENT_EXCEPTION_THROW_SPECIFIER might be a misnomer

I'm not entirely sure how to read this macro. Since you define it to throw() or noexcept, shouldn't it be more like TORRENT_EXCEPTION_NOTHROW_SPECIFIER? and also you apply it to a function that instantiates an std::string (here), which can throw.

Possible problem with connect_to_url_seed

We are getting errors like these:

ABI: 'arm'
pid: 24329, tid: 24356, name: ostwire.android >>> com.frostwire.android <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
r0 00000000 r1 00005f24 r2 00000006 r3 00000000
r4 b3c78db8 r5 00000006 r6 0000000c r7 0000010c
r8 a1a594c0 r9 b3c78ae8 sl 00000000 fp 00000001
ip 00005f24 sp b3c78948 lr b6ee7ff5 pc b6f0b264 cpsr 600f0010

backtrace:
#00 pc 00037264 /system/lib/libc.so (tgkill+12)
#01 pc 00013ff1 /system/lib/libc.so (pthread_kill+52)
#02 pc 00014c0f /system/lib/libc.so (raise+10)
#03 pc 00011531 /system/lib/libc.so (__libc_android_abort+36)
#04 pc 0000fcbc /system/lib/libc.so (abort+4)
#05 pc 005588ef /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (__gnu_cxx::__verbose_terminate_handler()+226)
#06 pc 0052dde1 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (__cxxabiv1::__terminate(void (*)())+4)
#07 pc 0052de55 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (std::terminate()+8)
#08 pc 0052dfaf /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (__cxa_rethrow+46)
#09 pc 002bedc7 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::web_peer_connection::web_peer_connection(libtorrent::peer_connection_args const&, libtorrent::web_seed_t&)+682)
#10 pc 0035e127 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost::detail::sp_if_not_array<libtorrent::web_peer_connection>::type boost::make_shared<libtorrent::web_peer_connection, boost::reference_wrapper<libtorrent::peer_connection_args const>, boost::reference_wrapper<libtorrent::web_seed_t> >(boost::reference_wrapper<libtorrent::peer_connection_args const> const&, boost::reference_wrapper<libtorrent::web_seed_t> const&)+66)
#11 pc 0033e571 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::torrent::connect_web_seed(std::_List_iterator<libtorrent::web_seed_t>, boost::asio::ip::basic_endpoint<boost::asio::ip::tcp>)+2168)
#12 pc 0033f083 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::torrent::connect_to_url_seed(std::_List_iterator<libtorrent::web_seed_t>)+1482)
#13 pc 0033f5e3 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::torrent::maybe_connect_web_seeds()+206)
#14 pc 002c2e43 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost::asio::detail::completion_handler<boost::_bi::bind_t<void, boost::_mfi::mf0<void, libtorrent::torrent>, boost::_bi::list1<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> > > > >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned int)+206)
#15 pc 002db3c1 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost::asio::io_service::run()+648)
#16 pc 002884f9 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost_asio_detail_posix_thread_function+80)
#17 pc 000137bb /system/lib/libc.so (__pthread_start(void*)+30)
#18 pc 0001189b /system/lib/libc.so (__start_thread+6)

and

ABI: 'arm'
pid: 26323, tid: 26341, name: ostwire.android >>> com.frostwire.android <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
r0 00000000 r1 000066e5 r2 00000006 r3 00000000
r4 b3dbadb8 r5 00000006 r6 0000000c r7 0000010c
r8 a1ba13f0 r9 a1b73518 sl befd182c fp 00000001
ip 000066e5 sp b3dba8f0 lr b6f77ff5 pc b6f9b264 cpsr 600f0010

backtrace:
#00 pc 00037264 /system/lib/libc.so (tgkill+12)
#01 pc 00013ff1 /system/lib/libc.so (pthread_kill+52)
#02 pc 00014c0f /system/lib/libc.so (raise+10)
#03 pc 00011531 /system/lib/libc.so (__libc_android_abort+36)
#04 pc 0000fcbc /system/lib/libc.so (abort+4)
#05 pc 005588ef /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (__gnu_cxx::__verbose_terminate_handler()+226)
#06 pc 0052dde1 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (__cxxabiv1::__terminate(void (*)())+4)
#07 pc 0052de55 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (std::terminate()+8)
#08 pc 0052dfaf /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (__cxa_rethrow+46)
#09 pc 00428ca7 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::web_connection_base::web_connection_base(libtorrent::peer_connection_args const&, libtorrent::web_seed_t&)+1378)
#10 pc 002beb29 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::web_peer_connection::web_peer_connection(libtorrent::peer_connection_args const&, libtorrent::web_seed_t&)+12)
#11 pc 0035e127 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost::detail::sp_if_not_array<libtorrent::web_peer_connection>::type boost::make_shared<libtorrent::web_peer_connection, boost::reference_wrapper<libtorrent::peer_connection_args const>, boost::reference_wrapper<libtorrent::web_seed_t> >(boost::reference_wrapper<libtorrent::peer_connection_args const> const&, boost::reference_wrapper<libtorrent::web_seed_t> const&)+66)
#12 pc 0033e571 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::torrent::connect_web_seed(std::_List_iterator<libtorrent::web_seed_t>, boost::asio::ip::basic_endpoint<boost::asio::ip::tcp>)+2168)
#13 pc 0033f083 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::torrent::connect_to_url_seed(std::_List_iterator<libtorrent::web_seed_t>)+1482)
#14 pc 0033f5e3 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (libtorrent::torrent::maybe_connect_web_seeds()+206)
#15 pc 002c2e43 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost::asio::detail::completion_handler<boost::_bi::bind_t<void, boost::_mfi::mf0<void, libtorrent::torrent>, boost::_bi::list1<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> > > > >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned int)+206)
#16 pc 002db3c1 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost::asio::io_service::run()+648)
#17 pc 002884f9 /data/app/com.frostwire.android-2/lib/arm/libjlibtorrent.so (boost_asio_detail_posix_thread_function+80)
#18 pc 000137bb /system/lib/libc.so (__pthread_start(void*)+30)
#19 pc 0001189b /system/lib/libc.so (__start_thread+6)

Do you think there could be some problem at https://github.com/arvidn/libtorrent/blob/master/src/torrent.cpp#L10093 due to synchronization problems? My idea is that under edge conditions, m_web_seeds could be destroyed and the tasks using the passed iterator fail. Does it make sense?

CC: @gubatron

Incorrect parsing of I2P compact response, need for destination lookup

Compact reply implies that all peers are in a single string. Whereas current code attempts to fetch IPv4 addresses out of it. One has to

  1. pass a flag if I2P response parse function parse_tracker_response
  2. assert that len divides by 32 without remainder?
  3. encode each 32 fragment with Base 32
  4. chop off padding (=)
  5. lower case (base32encode uses capitalized alphabet)
  6. append .b32.i2p
  7. push peer_entry back into resp.peers

For compact responses, a name look up is necessary. See for example this comment. Perhaps once new peer is discovered, its destination shall be looked up and added upon success. Right now, it literally sends ".i2p".

DHT bootstrap attempted before routers resolve

When one adds a DHT router and then starts the DHT, the bootstrap might not occur until after a timeout because asio IP resolution is asynchronous and the dht_tracker class only receives the resolved IP after the bootstrap call has been placed. Quoting @arvidn from PR #46:

I think it should probably be solved properly by postponing the bootstrap if there are outstanding hostname lookups for dht routers. Or perhaps by re-starting the bootstrap when the first router is added if the routing table is empty. (the latter is probably quite simple)

As of right now, there is neither an alert for IP resolution that an application could wait for, nor logic within libtorrent that would fix this issue transparently.

msvc 14 ambiguous call to snprintf (64bit)

This happens because stdio.h that ships with it defines snprintf and you have an inline function for it in config.hpp

Interestingly enough, the else branch of that preprocessor block seems to be obsolete as well, because you include limits.h at the top of config.hpp anyways. Of course previous versions of msvc still need that inline declaration though.

"file too short" error

Hello,

I use Deluge 1.3.11 and libtorrent 1.0.5.0 and I'm getting the following error while seeding some torrents.

[DEBUG   ] 06:47:45 alertmanager:123 save_resume_data_alert: WWE RAW 2015 08 03 HDTV x264-Ebi -={SPARROW}=- resume data generated
[DEBUG   ] 06:47:45 torrentmanager:1080 on_alert_save_resume_data
[DEBUG   ] 06:47:45 torrentmanager:747 Opening torrents fastresume file for load.
[DEBUG   ] 06:47:45 torrentmanager:788 Saving fastresume file: /putio/deluge_cfg/8081/state/torrents.fastresume
.....
[DEBUG   ] 06:48:13 alertmanager:123 file_error_alert: WWE RAW 2015 08 03 HDTV x264-Ebi -={SPARROW}=- file (reading p: 5595 b: 0 s: 12000 (read: 11623)) error: file too short
[DEBUG   ] 06:48:13 alertmanager:123 torrent_error_alert: WWE RAW 2015 08 03 HDTV x264-Ebi -={SPARROW}=- ERROR: file too short
[DEBUG   ] 06:48:13 alertmanager:123 tracker_announce_alert: WWE RAW 2015 08 03 HDTV x264-Ebi -={SPARROW}=- (udp://open.demonii.com:1337) sending announce (stopped)
[DEBUG   ] 06:48:13 alertmanager:123 torrent_paused_alert: WWE RAW 2015 08 03 HDTV x264-Ebi -={SPARROW}=- paused
[DEBUG   ] 06:48:13 alertmanager:123 torrent_paused_alert: WWE RAW 2015 08 03 HDTV x264-Ebi -={SPARROW}=- paused
[DEBUG   ] 06:48:13 alertmanager:123 tracker_reply_alert: WWE RAW 2015 08 03 HDTV x264-Ebi -={SPARROW}=- (udp://open.demonii.com:1337) received peers: 0
[DEBUG   ] 06:48:13 torrentmanager:1148 on_alert_file_error: WWE RAW 2015 08 03 HDTV x264-Ebi -={SPARROW}=- file (reading p: 5595 b: 0 s: 12000 (read: 11623)) error: file too short

After getting this error message, the torrent is marked "paused" by deluged. The Deluge developers said that the underlying issue is related with libtorrent. Also I can provide a magnet link to try to reproduce the issue.

Question about how to persist DHT's stored items

Hi @arvidn, I want to ask first if this is something that you are open to incorporate in the library.

My motivations is that in mobile devices, the process can be destroyed aggressively, and losing all the stored items (mutable and inmutable) does not help to the network. Also, this could open the door to very big tables without RAM penalty.

My idea is: some how provide a "dht_item_table_storage" whose default (and only) implementation is a RAM std::map as it is now. If you think this is a good idea, a will appreciate your tips about I should start passing this parameter.

Change your git name/email to match those from svn

This is really minor and you can insta-close it.
You may have not noticed but the commits coming from the svn import have as Author Arvid Norberg <[email protected]> while the commit from git have as Author either arvidn <[email protected]> or arvidn <[email protected]>

You can fix it for the next commits by doing:

git config user.name "Arvid Norberg"
git config user.email [email protected]

Add the switch --global after config to change it globally.
IIRC you have to do it for every local copy of the repo you have lying around on different machines.

assert failures on debug build

When testing a libtorrent debug build there are some assert failures due to invalid input.

These are from libtorrent 1.0.3:

  • Assertion failed: (max_connections >= 2 || max_connections == -1), function set_max_connections, file torrent_handle.cpp, line 296.
  • Assertion failed: (ec != error::invalid_argument || !m_outgoing), function disconnect, file peer_connection.cpp, line 3553.
  • Assertion failed: ((p == -1) == is_finished() || (!m_auto_managed && p == -1) || (m_abort && p == -1)), function set_queue_position, file torrent.cpp, line 6973.

Would it be possible to not have these as asserts? Asserts shouldn't really be failing on invalid input from external callers, but for incorrect logic in the internal code?

Also, torrent_handle::set_max_connections fails when max_connections is 0 or 1, however, torrent::set_max_connections uses

TORRENT_ASSERT(limit >= -1);
if (limit <= 0) limit = (1<<24)-1;

which implies that 0 is valid input and is treated as unlimited together with -1.

What happens when running a release build and torrent_handle::set_max_connections is called with max_connections=1? Will it accept 1 even though the docs says it must be either -1 or >= 2 ?

Cannot add very large torrent

There was an error adding a large torrent (23 MB of metadata) into qBittorrent.
The developers claim, this is an issue of libTorrent and not qBittorrent, so I reference this here.

Issue with the torrent file and magnet link in question: qbittorrent/qBittorrent#3360

Removing session::set_alert_notify callback

Using the master branch

How can I remove the callback I set in session::set_alert_notify? The example below worked with the old set_alert_dispatch.

typedef boost::function<void()> notify_func_t;
sess_->set_alert_notify(notify_func_t());

This throws an exception saying "call to empty boost::function".

Ideas?

Set piece deadline not honored

I'm using the Python bindings for libtorrent in an application for streaming. In every possible combination of setting piece deadlines, along with piece priorities, the piece deadlines seem to be ignored. This happens with both sequential downloading and non-sequential downloading. As soon as I need a piece I set a piece deadline to a small amount (several hundred milliseconds) and only do it once. Is there something I'm missing about piece deadlines? Do I need to keep setting piece deadlines? Or is this a bug with the Python bindings?

info_hash is missing in i2p scrape requests

Here is an excerpt from dissected SAM TCP stream

HELLO VERSION MIN=3.0 MAX=3.0
HELLO REPLY RESULT=OK VERSION=3.0
STREAM CONNECT ID=ee48066d53a7c7149a6f57ed09bda547b9fa0315 DESTINATION=lnQ6yoBTxQuQU8EQ1FlF395ITIQF-HGJxUeFvzETLFnoczNjQvKDbtSB7aHhn853zjVXrJBgwlB9sO57KakBDaJ50lUZgVPhjlI19TgJ-CxyHhHSCeKx5JzURdEW-ucdONMynr-b2zwhsx8VQCJwCEkARvt21YkOyQDaB9IdV8aTAmP~PUJQxRwceaTMn96FcVenwdXqleE16fI8CVFOV18jbJKrhTOYpTtcZKV4l1wNYBDwKgwPx5c0kcrRzFyw5~bjuAKO~GJ5dR7BQsL7AwBoQUS4k1lwoYrG1kOIBeDD3XF8BWb6K3GOOoyjc1umYKpur3G~FxBuqtHAsDRICkEbKUqJ9mPYQlTSujhNxiRIW-oLwMtvayCFci99oX8MvazPS7~97x0Gsm-onEK1Td9nBdmq30OqDxpRtXBimbzkLbR1IKObbg9HvrKs3L-kSyGwTUmHG9rSQSoZEvFMA-S0EXO~o4g21q1oikmxPMhkeVwQ22VHB0-LZJfmLr4SAAAA
STREAM STATUS RESULT=OK
GET /scrape.php? HTTP/1.1
Host: ahsplxkbhemefwvvml7qovzl5a2b5xo5i7lyai7ntdunvcyfdtna.b32.i2p
User-Agent: client_test/1.1.0.0
Accept-Encoding: gzip
Connection: close

HTTP/1.1 200 OK
Date: Tue, 16 Jun 2015 19:31:33 GMT
Server: Apache
Pragma: no-cache
Cache-Control: max-age=3600
Content-Length: 96
Connection: close
Content-Type: text/plain

d14:failure reason74:Full scrapes are not supported. Add info_hash for a single torrent scrape!e

dh_auto_clean attempts to run b2 in python setup.py

When packaging 1.0.6 libtorrent for ubuntu PPA, dh_auto_clean is attempting to run the b2 command in setup.py. There was no issue with this in 1.0.1.

dh clean  --parallel --with python2,python3,autoreconf
   dh_testdir -O--parallel
   debian/rules override_dh_auto_clean
make[1]: Entering directory `/home/ubuntu/Documents/libtorrent/PPA Packaging/lt_1.0.6_rel/libtorrent-rasterbar-1.0.6'
rm -rf build build-py*
dh_auto_clean
BOOST_ROOT =
CXXFLAGS = -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security
LDFLAGS = -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed
OS = LINUX
warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
error: Unable to find file or target named
error:     '/boost/python//boost_python'
error: referred from project at
error:     '.'


bjam boost=source link=static geoip=static boost-link=static release optimization=space stage_module --abbreviate-paths -j6
build failed
[30894 refs]
dh_auto_clean: python-dbg setup.py clean -a returned exit code 1

I found someone else ran into the same packaging issue and simply created the following packaging patch, it works but seems a bit crude.

--- a/bindings/python/setup.py  2015-07-15 00:45:38.780329367 +0200
+++ b/bindings/python/setup.py  2015-07-15 00:45:50.004570474 +0200
@@ -51,7 +51,11 @@
 ext = None
 packages = None

-if '--bjam' in sys.argv or ldflags == None or extra_cmd == None:
+if 'clean' in sys.argv:
+   #disable clean mode
+   print ('clean mode')
+
+elif '--bjam' in sys.argv or ldflags == None or extra_cmd == None:

    if '--bjam' in sys.argv:
        del sys.argv[sys.argv.index('--bjam')]

Compiling issues

Win 8.1 x64, VS2013 Update 5, CMake 2.8 (configuration: all default, except "encryption" is unchecked, because I got a lot OpenSSL / boost asio compile errors; plus "logging" and "deprecated-functions" are unchecked)
Generated vcxproj for torrent-rasterbar doesn't have Iphlpapi.lib in Libraries->Input->Additional Dependencies, which lead to this error when trying to compile:

2>broadcast_socket.obj : error LNK2019: unresolved external symbol _if_nametoindex@4 referenced in function __catch$?supports_ipv6@libtorrent@@YA_NXZ$0
2>D:\aGIT\Unsorted\libtorrent\master_binary\Debug\torrent-rasterbar.dll : fatal error LNK1120: 1 unresolved externals

Also, when I trying to compile tests I got following issues (for example, test_tracker):

Error   8   error LNK2001: unresolved external symbol "bool libtorrent::aux::mmx_support" (?mmx_support@aux@libtorrent@@3_NA)   d:\aGIT\Unsorted\libtorrent\master_binary\test_tracker.obj  test_tracker
Error   9   error LNK2001: unresolved external symbol "bool libtorrent::aux::mmx_support" (?mmx_support@aux@libtorrent@@3_NA)   d:\aGIT\Unsorted\libtorrent\master_binary\test_common.lib(setup_transfer.obj)   test_tracker
Error   10  error LNK2001: unresolved external symbol "bool libtorrent::aux::mmx_support" (?mmx_support@aux@libtorrent@@3_NA)   d:\aGIT\Unsorted\libtorrent\master_binary\test_common.lib(main.obj) test_tracker
Error   6   error LNK2001: unresolved external symbol "int _g_num_unit_tests" (?_g_num_unit_tests@@3HA) d:\aGIT\Unsorted\libtorrent\master_binary\test_tracker.obj  test_tracker
Error   7   error LNK2001: unresolved external symbol "int _g_num_unit_tests" (?_g_num_unit_tests@@3HA) d:\aGIT\Unsorted\libtorrent\master_binary\test_common.lib(main.obj) test_tracker
Error   12  error LNK2001: unresolved external symbol "int _g_test_failures" (?_g_test_failures@@3HA)   d:\aGIT\Unsorted\libtorrent\master_binary\test_common.lib(main.obj) test_tracker
Error   4   error LNK2001: unresolved external symbol "struct unit_test_t * _g_unit_tests" (?_g_unit_tests@@3PAUunit_test_t@@A) d:\aGIT\Unsorted\libtorrent\master_binary\test_tracker.obj  test_tracker
Error   5   error LNK2001: unresolved external symbol "struct unit_test_t * _g_unit_tests" (?_g_unit_tests@@3PAUunit_test_t@@A) d:\aGIT\Unsorted\libtorrent\master_binary\test_common.lib(main.obj) test_tracker
Error   2   error LNK2001: unresolved external symbol "void __cdecl report_failure(char const *,char const *,int)" (?report_failure@@YAXPBD0H@Z)    d:\aGIT\Unsorted\libtorrent\master_binary\test_common.lib(setup_transfer.obj)   test_tracker
Error   3   error LNK2001: unresolved external symbol "void __cdecl report_failure(char const *,char const *,int)" (?report_failure@@YAXPBD0H@Z)    d:\aGIT\Unsorted\libtorrent\master_binary\test_common.lib(main.obj) test_tracker
Error   11  error LNK2019: unresolved external symbol "int __cdecl print_failures(void)" (?print_failures@@YAHXZ) referenced in function __catch$_main$1    d:\aGIT\Unsorted\libtorrent\master_binary\test_common.lib(main.obj) test_tracker
Error   1   error LNK2019: unresolved external symbol "void __cdecl report_failure(char const *,char const *,int)" (?report_failure@@YAXPBD0H@Z) referenced in function "void __cdecl unit_test_parse_hostname_peers(void)" (?unit_test_parse_hostname_peers@@YAXXZ)    d:\aGIT\Unsorted\libtorrent\master_binary\test_tracker.obj  test_tracker

Can someone help me, what I do wrong and how these issues can be fixed?

Best wishes, Dmitry.

Added duplicate

When I download one torrent from web-page and add it in torrent client (which use libtorrent) and then - after few days (for example) - author of this torrent change it - and I download new torrent-file from this(!) web-page - I can add it in torrent client also.
It lead to conflict between this two torrents - because hashes are not the same - but hyper-links on torrent-pages in tracker are the same...

Can't import hugh torrents

Hello,

libtorrent can't handle hugh torrents like for example 400 GB content and 24 MB torrent file. Please look into the importing process, maybe there's some buffering problem.

Thanks for reading.

MPW

Important issue related to a wrong call of async_release_files

Hi @arvidn, we are getting a lot of errors like this (using master):

backtrace:
#00  (libtorrent::disk_io_thread::async_release_files(libtorrent::piece_manager*, boost::function<void (libtorrent::disk_io_job const*)> const&)+19)
#01  (libtorrent::torrent::finished()+442)
#02  (libtorrent::torrent::prioritize_pieces(std::vector<int, std::allocator<int> > const&)+240)
#03 (libtorrent::torrent::update_piece_priorities()+294)
#04 (libtorrent::torrent::read_resume_data(libtorrent::bdecode_node const&)+3050)
#05  (libtorrent::torrent::init()+3938)
#06 (libtorrent::torrent::start(libtorrent::add_torrent_params const&)+860)
#07 (libtorrent::aux::session_impl::add_torrent_impl(libtorrent::add_torrent_params const&, boost::system::error_code&)+1242)

I think that something happened in this commit: 105c105#diff-19929347e18a6ff1fc37f09ec720306bL6762

that triggers a call to async_release_files with null.

What do you think?

Thanks

CC @gubatron

simple_test compilation issues

Hi,

Building the simple test from mainline using the generated Makefile in the examples folder fails on my side with:

../src/.libs/libtorrent-rasterbar.so: undefined reference to `boost::random::random_device::operator()()'
../src/.libs/libtorrent-rasterbar.so: undefined reference to `boost::random::random_device::~random_device()'
../src/.libs/libtorrent-rasterbar.so: undefined reference to `boost::random::random_device::random_device()'
../src/.libs/libtorrent-rasterbar.so: undefined reference to `boost::chrono::steady_clock::now()'

To build it I had to add these boost libs to the simple_client target in the Makefile so it looks like this:

$(AM_V_CXXLD)$(CXXLINK) $(simple_client_OBJECTS) $(simple_client_LDADD) $(LIBS) $(BOOST_RANDOM_LIB) -lboost_chrono

I've configured it without any extra arguments on a Ubuntu 14.04 machine - ./configure && make && make install

Was I doing something wrong or is it necessary to configure libtorrent with the examples option from the very beginning?

Proxy settings have been merged

Hey there.

Ever since upgrading my Debian box (Deluge-1.3.10 and libtorrent-0.16.18 (the current stable versions in Debian8)), Deluge can't contact trackers anymore. I have a proxy set for peer, webseed, DHT, but not tracker. This used to work well in the past.

http://forum.deluge-torrent.org/viewtopic.php?p=183779#p183779 pointed me in the right direction:
"If you are using libtorrent 0.16 then yes the proxy applies to all now."
and indeed, the libtorrent changelog states:
"* merged all proxy settings into a single one"

What is the reason for this change? My proxy is not set up to handle trackers, which explains why Deluge can't contact trackers anymore.

effectively test DHT on python binding

I have some code:

        is_dht_running='ON' if self.session.is_dht_running() else 'OFF'
        nodes=self.session.dht_state().get('nodes')
        nodes=len(nodes) if nodes else 0
        result='DHT: %s (%d)' % (is_dht_running, nodes)

So both 1.0.5 and 0.16.19 got "DHT: ON (>600)", but when I use private trackers with only 1 tracker in torrent file and it fails to give info (that happens a lot), 1.0.5 can't find seeds for 2-10 mins until tracker become verified and 0.16.19 searching seeds like a beast no matter what.

Both libraries built with the same keys.

The code is the same for both tests, this is how I start dht:

    self.session.start_dht()
    self.session.add_dht_router("router.bittorrent.com", 6881)
    self.session.add_dht_router("router.utorrent.com", 6881)
    self.session.add_dht_router("router.bitcomet.com", 6881)

The question is: how can I deeper debug DHT on python binding?

Block timeouts and peer snubs on libtorrent 1.1.0

Hey @arvidn

For some reason, after I started using a newer version of jlibtorrent based on libtorrent 1.1.0, my torrents stopped downloading correctly. They were downloading correctly on 1.0.5.0 .

Going into the logs on both the seeding and leeching side, it appears the seeder receives a lot of peer_disconnected messages:
PEER_DISCONNECTED - peer_disconnected_alert - my file peer (94.102.63.93:6881, libtorrent 1.1.0) disconnecting (uTP) [sock_read] [system]: Connection timed out (reason: 0)

And the leeching side successfully downloads a few blocks, but then receives block_timeout and peer_snubbed messages:
02:46:05.145 [Session-alertsLoop] DEBUG c.t.client.LibtorrentEngine - PEER_SNUBBED - peer_snubbed_alert - my file peer (74.137.241.6:6881, libtorrent 1.1.0) peer snubbed 02:46:05.145 [Session-alertsLoop] DEBUG c.t.client.LibtorrentEngine - BLOCK_TIMEOUT - block_timeout_alert - my file peer timed out request ( piece: 492 block: 0)

My settings are the exact same as the were before using the new version.

After some looking, it might have something to do with ports? The ports appear to be different and lower than they used to be.

function: bool libtorrent::dht::routing_table::add_node

Hi,
using 1.0.6 from releases, qBittorrent crash.

Clearing torrent properties
clearing peer list
clear called
QSpiAccessible::accessibleEvent not handled:  "8008"  obj:  QObject(0x0)  " invalid interface!" 
QString::arg: Argument missing: "Sans Catégorie" , 0 
Torrent deleted.
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x3800175
Changed tab to search engine, giving focus to search input
Changed tab to search engine, giving focus to search input
Search with category: all
Search with category: all
Search with category: all
Changed tab to transfer list, refreshing the list
assertion failed. Please file a bugreport at https://github.com/arvidn/libtorrent/issues
Please include the following information:

version: 1.0.6.0
$Rev$

file: 'kademlia/routing_table.cpp'
line: 458
function: bool libtorrent::dht::routing_table::add_node(libtorrent::dht::node_entry)
expression: m_buckets.size() <= 50


stack:
1: assert_fail(char const*, int, char const*, char const*, char const*, int)
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&)
16: boost::asio::detail::task_io_service::run(boost::system::error_code&)
17: 
18: boost_asio_detail_posix_thread_function
19: 
20: clone
Catching SIGINT, exiting cleanly

*************************************************************
Catching SIGABRT, please report a bug at http://bug.qbittorrent.org
and provide the following backtrace:
qBittorrent version: v3.3.0beta
stack trace:
  /lib/x86_64-linux-gnu/libc.so.6 : gsignal()+0x37  [0x7fe6c2b7c107]
  /lib/x86_64-linux-gnu/libc.so.6 : abort()+0x148  [0x7fe6c2b7d4e8]
  /usr/local/lib/libtorrent-rasterbar.so.8 : assert_fail(char const*, int, char const*, char const*, char const*, int)+0xaa  [0x7fe6c55a9b3a]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x2df9c0  [0x7fe6c58069c0]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x2dfb3e  [0x7fe6c5806b3e]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x2e8e21  [0x7fe6c580fe21]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x2e8fa0  [0x7fe6c580ffa0]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x2ce999  [0x7fe6c57f5999]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x2ecb71  [0x7fe6c5813b71]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x2e5a36  [0x7fe6c580ca36]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x2d4f5e  [0x7fe6c57fbf5e]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x2c5a45  [0x7fe6c57eca45]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x28e4d2  [0x7fe6c57b54d2]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x28f24f  [0x7fe6c57b624f]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x28f5a2  [0x7fe6c57b65a2]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x293db5  [0x7fe6c57badb5]
  /usr/local/lib/libtorrent-rasterbar.so.8 : boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&)+0x2ac  [0x7fe6c559fafc]
  /usr/local/lib/libtorrent-rasterbar.so.8 : boost::asio::detail::task_io_service::run(boost::system::error_code&)+0xd1  [0x7fe6c55a3841]
  /usr/local/lib/libtorrent-rasterbar.so.8 : ()+0x1ce720  [0x7fe6c56f5720]
  /usr/local/lib/libtorrent-rasterbar.so.8 : boost_asio_detail_posix_thread_function()+0x42  [0x7fe6c55a3a32]
  /lib/x86_64-linux-gnu/libpthread.so.0 : ()+0x80a4  [0x7fe6c510e0a4]
  /lib/x86_64-linux-gnu/libc.so.6 : clone()+0x6d  [0x7fe6c2c2d04d]
Abandon

Debian jessie amd64
boost 1.55.0+dfsg-3
gcc-4.9 (g++-4.9) 4.9.2-10
kernel Linux 4.1.3 amd64

Thanks.

Questions about two possible null pointer errors

First point: https://github.com/arvidn/libtorrent/blob/master/src/peer_connection.cpp#L5092

Do you think that by any chance, the storage can be null? The if surrounding this line is: if (t->seed_mode() && !t->verified_piece(r.piece))

Second point: https://github.com/arvidn/libtorrent/blob/master/src/block_cache.cpp#L856
Since you are calling ok_to_evict(true) it will ignore the hash and my question is. Is it possible that the hash is already NULL?

[wishlist] fine-grained anonymous mode settings

This is related to qbittorrent/qBittorrent#3648.

For now Anonymous Mode settings look like this:

[ ] include peerID in the user-agent string
[x] use trackers only if they are using a proxy server
...

and state of checkboxes can't be toggled.

Please split Anonymous Mode into multiple finer settings, so setups like:

[ ] include peerID in the user-agent string
[ ] use trackers only if they are using a proxy server
...

can happen.

"simple_client.cpp": Assertion failed: m_buckets.size() <= 50

I just compile and run the "examples/simple_client.cpp"(links to libws2_32 and libwsock32), and the console prints:

Assertion failed: m_buckets.size() <= 50, file src\kademlia\routing_table.cpp, line 458

I have tried to use "p.save_path = "E:";" instead of "p.save_path = "./";", but it doesn't work.
Another example "client_test.cpp" also get same assertion failed.
Thanks!

Environment:
os: windows (window 7)
compiler: gcc (tdm-gcc4.5.2)
libtorrent: 1.0.6 (use "b2 --toolset=gcc variant=debug" to compile)
boost: 1.59.0 (use "b2 --toolset=gcc variant=debug stage" to compile)

install issue with spaces in build path

I don't remember seeing any issue last time I packaged libtorrent for the PPA (1.0.1) but it now seems with 1.0.6 spaces in the path generate the following error:

libtool: install: /usr/bin/install -c .libs/libtorrent-rasterbar.so.8.0.0 /home/ubuntu/libtorrent/PPA Packaging/lt_1.0.6_rel/libtorrent-rasterbar-1.0.6/debian/tmp/usr/lib/libtorrent-rasterbar.so.8.0.0 /usr/bin/install: target Packaging/lt_1.0.6_rel/libtorrent-rasterbar-1.0.6/debian/tmp/usr/lib/libtorrent-rasterbar.so.8.0.0' is not a directory`

I haven't investigate fixing it but I'm sure it's a trivial escaping of the supplied path.

build libtorrent IOS for device (armv7, armv7s, arm64)

I am newbie in IOS deverlop. I want to build libtorrent for IOS.

I find and build lib dependence of libtorrent are boost and openssl.

I have had build sucess libs boost and openssl that a Fat lib of all architectures.
But with libtorrent I don't know option for configure Host and Architectures

Please, Any one can help solve for my problem.

Thanks everyone!

Clarification of static/shared build options and Asio

So I've got a patch locally that lets me build with CMake with Asio sources provided by the executable, i.e. Asio not built into the library itself. In the best interest of not introducing unnecessary options, I thought maybe it's a good idea to understand the ones that already exist in the build.

There are two options related to dynamic vs. static linking:

  • shared: "build libtorrent as shared library, as opposed to static".
    • Implies hidden visibility.
  • static_runtime: "build libtorrent with static runtime".
    • Implies /MT flag instead of /MD for MSVC builds. According to this, that flag causes Visual Studio to link its C/C++ runtime library into libtorrent itself instead of using a DLL that will usually be the host system's version.
    • Switches from BOOST_*_DYN_LINK to BOOST_ASIO_SEPARATE_COMPILATION.

A quick review of the mentioned Boost defines:

  • BOOST_*_DYN_LINK changes header-only stuff (inline declarations) of the public API to external symbol references (e.g. dllimport) that need to be resolved by the executable loading the shared object. In practice, this means if I'm a shared library and want to use the library user's Boost (rather than embedding it), I define DYN_LINK.
  • BOOST_ASIO_SEPARATE_COMPILATION removes the inline from public API and makes it into a regular function/class definition that needs to be resolved when linking the result of all compiled objects, i.e. when linking the shared library or (if using static libraries) the executable itself.
  • As an aside, Boost.Asio is also notorious for not caring about ABI stability because its maintainer considers only its source compatibility a goal. (Really looking forward to its stabilized version std::network in C++17 or whenever.)

This is my take on it:

  • Static builds should always use BOOST_ASIO_SEPARATE_COMPILATION and not include src/asio(_ssl).cpp, otherwise the parent project is tied to libtorrent as its Asio implementation. (This is bad for maintenance if the parent project also uses Asio, e.g.: "If building with libtorrent support, link libtorrent but don't include Asio sources. If building without libtorrent support, include Asio sources but not libtorrent.").
  • Because of hidden default visibility, shared builds will hide Asio symbols if using either header-only or BOOST_ASIO_SEPARATE_COMPILATION. It seems libtorrent went with the latter (see libtorrent/config.hpp), presumably to avoid generating the same templated inline code multiple times. That's okay for the library build but it should avoid forcing the library user into defining BOOST_ASIO_SEPARATE_COMPILATION too. Since it already has everything it needs, BOOST_ASIO_SEPARATE_COMPILATION or BOOST_ASIO_DYN_LINK should be defined only as a compiler option when building the library and not in libtorrent/config.hpp.
  • With all of Asio's ABI instability, I don't really see a point in using BOOST_ASIO_DYN_LINK because when using a shared library you ideally don't have the knowledge about libtorrent's exact Boost version at build time. I suggest removing this option and only leaving a separate Asio implementation as (forced) default for static builds.

So, the action plan in short:

  • Remove the BOOST_ASIO_* check from src/config.hpp.
  • For shared library builds, always define BOOST_ASIO_SEPARATE_COMPILATION and include src/asio(_ssl).cpp in the build.
    • The library user can include Asio for purposes other than libtorrent with any desired build define, or leave it out. Executable will link either way.
  • For static library builds, always define BOOST_ASIO_SEPARATE_COMPILATION but don't include src/asio(_ssl).cpp in the build.
    • The library user will always provide the implementation by themselves, with the same Boost version as libtorrent was using.

Do you approve of this action plan, is it okay if I submit a patch to implement it this way?

One question I still have is how MSVC's /MT or /MD flags factor into all of this. Why does static_runtime have an effect on Boost defines in the CMake build? What goal does it achieve for shared builds and what for static builds?

std::equal_range raised "sequence not ordered" on m_peers deque (MSVC debug)

I caught a debug exception that m_peers dequeue was unordered (3 items). It was called from peer_list::update_peer_port.
I didn't look into details, but it looks like lhs->address() always returns some default object for i2p.
I do have allow_multiple_connections_per_ip.
I feel like there is no point to find_peers(remote.address()) for i2p. There are similar places. Shall find_peers always return iterator end for i2p? This would require minimal code changes. Though I remember seeing duplicate peer-id in logs before.

Don't send start announce to i2p tracker untill local endpoint has been resolved

There are numerous attempts to send announce with ip=.i2p parameter in HTTP GET request. There is no point sending them until endpoint has been established. SAM v3 says it is Base 64 destination that is returned for NAME=ME. That needs to be turned into a SHA256 hash and converted to Base 32 to be sent to a tracker though.I was wrong However there is no need to escape Base 64 string with local destination obtained from I2P router.

Error in site link

The "github page" link from the sidebar points to http://libtorrent.org/github.com/arvidn/libtorrent instead of https://github.com/arvidn/libtorrent

Pieces priority isn't restored by 1.0.x

I have tested with the latest from RC_1_0 (c0b5792)

Piece priority isn't restored. I am not sure if it is even saved correctly to the fastresume file.

However, this doesn't happen with latest from RC_0_16

configure script BUG?

I compile libtorrent in centos6.3, my os info is:

    Linux HEIDONGVM 2.6.32-279.9.1.el6.x86_64 #1 SMP Tue Sep 25 21:43:11 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux  

I install boost library via yum software management tool, and the boost library works well and meets the libtorrent minimum required. But running the configure script detect no boost library.

Checking for boost libraries:
checking for boostlib >= 1.36... configure: We could not detect the boost libraries (version 1.36 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
checking whether the Boost::System library is available... no
configure: error: Boost.System library not found. Try using --with-boost-system=lib

also I try to make libtorrent using cmake, but link errors:

   make[2]: *** 没有规则可以创建“libtorrent-rasterbar.so.8”需要的目标“/usr/lib64/lib64/libboost_system-mt.so.5”。 停止。

make[1]: *** [CMakeFiles/torrent-rasterbar.dir/all] 错误 2

the error message seem linking the boost library again the path "/usr/lib64/lib64/", but the true is the library locate in path "/usr/lib64/".

I check the configure script and CMakeList.txt, it seems no error. Is the OS problem?

RC_1_0 doesn't build

This is from the qbt travis ci, since we pull and build RC_1_0 on each of our travis builds.

It errors out with

lazy_bdecode.cpp: In function ‘int libtorrent::lazy_bdecode(const char*, const char*, libtorrent::lazy_entry&, boost::system::error_code&, int*, int, int)’:

lazy_bdecode.cpp:132:28: error: expected primary-expression before ‘do’

lazy_bdecode.cpp:132:28: error: expected ‘;’ before ‘do’

Link to travis log line: https://travis-ci.org/qbittorrent/qBittorrent/jobs/73618576#L771

PS: You should enable travis for the RC_1_0 branch too. Not only the master branch.

bt_peer_connection::write_have(int) crash

assertion failed. Please file a bugreport at https://github.com/arvidn/libtorrent/issues
Please include the following information:

version: 1.0.6.0
$Rev$

file: 'bt_peer_connection.cpp'
line: 2292
function: virtual void libtorrent::bt_peer_connection::write_have(int)
expression: m_sent_handshake && m_sent_bitfield


stack:
1: assert_fail(char const*, int, char const*, char const*, char const*, int)
2:
3:
4:
5:
6:
7:
8: boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&)
9: boost::asio::detail::task_io_service::run(boost::system::error_code&)
10:
11: boost_asio_detail_posix_thread_function
12:
13: clone

And the qbittorrent crash log below:

*************************************************************
Catching SIGABRT, please report a bug at http://bug.qbittorrent.org
and provide the following backtrace:
qBittorrent version: v3.2.1
stack trace:
  /usr/lib/libc.so.6 : gsignal()+0x38  [0x7fdc508a8528]
  /usr/lib/libc.so.6 : abort()+0x16a  [0x7fdc508a993a]
  /usr/lib/libtorrent-rasterbar.so.8 : assert_fail(char const*, int, char const*, char const*, char const*, int)+0xf7  [0x7fdc533c75b7]
  /usr/lib/libtorrent-rasterbar.so.8 : ()+0xa2571  [0x7fdc533d8571]
  /usr/lib/libtorrent-rasterbar.so.8 : ()+0x16b45a  [0x7fdc534a145a]
  /usr/lib/libtorrent-rasterbar.so.8 : ()+0x17ba8a  [0x7fdc534b1a8a]
  /usr/lib/libtorrent-rasterbar.so.8 : ()+0x28c2a6  [0x7fdc535c22a6]
  /usr/lib/libtorrent-rasterbar.so.8 : ()+0x210ae9  [0x7fdc53546ae9]
  /usr/lib/libtorrent-rasterbar.so.8 : ()+0x21df9d  [0x7fdc53553f9d]
  /usr/lib/libtorrent-rasterbar.so.8 : boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&, boost::asio::detail::task_io_service_thread_info&, boost::system::error_code const&)+0x33f  [0x7fdc533bc38f]
  /usr/lib/libtorrent-rasterbar.so.8 : boost::asio::detail::task_io_service::run(boost::system::error_code&)+0xd9  [0x7fdc533bc519]
  /usr/lib/libtorrent-rasterbar.so.8 : ()+0x20da2b  [0x7fdc53543a2b]
  /usr/lib/libtorrent-rasterbar.so.8 : boost_asio_detail_posix_thread_function()+0x52  [0x7fdc533c0512]
  /usr/lib/libpthread.so.0 : ()+0x7354  [0x7fdc52f1c354]
  /usr/lib/libc.so.6 : clone()+0x6d  [0x7fdc5095cbfd]
[1]    24004 abort (core dumped)  qbittorrent

System: Arch Linux(x64)

Where is a problem? Crashes is too fast than I can use qbittorrent 😢

torrent_finished_alert emitted resumed torrents too

I have discovered that I get a torrent_finished_alert for all my fastresumed torrents that were already finished and I just added them to the session.

I have code reacting to this alert and it assumes that the alert is for newly downloaded torrents. A simple example is popping a balloon notification in the tray to say that X torrent finished. Complex one is having the finished torrents moved to another location.
And in my case it results in long startup times if you have many torrents.

I don't know if this is intended or not. I am bringing it to your attention and I hope you'll consider it a bug.
Tested with latest RC_1_0.

torrent_status::total_wanted doesn't change when adding with 0 file priority

Sorry for the long title.

Let's say you have a multifile torrent that you want to add to the session. Let's say that you initialize the file_priorities of add_torrent_params and set some files to 0 priority. Then after you add it to the session torrent_status::total_wanted returns the total size of the torrent instead of the non-zero priority files.

If you afterwards change the priorities total_wanted gets updated.

Tested with 1.0.6

PS: I tested with session::async_add_torrent()

Issues with class A networks

For testing purposes we have hosted our own DHT bootstrap server. To facilitate introduction to the DHT we have also setup a handful of bot clients using https://github.com/davidchappelle/bootstrap-dht-bot. Our bootstrap server is hosted by Digital Ocean and was assigned a public IP address as 45.x.y.z. Surprisingly, we discovered that our DHT was not functioning correctly. Upon investigation we found this:

libtorrent-rasterbar/src/kademlia/dht_tracker.cpp

        if (m_settings.ignore_dark_internet && ep.address().is_v4())
        {
            address_v4::bytes_type b = ep.address().to_v4().to_bytes();

            // these are class A networks not available to the public
            // if we receive messages from here, that seems suspicious
            boost::uint8_t class_a[] = { 3, 6, 7, 9, 11, 19, 21, 22, 25
                , 26, 28, 29, 30, 33, 34, 45, 48, 51, 52, 56, 102, 104 };

            int num = sizeof(class_a)/sizeof(class_a[0]);
            if (std::find(class_a, class_a + num, b[0]) != class_a + num)
                return true;
        }

Since our Digital Ocean server was assigned a 45.x.y.z address and ignore_dark_internet is enabled by default, our DHT was rendered useless. Is this perhaps a legacy issue with these class A networks? Does this list of IP addresses need to be reviewed and updated? Clearly we can use the setting to work around this but it was a bit painful arriving here.

python binding with NO_DEPRECATE torrent_info fails

I tried to use python-libtorrent without depricated functions (like this one I built myself 1.0.5 for windows), but it doesn't work even with official test here. Build with depricated works fine.
What is the correct way to load torrent file now or should I just stick with depricated build?

Error:

Boost.Python.ArgumentError: Python argument types in
torrent_info.init(torrent_info, dict)
did not match C++ signature:
init(struct _object *, class libtorrent::torrent_info ti, int flags=0)
init(class boost::python::api::object, class std::basic_string<char,struct std::char_traits,class std::allocator >, int)
init(class boost::python::api::object, char const *, int, int)
init(struct _object *, class libtorrent::sha1_hash info_hash, int flags=0)

Seeding a million torrents - two major issues

@arvidn @aldenml

Hey guys, I've hit a brick wall with a libtorrent issue I'm having, trying for over a month to fix this issue on my own, but I'm coming up empty handed. I'm currently using jlibtorrent's java impl of libtorrent 1.0.5.0 .

I've used both of these articles as reference points for my testing and settings:
http://www.libtorrent.org/tuning.html
http://blog.libtorrent.org/2012/01/seeding-a-million-torrents/

My project is called TorrentTunes , a distributed torrent-based music service where I'm basically turning each song into a .torrent file, tagging it with musicbrainz, and sharing it on an open bittorrent tracker. Here's a beta of the website up and running.

Note: I'm not using automanage for these(after extensive testing I found it inadequate for making all the files highly available).

The two issues:

  1. Libtorrent will stall/freeze if attempting to add too many torrents at once.
    I have ~10k torrents in my library, and when I loop over all of them running torrent.resume(), libtorrent basically stalls or becomes unresponsive, and stops adding them after torrent # 1200 or so.

My solution to this(although it took me a few weeks to figure out), is to wait for a tracker reply before continuing to the next torrent, then pausing that torrent. Then after all the torrents have received replies and have been paused, then loop over all of them and run torrent.resume(). I don't know if the reason this works is memory concerns, or what, but its the only way I've been able to seed more than 1200 or so torrents.

  1. I still cannot seed more than about 7000 torrents.
    This solution can bring the # of torrents I'm able to seed from 1200 to 7000 torrents. If I try this method for torrents more than 7000, libtorrent simply stops requesting tracker replies for any of the torrents, and every torrent becomes unavailable.

Here are my settings for reference:

sessionSettings.setActiveDownloads(10);
sessionSettings.setActiveLimit(999999);
sessionSettings.setActiveSeeds(999999);
sessionSettings.setActiveTrackerLimit(999999);
sessionSettings.setUploadRateLimit(0);
sessionSettings.setDownloadRateLimit(0);
session.stopLSD();
session.stopDHT();
sessionSettings.announceDoubleNAT(true);
sessionSettings.setPeerConnectTimeout(60);
sessionSettings.useReadCache(false);
sessionSettings.setMaxPeerlistSize(500);
sessionSettings.setHalgOpenLimit(5);
sessionSettings.setMixedModeAlgorithm(BandwidthMixedAlgo.PEER_PROPORTIONAL);
sessionSettings.setMinAnnounceInterval(1740);
sessionSettings.setFilePoolSize(200000);
sessionSettings.setIncomingStartsQueuedTorrents(true);
sessionSettings.setTrackerCompletionTimeout(10);

I've tried asking this on stackoverflow, but haven't received anything helpful. Thanks in advance for any help you can give me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.