Commit Graph

5808 Commits

Author SHA1 Message Date
Yat Ho 71904b9de2 fix: keep peer io alive inside utp callback (#6507)
(cherry picked from commit a1160f1556)
2024-01-25 20:06:24 +08:00
Yat Ho 64b87b376f fix: always schedule uTP ack after receiving a packet (#6508)
* fix: always schedule uTP ack after receiving a packet

* chore: add comment to explain change

(cherry picked from commit 0ce4adf07c)
2024-01-25 20:06:23 +08:00
Yat Ho d5a555c6bb fixup! fix: implement proper download limit for uTP (#6416) (#6481)
(cherry picked from commit dce0d37130)
2024-01-25 20:06:22 +08:00
Yat Ho 2e34c6f820 fix: implement proper download limit for uTP (#6416)
* fix: return read buffer size in libutp read buffer size callback

* refactor: clamp amount of data processed in `can_read_wrapper()`

* chore: housekeeping

* refactor: call `utp_read_drained()` in on-read callback

so that uTP acks can be sent out in a more timely fashion

(cherry picked from commit 5000edef01)
2024-01-25 20:06:20 +08:00
Yat Ho 1ccef92cdc fix: use one variable to store `TR_KEY_rpc_authentication_required` (#6514) 2024-01-09 23:13:28 -06:00
Cœur 954c0d179f build: fix libtransmission build on very old cmake versions (#6418)
* Fix libtransmission build requirements

* code review: keeping compatibility with deprecated cmake
2024-01-06 13:31:38 -06:00
Mike Gelfand a8ae0e73be fix: a couple of logging format issues (#6463)
* Fix swapped log args in `do_log_system_error()`

* Fix invalid fmt use in `tr_rpc_server::load()` logging
2023-12-30 18:30:35 -06:00
Charles Kerr 387f0f8e74 fix: invalid TR_TORRENT_TRACKERS env var for some torrents (#6434) 2023-12-24 16:40:31 -06:00
Charles Kerr d1333e6aa1
fix: crash after nullptr dereference in rpcimpl (#6177) (#6348)
Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2023-12-06 15:24:13 -06:00
Charles Kerr 2e2c86060b fix: in RPC, default to sort torrents by id (#5604)
When getting all torrents in a batch over RPC, the results are sorted by
info-dict hash. Prior to 4.0.0, they were sorted by ID. This change broke
some peoples' workflows.

I'm OK with breaking workflows if it's necessary to improve the program,
but this was an unintentional side-effect and I don't see any inherent
benefit to either sort order. So this PR restores the 3.00 sort order.

https://xkcd.com/1172/
2023-12-03 15:52:43 -06:00
chantzish 4da965365c fix: magnet data invalidation of tracker IDs (#5957) 2023-11-03 12:57:46 -05:00
Yat Ho 4bb205d440 fix: workaround HSTS upgrading to HTTPS for HTTP trackers (#5969) 2023-11-03 12:57:32 -05:00
hgy59 bcab17f963 fix: tr_sys_path_copy in file-posix.cc for some Synology Devices (#5966) (#5974) 2023-11-03 12:56:36 -05:00
Yat Ho a5d4b5903d fix: formatting cmdline help message (#6174) 2023-11-03 12:53:38 -05:00
Yat Ho 90b86a17d8
fix: encode `ip` in network byte order for udp announce (#6126) (#6132)
* fix: encode `ip` in network byte order for udp announce (#6126)

(cherry picked from commit c70c49e87b)

* fixup! fix: encode `ip` in network byte order for udp announce (#6126)
2023-10-20 11:32:42 -05:00
Yat Ho ba36954c6c
fix: only consider piece data in bandwidth limit (#6082) (#6134)
* fix: only consider piece data in bandwidth limit

* refactor: remove unused `tr_bandwidth::clamp()` signature

(cherry picked from commit 43aff088d8)
2023-10-20 11:23:00 -05:00
Yat Ho cf6691acca
fix: json string serializer improperly escaping characters (#6005) (#6133)
* feat: escape json string according to RFC8259

* fix: do not append newline when json serde is in compact mode

* fix: json tests

1. Use the same locale settings as the apps
2. Added additional test case for a string that are known to be prone to locale issues
3. Removed test for escaping non-BMP characters to UTF-16 escape sequences

* chore: add more test cases to `JSONTest.testUtf8`

* chore: order cases in the same order as RFC8259

(cherry picked from commit 0259edbaf3)
2023-10-20 11:21:51 -05:00
Charles Kerr b8802aebb5
fix: announce LDP on listening interface (#5875) (#5896) 2023-08-13 22:02:54 -05:00
Zhenyu Qi daff66690a fix: announce with query replace bug (#5871) 2023-08-13 19:28:35 -05:00
Cœur 03ffe42ad4 fix: -fobjc-arc with GCC (#5632) 2023-07-29 20:58:38 -05:00
tearfur e8ef1f3d38 fix: disregard locale when building LDP announce message (#5825) 2023-07-28 10:33:25 -05:00
tearfur 264746959b fix: clamp down harder for upload as well (#5821) 2023-07-25 11:57:21 -05:00
tearfur de26f38c77 perf: reduce copying in `enforceSwarmPeerLimit()` (#5731)
* reduce copying in `enforceSwarmPeerLimit()`

* clearer comparator naming
2023-07-14 19:55:36 -05:00
Charles Kerr 14e31babbb perf: faster Cache::write_contiguous() (#5715) 2023-07-02 15:24:49 -05:00
tearfur 2941005e34 perf: convert comparator functors to static constexpr (#5687) 2023-06-30 12:29:53 -05:00
tearfur 87388ee7c8 perf: make `CompareCacheBlockByKey` constexpr (#5678) 2023-06-28 11:47:46 -05:00
Geoffrey Bonneville 115a069d8d fix: do not write log if file handler is bad (#5675) 2023-06-27 13:56:01 -05:00
Charles Kerr d2200cf9ea perf: in cache, flush biggest contiguous blocks (#5671) 2023-06-27 12:20:38 -05:00
Charles Kerr b86afe185b fixup! fix: return error when renaming into existing file (#5563) 2023-06-22 17:33:19 -05:00
tearfur 4343926441 encode `&key=` as fixed-width 8-digit hex (#5652) 2023-06-21 11:53:28 -05:00
Василий Чай 504b77b0b9 fix: return error when renaming into existing file (#5563) 2023-06-19 00:31:18 -05:00
Mike Gelfand 3b44fa034d Avoid locale use in `tr_truncd()` (#5587)
`tr_parseNum<>()` is implemented with `fast_float::from_chars()`, and
the latter is documented as "expecting a locale-indepent format
equivalent to what is used by std::strtod in the default ("C") locale".
To accomodate locale independent number parsing, switch back to
locale-independent number formatting in `tr_truncd()` by both removing a
`L` format specifier from `fmt::format_to_n()` call and using a fixed
"." decimal separator when truncating the value.
2023-06-10 17:09:55 -05:00
Charles Kerr edcddd00dd perf: avoid extra work in read_vc() (#5527) 2023-05-14 15:12:28 -05:00
Charles Kerr 04b5329345 fix: avoid unintentional map insertions in ActiveRequests::count() (#5520) 2023-05-12 20:18:47 -05:00
Gary Elshaw 96aefb5fc3 fix: comment typos in libtransmission (#5473) 2023-05-09 13:45:15 -05:00
Mike Gelfand 411b66cf88 fix: use user-preferred locale (#5444)
* Use user-preferred locale

Previous fix adding `L` format specifier was correct but only fixed half
of the problem, as C++ locale is set up to be "C" by default. GTK client
used to call `setlocale(LC_ALL, "")` to set up user-preferred locale
which only affected C functions and `std::locale` (used by libfmt) was
unaware of those changes.

Apply the fix to all the binaries since they're all doing some sort of
output to the user and calling libtransmission helpers, as well as using
libfmt directly.

* Improve libtransmission's json-test

Set the locale C++ way to avoid any sort of inconsistencies, and also
restore it to the old one once finished testing.

* Improve transmission-show test runner script

Quote outputs to avoid CMake error about `message()` being called with
no arguments. Capture stderr to the same output file. Fallback to `git
diff` if `diff` wasn't found. A few other minor changes.
2023-04-27 09:11:06 -05:00
Charles Kerr 02b8535aa1 perf: in Buffer::Iterator, defer evbuffer API calls (#5420) 2023-04-26 23:29:57 -05:00
Charles Kerr 2be3ecfd27 fix: bug that prevented providing the final metadata piece (#5460)
Fixes bug in implementation of BEP 9

Xref: https://www.bittorrent.org/beps/bep_0009.html
2023-04-26 23:29:07 -05:00
Charles Kerr c37b297b25 fix: minor warnings (#5409)
* chore: fix readability-qualified-auto warnings

* chore: fix clang-analyzer-core.uninitialized.Branch warning

* fix: collision of key 'ERROR' in transmission-qt

* chore: silence -Wshadow warning

* chore: silence warning C4100: 'iter': unreferenced formal parameter

* chore: fix warning C4127: conditional expression is constant warning
2023-04-20 14:16:09 -05:00
Kyle Sanderson 256fd698d7 fix: uninitialized session_id_t values (#5396) 2023-04-20 14:13:51 -05:00
Charles Kerr 0e2b8d721c
fix: only torrent metainfo display-name as a fallback (#5378)
Fixes #5347.
2023-04-12 17:26:43 -05:00
Charles Kerr e33d9536ef
fix: return success on RPC add-torrent duplicate (#5370)
Keep Transmission 3's behavior to avoid unannounced API change
2023-04-12 13:37:04 -05:00
Cœur 91717fe91d
fix: potential NSString leak in tr_strv_convert_utf8() 2023-04-11 17:36:22 -05:00
Charles Kerr c76cb4db51
fix: silence torrent-metainfo warnings for cross_seed_entry, uid (#5365) 2023-04-10 11:07:43 -05:00
tearfur 931beba56f
fix: set log level before constructing tr_session (#5345) 2023-04-03 15:37:28 -05:00
tearfur e68c72daa4
fix: tr_net_hasIPv6() (#5312) 2023-03-28 13:41:07 -05:00
tearfur 85a00625dc
fix: intermediate fix for HTTP announce behaviour affected by `bind-address-ipv*` (#5296) 2023-03-28 12:59:42 -05:00
Mike Gelfand a216bd7cec
Use locale-dependent decimal separators for user-visible numbers (#5288)
This includes percents, ratios, sizes, speeds, etc. coming from shared
formatting helpers. Previously based on sprintf-like functions using
locale, now using libfmt which doesn't use locale by default and needs
to be instructed to do it explicitly.
2023-03-23 19:48:45 -05:00
Cœur 3e97d0b9c2
fix: The right operand of '<' is a garbage value (#5285) 2023-03-23 12:05:11 -05:00
Charles Kerr d63165e8a4
perf: fix wishlist cpu load regression, pt. 2 (#5273) 2023-03-22 10:24:10 -05:00