Commit Graph

355 Commits

Author SHA1 Message Date
arvidn bdee0b563c fix suggest_read_cache setting 2020-02-02 20:16:59 +01:00
arvidn a53d090313 fix handling of torrents with too large pieces 2019-11-25 02:46:55 +01:00
arvidn 07ab3b9739 add feature to create an affinity to pick adjecent pieces aligned to 4MiB extents. It's an attempt to improve disk I/O, by writing larger contiguous ranges of bytes. It's off by default. 2019-08-17 12:32:47 +02:00
arvidn 7f2a78d0c9 make random_shuffle() take a range instead of two iterators. use random_bytes() instead of std::generate() and random_byte(). Remove unused hasher.hpp includes 2019-02-19 01:48:08 +01:00
arvidn 1b2832e018 convert some for-loops into std algorithms 2018-11-27 19:43:01 +01:00
arvidn 3f87801142 fix some cppcheck warnings 2018-11-27 13:53:38 +01:00
arvidn 7103b12cb7 remove typed_span type 2018-11-17 00:43:58 +01:00
arvidn 5383854768 make span's and sha1_hash's index and size types signed (instead of unsigned). Specifically std::ptrdiff_t. In line with the direction of gsl span and reduce signed->unsigned casts 2018-11-16 14:06:22 +01:00
arvidn 69485558ef factor out duplicate code in piece_picker, upnp and lazy_bdecode 2018-11-10 15:17:57 +01:00
Arvid Norberg 761384bcf1 minor piece picker cleanup 2018-10-05 10:58:09 +02:00
arvidn 16249b8135 fix overflow in calc_bytes(), add more tests, fix bug in piece picker accounting of filtered pad blocks. 2018-09-09 20:17:32 -07:00
arvidn c9cbb122e2 fix some warnings from sonar-cube 2018-09-05 18:10:57 -07:00
arvidn 37d85ac2f7 improve piece picker performance in tracking pad-blocks 2018-08-20 17:13:20 +02:00
arvidn 058419a77c simplify total_have/have_want/total_want. make piece_picker track pad blocks and compute byte-progress at block granularity 2018-08-19 22:21:24 +02:00
arvidn d55200af9d minor simplification of bytes_left(), remove quantized_bytes_done() 2018-08-11 08:29:45 +02:00
arvidn f1d2105afb remove dead code from piece picker 2018-08-08 23:41:46 +02:00
arvidn f0227451a6 merged RC_1_1 into master 2018-04-13 01:47:41 +02:00
Alden Torres 9b1e79660f removed unnecessary parentheses around min/max, added some const modifier (#2926) 2018-04-11 15:19:00 +02:00
arvidn aaf9304a3b update year in copyright header 2018-04-09 09:04:33 +02:00
arvidn 67bbb82122 improve type-safety in piece picker, by introducing a type for download queue index, for pieces 2018-03-24 23:03:09 +01:00
arvidn 3171245292 fix warnings 2018-03-24 23:01:19 +01:00
arvidn 9df4d4b7f8 replace typedef with using. replace NULL with nullptr. cleanup page_aligned_allocator 2018-03-23 11:19:46 +01:00
arvidn 50a293730b merged RC_1_1 into master 2018-01-29 10:20:45 +01:00
arvidn 9ac394f5b0 turn piece picker option flags into a proper type 2018-01-29 03:01:17 +01:00
arvidn ca3ea591df fix pad-file scalability issue 2018-01-29 03:00:37 +01:00
arvidn 65fef972a2 apply some c++11 modernization 2018-01-11 04:51:39 -05:00
pavel.pimenov 5a772325a0 redundant is_finished(block.block) 2018-01-09 03:20:28 -05:00
arvidn 6785046c2f introduce a download_priority_t type, for uniform an type-safe piece- and file priorities 2017-11-02 08:20:21 +01:00
arvidn 50bef25786 make the piece-picker less two-phase initialized 2017-10-26 23:39:15 +02:00
arvidn 330904f460 convert picker_flags_t to type safe flags 2017-07-23 09:29:25 -07:00
Alden Torres f6ca04638c added const and auto refactor in torrent, piece_picker 2017-06-20 13:20:12 -04:00
arvidn 480bde9333 change formatting of namespace declarations 2017-04-12 14:26:35 -04:00
Arvid Norberg 8cf6e9e37c use span<> to return the block_info for a piece (#1777)
use span<> to return the block_info for a piece to improve range checks and loops
2017-03-04 23:45:07 -05:00
Alden Torres 4d5ddc90f5 fixing sign-conversion warnings, part 14, minor refactor 2017-02-10 15:27:49 -05:00
Alden Torres 3803661863 moved alloca.hpp to private aux_ and size refactor (#1634)
moved alloca.hpp to private aux_ and size refactor
2017-01-27 12:43:34 -05:00
Arvid Norberg 6a701437b6 use strong_typedef for peer_class_t type (#1595)
use strong_typedef for peer_class_t type
2017-01-21 22:40:19 -05:00
Arvid Norberg f1e34dfbd5 remove long-standing deprecated filter_pieces functions (#1457)
remove long-standing deprecated filter_pieces functions
2016-12-27 12:42:23 -08:00
Arvid Norberg 42a27b3ebc introduce a prio_index_t type (#1453)
* introduce a prio_index_t type for indexing into the priority sorted piece list, m_pieces, in piece_picker

* some piece picker simplification

* fix msvc warning for prio_index_t
2016-12-26 08:25:50 -08:00
Arvid Norberg 3f1084d63d strengthened type safety in handling of piece and file indices (#1409)
strengthened type safety in handling of piece and file indices
2016-12-22 10:42:33 -05:00
Alden Torres 22b596945e enable /W4 warnings for msvc 2016-12-13 19:36:14 -05:00
Alden Torres 3a92908f39 formatting, added std:: and spaces 2016-12-10 23:11:43 -05:00
Alden Torres e1dcf82e2a fixing shorten-64-to-32 warnings, part 3 2016-12-08 20:22:34 -05:00
arvidn 09b5cfd688 remove build option to use narrower types in piece_picker (optimize_memory_usage) 2016-11-29 08:11:51 -05:00
Alden Torres d5c4cd7280 fixed sign-compare warnings and some refactor (#1354)
fixed sign-compare warnings and some refactor. make sequence_number backed by std::int64_t
2016-11-27 08:46:53 -05:00
Alden Torres c30027e4a1 more integral type conversion warning fixes, now only needs shorten-64-to-32 (#1349)
more integral type conversion warning fixes, now only needs shorten-64-to-32
2016-11-25 11:17:25 -05:00
Arvid Norberg 5f3c52f406 transition to more default member initializers (#1261) 2016-10-26 20:41:57 -04:00
Steven Siloti a6e5ba8804 return a span from TORRENT_ALLOCA (#1244)
return a span from TORRENT_ALLOCA

Unfortunately this requires moving the variable declaration inside the macro.
Due to alloca’s unique properties pretty much the only safe way to call it is
in a simple assign-to-pointer expression. Therefor we need to use a temporary
pointer to store the value returned from alloca before we can call span’s ctor.

This also causes double evaluation of the size parameter which is unfortunate,
but no current callers of TORRENT_ALLOCA have a problem with this. Passing
expressions with side effects to macros is bad mojo anyways.
2016-10-22 14:43:40 -04:00
Arvid Norberg 8bb7aa62ae generalize and improve http redirect support for web seeds (#1060)
generalize and improve http redirect support for web seeds
2016-10-02 23:08:03 -07:00
Arvid Norberg d2002c5248 separate piece_block and has_block out to their own headers (#1148) 2016-09-24 08:46:56 -07:00
Alden Torres e11f233086 minor cleanup/refactor (#1062) 2016-09-04 18:24:20 -04:00