diff --git a/ChangeLog b/ChangeLog index ccbd4d0e6..5a6df12da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -88,6 +88,8 @@ * resume data no longer has timestamps of files * require C++11 to build libtorrent + * improve handling of filesystems not supporting fallocate() + * 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 914a91d47..cc25fe66f 100644 --- a/include/libtorrent/settings_pack.hpp +++ b/include/libtorrent/settings_pack.hpp @@ -627,9 +627,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, #else deprecated_force_proxy, diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index 710909ea9..e10d43295 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -1248,7 +1248,7 @@ constexpr disk_job_flags_t disk_interface::cache_hit; int const ret = j->storage->readv(b , 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 != operation_t::unknown)); TORRENT_UNUSED(ret); if (!j->error.ec) @@ -1323,6 +1323,8 @@ constexpr disk_job_flags_t disk_interface::cache_hit; ret = j->storage->readv(iov , j->piece, int(adjusted_offset), file_flags, j->error); + TORRENT_ASSERT(ret >= 0 || (j->error.ec && j->error.operation != operation_t::unknown)); + if (!j->error.ec) { std::int64_t const read_time = total_microseconds(clock_type::now() - start_time); @@ -1484,6 +1486,8 @@ constexpr disk_job_flags_t disk_interface::cache_hit; int const ret = j->storage->writev(b , j->piece, j->d.io.offset, file_flags, j->error); + TORRENT_ASSERT(ret >= 0 || (j->error.ec && j->error.operation != operation_t::unknown)); + 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 c01893600..6c796c531 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1220,7 +1220,7 @@ namespace { int const ret = posix_fallocate(native_handle(), 0, s); // posix_allocate fails with EINVAL 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/settings_pack.cpp b/src/settings_pack.cpp index 77ff746c8..94094bca3 100644 --- a/src/settings_pack.cpp +++ b/src/settings_pack.cpp @@ -309,7 +309,7 @@ constexpr int CLOSE_FILE_INTERVAL = 0; SET(utp_loss_multiplier, 50, nullptr), SET(mixed_mode_algorithm, settings_pack::peer_proportional, nullptr), SET(listen_queue_size, 5, nullptr), - SET(torrent_connect_boost, 80, nullptr), + SET(torrent_connect_boost, 30, nullptr), SET(alert_queue_size, 1000, &session_impl::update_alert_queue_size), SET(max_metadata_size, 3 * 1024 * 10240, nullptr), DEPRECATED_SET(hashing_threads, 1, nullptr), diff --git a/src/storage.cpp b/src/storage.cpp index 692d49579..0f1a95a23 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -133,8 +133,6 @@ namespace libtorrent { file_handle f = open_file(i, open_mode::read_write, ec); if (ec) { - ec.file(i); - ec.operation = operation_t::file_open; prio = m_file_priority; return; } @@ -172,8 +170,6 @@ namespace libtorrent { { if (ec) { - ec.file = i; - ec.operation = storage_error::open; prio = m_file_priority; return; } @@ -668,7 +664,7 @@ namespace libtorrent { { ec.ec = e; ec.file(file); - ec.operation = operation_t::file_fallocate; + ec.operation = operation_t::file_stat; return h; }