From 0e96ae290616e22b6d371baaaddb5a1679de8d34 Mon Sep 17 00:00:00 2001 From: arvidn Date: Sun, 12 Aug 2018 22:50:34 +0200 Subject: [PATCH 1/4] fix building with newer version of boost build, remove old option to turn off PIC on darwin --- Jamfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jamfile b/Jamfile index c0bfd8196..552053ad9 100644 --- a/Jamfile +++ b/Jamfile @@ -530,7 +530,6 @@ feature.compose on : _SCL_SECURE=1 _GLIBCXX_DEB feature fpic : off on : composite propagated link-incompatible ; feature.compose on : -fPIC ; -feature.compose off : darwin:-mdynamic-no-pic ; feature profile-calls : off on : composite propagated link-incompatible ; feature.compose on : TORRENT_PROFILE_CALLS=1 ; From 6620b6e7744ee14296c596bf4367e058910994f7 Mon Sep 17 00:00:00 2001 From: arvidn Date: Mon, 13 Aug 2018 11:07:57 +0200 Subject: [PATCH 2/4] dial back the connect boost a bit from recent update --- src/settings_pack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings_pack.cpp b/src/settings_pack.cpp index 99ce5c8a2..4b31bab12 100644 --- a/src/settings_pack.cpp +++ b/src/settings_pack.cpp @@ -334,7 +334,7 @@ namespace libtorrent SET(utp_loss_multiplier, 50, 0), SET(mixed_mode_algorithm, settings_pack::peer_proportional, 0), SET(listen_queue_size, 5, 0), - SET(torrent_connect_boost, 80, 0), + SET(torrent_connect_boost, 30, 0), SET(alert_queue_size, 1000, &session_impl::update_alert_queue_size), SET(max_metadata_size, 3 * 1024 * 10240, 0), DEPRECATED_SET(hashing_threads, 1, 0), From c9043dec538c992f51d51f6ca10f4fe9815c8bfc Mon Sep 17 00:00:00 2001 From: arvidn Date: Sun, 19 Aug 2018 10:33:02 +0200 Subject: [PATCH 3/4] force proxy no longer disables the DHT --- ChangeLog | 1 + include/libtorrent/settings_pack.hpp | 4 +--- src/session_impl.cpp | 3 --- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 16f0ae692..f8fd081b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ + * force-proxy no longer disables DHT * improve connect-boost feature, to make new torrents quickly connect peers 1.1.9 release diff --git a/include/libtorrent/settings_pack.hpp b/include/libtorrent/settings_pack.hpp index b08cccff4..b14947fd8 100644 --- a/include/libtorrent/settings_pack.hpp +++ b/include/libtorrent/settings_pack.hpp @@ -609,9 +609,7 @@ namespace libtorrent // proxy_type and proxy_hostname settings. The listen sockets are // closed, and incoming connections will only be accepted through a // SOCKS5 or I2P proxy (if a peer proxy is set up and is run on the - // same machine as the tracker proxy). This setting also disabled peer - // country lookups, since those are done via DNS lookups that aren't - // supported by proxies. + // same machine as the tracker proxy). force_proxy, // if false, prevents libtorrent to advertise share-mode support diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 698468794..49eb6e896 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -6526,9 +6526,6 @@ retry: stop_lsd(); stop_upnp(); stop_natpmp(); -#ifndef TORRENT_DISABLE_DHT - stop_dht(); -#endif } #ifndef TORRENT_NO_DEPRECATE From 6e80f1f615390b2697d27cd2feaf623790d85e29 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 19 Aug 2018 21:55:31 +0200 Subject: [PATCH 4/4] improve handling of filesystems not supporting fallocate() --- ChangeLog | 1 + src/disk_io_thread.cpp | 6 +++++- src/file.cpp | 4 ++-- src/storage.cpp | 6 +----- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8fd081b1..1d32f234d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ + * improve handling of filesystems not supporting fallocate() * force-proxy no longer disables DHT * improve connect-boost feature, to make new torrents quickly connect peers diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index 86493ef7c..de7c8b0fd 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -1184,7 +1184,7 @@ namespace libtorrent int ret = j->storage->get_storage_impl()->readv(&b, 1 , j->piece, j->d.io.offset, file_flags, j->error); - TORRENT_ASSERT(ret >= 0 || j->error.ec); + TORRENT_ASSERT(ret >= 0 || (j->error.ec && j->error.operation != 0)); if (!j->error.ec) { @@ -1258,6 +1258,8 @@ namespace libtorrent ret = j->storage->get_storage_impl()->readv(iov, iov_len , j->piece, adjusted_offset, file_flags, j->error); + TORRENT_ASSERT(ret >= 0 || (j->error.ec && j->error.operation != 0)); + if (!j->error.ec) { boost::uint32_t const read_time = total_microseconds(clock_type::now() - start_time); @@ -1418,6 +1420,8 @@ namespace libtorrent int ret = j->storage->get_storage_impl()->writev(&b, 1 , j->piece, j->d.io.offset, file_flags, j->error); + TORRENT_ASSERT(ret >= 0 || (j->error.ec && j->error.operation != 0)); + m_stats_counters.inc_stats_counter(counters::num_writing_threads, -1); if (!j->error.ec) diff --git a/src/file.cpp b/src/file.cpp index d17a37216..187058779 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -2154,9 +2154,9 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER { // if you get a compile error here, you might want to // define TORRENT_HAS_FALLOCATE to 0. ret = posix_fallocate(native_handle(), 0, s); - // posix_allocate fails with EINVAL in case the underlying + // posix_allocate fails with EINVAL or ENOTSUP in case the underlying // filesystem does not support this operation - if (ret != 0 && ret != EINVAL) + if (ret != 0 && ret != EINVAL && ret != ENOTSUP) { ec.assign(ret, system_category()); return false; diff --git a/src/storage.cpp b/src/storage.cpp index d6bf3be13..19108008c 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -457,8 +457,6 @@ namespace libtorrent file_handle f = open_file(i, file::read_write, ec); if (ec) { - ec.file = i; - ec.operation = storage_error::open; prio = m_file_priority; return; } @@ -489,8 +487,6 @@ namespace libtorrent { if (ec) { - ec.file = i; - ec.operation = storage_error::open; prio = m_file_priority; return; } @@ -1600,7 +1596,7 @@ namespace libtorrent { ec.ec = e; ec.file = file; - ec.operation = storage_error::fallocate; + ec.operation = storage_error::stat; return h; }