Commit Graph

5427 Commits

Author SHA1 Message Date
Arvid Norberg 27401c9f44 add high_priority flag to tracker announcements, to put them at the front of the queue. This can be done manually in force_reannounce() or will happen automatically as part of connection-boost 2025-12-29 02:01:22 +01:00
arvidn 9e8dfd4e72 suppress warning of negative size passed to std::malloc() 2025-12-28 14:30:37 +01:00
arvidn 62de9507b7 update default DSCP value and update docs 2025-12-28 00:47:38 +01:00
arvidn 60b09be37e fix python binding for notify_callback to hold the GIL when destructing 2025-12-27 22:18:01 +01:00
arvidn 6baffac70c improve stack_allocator oom handling 2025-07-27 18:13:42 +02:00
arvidn 9dcf74b649 cache stack_allocator's allocation of torrent name (used in all tracker alerts) to optimize memory footprint 2025-07-26 08:37:30 +02:00
arvidn 95f81b92bc fix stack_allocator to fail gracefully when running out of memory 2025-07-26 02:10:56 +02:00
Arvid Norberg a988738738 fix warnings (#7991) 2025-07-20 17:11:30 +02:00
Arvid Norberg 23388c17ff add option to send host header in HTTP proxy CONNECT command (#7710)
* add option to send host header in HTTP proxy CONNECT command

* land bearx3f's fix

* fixup
2025-07-18 08:04:57 +02:00
arvidn 98e02bf5da fix new clang warnings 2025-07-07 13:15:03 +02:00
arvidn 153774853f cache DNS failures for a shorter time 2025-07-03 11:19:45 +02:00
Arvid Norberg 122c6edb33 add documentation and changelog entry for get_resume_data() 2025-06-29 21:28:36 +02:00
Vladimir Golovnev (glassez) 1e539545c4 Add ability to get resume data synchronously 2025-06-29 16:12:28 +02:00
Lauta 4fc6e833c0 Add inbound and outbound tunnels length variance in i2p stream settings. (#7942)
* Add inbound and outbound tunnels length variance in i2p stream settings.

* Add newline at the end of test_settings_pack.cpp to avoid warnings.

* Fixed the order of the new I2P session options (tunnel length variance for inbound and outbound tunnels). Now the new options are placed at the end of the enum, to avoid breaking the ABI.
2025-06-28 16:37:17 +02:00
Chocobo1 290b02d350 Don't leak file descriptors to child processes
Without `O_CLOEXEC`, `SOCK_CLOEXEC` and `MADV_DONTFORK`, the file descriptors are available to the
child process which would lead to leaking file descriptors and other unwanted behaviors.
2025-05-06 10:13:53 +02:00
bolshoytoster 80f8d0796c Optimize the utp resend loop in utp_socket_impl::send_pkt
There has been a TODO message there for over 10 years now saying that the
current implementation isn't very efficient, and it isn't.

This commit adds a new `std::vector` `m_needs_resend` for each utp connection to
track the packets that need to be resent. I've kept the behaviour the same as
the previous implementation - the packets at `m_acked_seq_nr` (last acked packet)
and `m_seq_nr` (FIN packet) will never be added to `m_needs_resend`.

Whoops, forgot to commit this

Caught the segfault

Account for `resend_packet` erasing the packet from `m_needs_resend`

Uncomment sequence number assertions

Move some assignments so invariant checks pass

Update src/utp_stream.cpp

Co-authored-by: Arvid Norberg <arvid.norberg@gmail.com>

Make a `need_resend` variable `const`

Co-authored-by: Arvid Norberg <arvid.norberg@gmail.com>
2025-04-26 12:56:56 +02:00
Arvid Norberg 21cbbf74ee support find_torrent() for v2 torrents 2025-03-30 14:18:06 +02:00
Chocobo1 0afd8a7a48 Suppress msvc C5054 warning
The warning is emitted when compiling in C++20 mode.

https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5054?view=msvc-170
2025-03-04 02:40:41 +01:00
Arvid Norberg 2b2929af7d fix handling of invalid filenames 2025-02-11 10:28:13 +01:00
Arvid Norberg 57fd4e452e fix warning in posix_storage and TORRENT_RVO 2025-02-04 02:03:54 +01:00
arvidn 9d7443f467 validate add_torrent_params::save_path at run-time 2025-01-28 11:57:42 +01:00
arvidn 9bd55cbc3d add invariant check to socks5_stream and make it resilient to a race when closing the socket 2025-01-26 23:45:12 +01:00
arvidn dc035e8ec8 add some possible values to the documentation for dht_bootstrap_nodes 2025-01-25 09:53:48 +01:00
Arvid Norberg 06be134b6f bump version 2025-01-23 16:11:31 +01:00
arvidn 71323dd0dc remove use of std::aligned_union 2025-01-23 12:26:01 +01:00
Maxime THIEBAUT f9dde8240f Add announce_port support 2024-11-09 10:20:19 +01:00
arvidn 7f691246aa update piece picker. rename 'have' -> 'flushed' and 'passed' -> 'have' to make it clearer that a piece that has passed the hash check, we 'have', and is available to be picked by peers. This addresses an issue where we would wait for pieces to be written to disk before advertizing it to peers 2024-11-01 15:34:03 +01:00
Arvid Norberg e5fe95f922 fix performance bug in the file pool, evicting MRU instead of LRU. Discovered by HanabishiRecca 2024-10-29 13:13:13 +01:00
arvidn 07b2574c61 don't hint POSIX_FADV_RANDOM. Normal piece sizes, of 2 or 4 MiB, probably warrants read-ahead. Some antecdotes suggests this improve read speed in some circumstances 2024-10-21 01:24:59 +02:00
Joris Carrier b90ed662d2 minor fix on documentation 2024-10-20 14:54:58 +02:00
arvidn aee6a8e0ed limit the piece size in create_torrent constructor 2024-10-01 10:36:01 +02:00
arvidn 5d5eeeff19 add test 2024-09-30 19:34:54 +02:00
xavier2k6 790b6629f6 Fix some typos 2024-09-29 14:13:46 +02:00
arvidn c014f1d8d8 wrap ::time() to allow simulator runs to produce deterministic results 2024-07-27 18:50:38 +02:00
arvidn d35c283e87 remove aligned storage, as it's deprecated in C++23 2024-07-20 21:12:09 +02:00
arvidn fda33cf509 assume copy_file_range() exists on linux (unless old glibc or android) 2024-05-12 17:43:58 +02:00
zzlhyly 2f23cd1df5 fix the compilation failure caused by the failure to find std::max 2024-05-11 09:06:48 +02:00
arvidn e539df0cc8 fix integer overflow in piece picker 2024-03-11 20:46:55 +01:00
arvidn a65348137d torrent_status::num_pieces counts pieces passed hash check, as documented 2024-02-21 14:26:52 +01:00
arvidn 1a00267990 bump version for future release 2024-02-20 00:48:50 +01:00
arvidn 74bc93a37a bump version to 2.0.10 2024-02-19 13:14:14 +01:00
arvidn cc9d07ecd6 fix and suppress some new clang warnings util addressed (in master) 2024-02-17 18:11:33 +01:00
Vort 18f821ea1a allow I2P leaseset encryption type 4 2024-01-14 21:43:34 +01:00
arvidn 4ddeeb6d2f migrate away from aligned_storage 2024-01-14 20:28:30 +01:00
Joris CARRIER 8b71ce6071 allow execution of on_unknown_torrent method in the absence of active torrents 2024-01-13 17:33:00 +01:00
arvidn 3a6b331c50 improve checking and testing of max piece size 2023-11-14 22:55:29 +01:00
arvidn 3a44a5a78e improve TORRENT_RVO feature detection 2023-08-27 02:26:14 +02:00
arvidn 7208996832 rely on RVO in C++20 2023-08-26 01:20:45 +02:00
arvidn e845e1cc31 fix unnecessary capture of this in lambda expressions. and avoid implicitly capturing it, to conform to C++20 2023-08-25 19:45:10 +02:00
Vladimir Golovnev (glassez) 34285c60d4 Allow to change save path without any additional actions 2023-08-24 14:36:15 +02:00