Commit Graph

48 Commits

Author SHA1 Message Date
Charles Kerr d11cddc39a
fix: sonarcloud warnings (#6615)
* fix: cpp:S3358 conditional-operators-should-not-be-nested warning in gtk client

* fix: cpp:S1659 define-each-identifier-in-a-dedicated-statement warning in peer-mgr-wishlist

* Revert "fix; cpp:S3642 replace-enum-with-enum-class warning in gtk client"

* fix: cpp:S3576 remove-virtual-specifier-or-replace-it-by-override warning in rpc-server::Settings

* fix: cpp:S3576 remove-virtual-specifier-or-replace-it-by-override warning in tr_session_alt_speeds::Settings

* fix: remove unnecessary Settings subclass declarations

* fix: cpp:S1117 shadow warning in qt client

* fix: cpp:S6004 use init-statement to limit scope of local

* fix: cpp:S5997 replace-std-lock-guard-with-std-sccoped-lock in favicon-cache.h

* fix: cpp:S1659 define-each-identifier-in-a-dedicated-statement warning in announcer

* fix: cpp:S5817 function-should-be-declared-const warning in cache.h

* fix: cpp:S1186 explain-why-method-is-empty warning in favicon-cache

* fix: cpp:S5408 constexpr-variables-should-not-be-declared-inline warning in favicon-cache

* fix: cpp:S3624 explicitly delete copy assignment, ctor of InFlightData

* fix: cpp:S5997 use std-scoped-lock-instead-of-std-lock-guard

* fix: cpp:S5997 use std-scoped-lock-instead-of-std-lock-guard

* fix: cpp:S5817 function-should-be-declared-const warning in favicon-cache.h

* fix: cpp:S5817 function-should-be-declared-const warning in lru-cache

* fix: cpp:S1709 add-the-explicit-keyword-to-this-constructor
2024-02-17 22:43:24 -06:00
Charles Kerr 3cd66899fe
refactor: remove prefetch (#6332) 2023-12-04 11:45:37 -06:00
Charles Kerr 2e46bad22d
refactor: constify the inout module (#6328)
* refactor: move tr_preallocation_mode info tr_open_files

* refactor: remove unnecessary error nullptr check

* refactor: use snake_case for private method names in inout.cc

* refactor: extract-method get_fd() from read_or_write_bytes()

* refactor: make function args const where possible

* refactor: simplify read_or_write_bytes()

* refactor: make buflen a uint64_t in read_or_write_piece()

* refactor: move tr_torrentStop() logic from read_or_write_piece() to tr_ioWrite()

* refactor: make tr_ioFoo() functions take a const torrent

* refactor: make tr_cache::close_torrent_files() take a tor_id instead of a torrent
2023-12-02 14:16:36 -06:00
Yat Ho ed4fad9b18
feat: support creating 0 byte files (#6232) 2023-11-28 10:51:13 -06:00
Charles Kerr 07d96036d9
refactor: Values pt. 6 - remove deprecated API (#6250) 2023-11-14 17:23:51 -06:00
Yat Ho 736cf4aa14
refactor: thread-safe `Cache` (#6231) 2023-11-12 11:53:04 -06:00
Yat Ho a2b547fb50
chore: iwyu (#6201) 2023-11-03 12:03:26 -05:00
Julien 8ac323d5d6
chore: removed copyright timespans in headers (#4850) 2023-11-01 16:11:11 -05:00
tearfur 7fa1498ed5
perf: make `CompareCacheBlockByKey` constexpr (#5678) 2023-06-28 10:23:38 -05:00
tearfur 6bbe6537cb
feat: bypass disk write cache when `cache-size-mb` is zero 2023-06-28 08:57:26 -05:00
Charles Kerr 2db2091599
perf: in cache, flush biggest contiguous blocks (#5671) 2023-06-27 12:08:29 -05:00
tearfur ed02f98014
ditch `std::lldiv` so that functions can take matching parameter types (#5659)
* ditch `std::lldiv` so that functions can take matching parameter types

* revert unintended change
2023-06-25 13:29:58 -05:00
Charles Kerr 432fc9bafc
refactor: add libsmall dependency (#5649)
* refactor: add small dependency

* refactor: use small in variant.cc

* refactor: use small in cache.h
2023-06-20 22:50:36 -05:00
Charles Kerr 8a1a6dba49
perf: avoid extra heap alloc in block cache (#5522) 2023-05-13 14:16:00 -05:00
Charles Kerr 0d3b321bac
refactor: use snake_case for libtransmission class methods (#5497) 2023-05-05 23:11:05 -05:00
midzer 68e965aa28
perf: pass by reference (#4876) 2023-04-14 17:06:26 -05:00
Charles Kerr 4461aa68d9
fix: handle block fragments that arrive from peers out-of-order (#4890) 2023-02-14 13:50:28 -06:00
Julien 4b8cfa2e57
chore: update copyrights to 2023 (#4834) 2023-02-11 14:49:42 -06:00
Charles Kerr e8079835d3
fix: crash when a torrent autopauses after encountering an error (#4021) 2022-10-24 16:57:07 -05:00
Charles Kerr d17341d784
refactor: constify (#3780) 2022-09-06 12:52:58 -05:00
Charles Kerr 29f57bc296
chore: iwyu headers (#3661) 2022-08-17 11:08:36 -05:00
Charles Kerr c66303fae2
refactor: watchdir (#3606) 2022-08-10 08:34:51 -05:00
Charles Kerr 83ffa6bf1b
chore: fix spdx abbreviations (#3602) 2022-08-08 13:05:39 -05:00
Charles Kerr 1a0afbe95e
refactor: iwyu (#3525) 2022-07-25 21:45:54 -05:00
Charles Kerr 85c11b7f03
fix: requests across piece boundaries when piece is not a multiple of block_size
Fixes #3324.
2022-06-19 23:08:58 -05:00
Dmytro Lytovchenko d34bd0b4d6
refactor: modernize cache.cc (#3108)
* Modernize cache.cc: Convert tr_cache to a class

* Modernize cache.cc: Replaced ptrArray with vector

* refactor: Cache now takes a tr_torrents reference

* refactor: add Key type to Cache

* refactor: avoid std::back_inserter

* refactor: add Cache::flushOldest()
2022-06-11 19:46:30 -05:00
Charles Kerr 87d9f9b00a
refactor: use tr_block_info::Location in cache.cc (#2652) 2022-02-19 07:45:19 -06:00
Charles Kerr df1cca9b57
chore: update copyright years, make notices consistent (#2463) 2022-01-20 12:27:56 -06:00
Charles Kerr 42b1362760
refactor: tidy libtransmission includes (#2316) 2021-12-15 15:25:42 -06:00
Charles Kerr cc204e0b2c
refactor: prefer "using" over "typedef" (#1883)
* refactor: prefer "using" over "typedef"
2021-10-06 09:26:07 -05:00
Charles Kerr 17ee032dd8
refactor: remove TR_BEGIN_DECLS, TR_END_DECLS (#1837)
* refactor: remove TR_BEGIN_DECLS, TR_END_DECLS
2021-09-25 11:07:22 -05:00
Mike Gelfand db3d40d0ed Switch to clang-format for code formatting, include Mac client 2021-08-16 00:38:29 +03:00
Charles Kerr 677dc73eac
refactor: use GTest for running tests (#1383)
* refactor: use google-test on libtransmission tests
2020-08-11 13:11:55 -05:00
Mike Gelfand 5b29fe1556 Ensure include guard is the first non-comment line 2017-11-14 23:21:28 +03:00
Mike Gelfand dadffa2c0f Align type qualifiers to the right (code style)
This way all the qualifiers (`const`, `volatile`, `mutable`) are grouped
together, e.g. `T const* const x` vs. `const T* const x`. Also helps reading
types right-to-left, e.g. "constant pointer to constant T" vs. "constant
pointer to T which is constant".
2017-04-20 19:53:20 +03:00
Mike Gelfand d7930984ef Adjust uncrustify config, reformat all but Mac client
There're places where manual intervention is still required as uncrustify
is not ideal (unfortunately), but at least one may rely on it to do the
right thing most of the time (e.g. when sending in a patch).

The style itself is quite different from what we had before but making it
uniform across all the codebase is the key. I also hope that it'll make the
code more readable (YMMV) and less sensitive to further changes.
2017-04-20 10:01:22 +03:00
Mike Gelfand 2248d3670f Get rid of $Id$ SVN keywords in source files 2016-09-02 23:10:15 +03:00
Jordan Lee 1af60ad6ad use '#pragma once' instead of #ifndef..#define..#endif guards 2016-03-29 16:37:21 +00:00
Jordan Lee 02cff80c2d Copyedit the license's revised text: (1) remove unnecessary repitition use of the word 'license' from the top of the header and source files (2) add the standard 'we hope it's useful, but no warranty' clause to COPYING (3) make explicit that linking OpenSSL is allowed (see https://people.gnome.org/~markmc/openssl-and-the-gpl.html for background) (4) sync the Qt and GTK+ clients' license popups with COPYING's revised text 2014-01-21 03:10:30 +00:00
Jordan Lee 4b9626bb83 Licensing changes:
1. add the option the code to be used under GPLv2 or GPLv3; previously only GPLv2 was allowed

2. add the "proxy option" as described in GPLv3 so we can add future licenses without having to bulk-edit everything again :)

3. remove the awkward "exception for MIT code in Mac client" clause; it was unnecessary and confusing.
2014-01-19 01:09:44 +00:00
Jordan Lee 4904b923fb (trunk) restore copyright year as suggested in email by rms 2014-01-18 20:56:57 +00:00
Jordan Lee 3d38723ad9 Follow more common whitespace style conventions in the C code (libtransmission, daemon, utils, cli, gtk). 2012-12-05 17:29:46 +00:00
Jordan Lee 5b23aae320 (trunk libT) memory cache should use evbuffers to avoid unnecessary calls to memcpy -- done. 2011-01-29 18:56:53 +00:00
Jordan Lee 879a2afcbd Update the copyright year in the source code comments.
The Berne Convention says that the copyright year is moot, so instead of adding another year to each file as in previous years, I've removed the year altogether from the source code comments in libtransmission, gtk, qt, utils, daemon, and cli.

Juliusz's copyright notice in tr-dht and Johannes' copyright notice in tr-lpd have been left alone; it didn't seem appropriate to modify them.
2011-01-19 13:48:47 +00:00
Charles Kerr e5bb3205a1 (trunk) Join the 21st century and use only 1 space at the end sentences. This commit is nearly as important as the semi-annual ones that remove trailing spaces from the ends of lines of code... :) 2010-12-27 19:18:17 +00:00
Charles Kerr 5e4f950358 (trunk libT) #1521 "memory cache to reduce disk IO" -- whoops, I missed these parts from Longinus' patch in r10978 2010-07-08 23:38:57 +00:00
Charles Kerr cdcc4705aa (trunk) #3045 "make libtransmission's API byte-oriented instead of KiB-oriented." -- implemented. This is a largish commit and will break the mac build for a little while. 2010-07-03 00:25:22 +00:00
Charles Kerr e70bebf930 (trunk) #1521 "memory cache to reduce disk IO" -- commit block-cache-rc1.diff to trunk for the nightlies. 2010-06-19 14:25:11 +00:00