Commit Graph

284 Commits

Author SHA1 Message Date
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 f4f1425115 use UNC paths pervasively on windows 2019-01-12 21:00:40 +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 6be8b395da some cleanup turning memcmp() and memcpy() into span comparisons and std::copy(). some more use of random_bytes() instead of loops. 2018-11-05 18:52:45 +01:00
arvidn 109db58641 merge RC_1_1 into master 2018-09-25 21:33:29 -07:00
arvidn 6c4d1b9143 back-port the patch to split up the progress_notification alert_mask into three new categories, file-, piece- and block progress 2018-09-24 08:52:30 -07:00
Arvid Norberg b90564d418 remove the IPv6 enable/disable build config 2018-08-19 22:20:54 +02:00
arvidn 4096085bf8 merged RC_1_1 into master 2018-07-30 13:44:44 +02:00
arvidn 19df645012 apply piece priorities immediately, even though file priority updares are async. save both file- and piece priorities in fast resume. when loading, apply file prios first, then piece prios 2018-07-29 21:53:01 +02:00
Arvid Norberg 107337f821 make tests print more of peer logs 2018-06-23 23:09:45 +02:00
arvidn 5530793c75 improve the API for iterating over all files and pieces, with the new strong index types. 2018-06-12 11:44:29 +02:00
Arvid Norberg 0e49051f17 make create_random_files() take a span instead of pointer, length parameters 2018-06-11 01:35:31 +02:00
Arvid Norberg 1b62aff9d1 minor improvements to test_checking 2018-06-10 16:25:10 +02:00
arvidn fe612ca167 replace the TORRENT_CFG ABI check with inline namespaces around the symbol that can change ABI based on build configuration options 2018-05-13 19:25:17 +02:00
Arvid Norberg 6efff919cd deprecated alert::progress_notification alert category, split into finer grained categories 2018-04-05 16:27:28 +02:00
arvidn d080c6f532 merged RC_1_1 into master 2018-03-26 12:56:25 +02:00
d_komarov 1c867a5026 Changing file priorities while checking interrupts checking.
Also, if the last file has zero priority, checking is interrupted prematurely.
2018-03-26 02:59:10 +02:00
arvidn 9df4d4b7f8 replace typedef with using. replace NULL with nullptr. cleanup page_aligned_allocator 2018-03-23 11:19:46 +01:00
arvidn 5c1b65e9b8 merged RC_1_1 into master 2018-03-12 02:32:12 +01:00
arvidn a06e4f696b track whether a file is eligible for using the partfile on a per-file basis. This is intended to improve backwards compatibility, to better support resuming files downloaded with older versions of libtorrent 2018-03-11 12:52:56 +01:00
arvidn 9696082355 merged RC_1_1 into master 2018-02-25 09:36:12 +01:00
d-komarov 41b3d437de Fix and improve setup_transfer
Numerous issues cause test fails on Windows(and Linux?). Most of them
found in print_alerts procedure.

Make print_alerts predicate check short-circuit, i.e. exit early on
first match. Fixes cases when appropriate variable may be re-assigned
multiple times with incorrect values.

Make stop_process wait until actual process successfully terminates.
This change is applicable to Windows only and helps to avoid tests
cleanup errors.

Make stop_proxy procedure do what it suppose to do. Previously it was
doing nothing with intention that all proxies are stopped after test
completion. Under Windows there are problems with proxy that has it's
socket connection abandoned. Thus failing the rest of test cases.

* Fix stop_all_proxies map using incorrect key to erase elements
* Fix wait_for_alert case with negative 'num'
* Make print_alerts predicate const& to avoid extra copy
* Make listen_alert and downloading_alert predicate procs reentrant
2018-02-19 23:23:15 +01:00
arvidn 4fef787212 merged RC_1_1 into master 2018-01-24 00:37:05 +01:00
arvidn efd096d879 use unique peer_ids per connection 2018-01-23 16:40:16 +01:00
Arvid Norberg 60b74d2616 merged RC_1_1 into master 2017-10-10 14:25:12 +02:00
Arvid Norberg 830ef0bedd prevent dependency on openssl from leaking outside of libtorrent (libssl and libcrypto should not be a usage requirement). This cleans up most tests to build without having to also link against openssl 2017-10-09 17:15:35 +02:00
arvidn 865ff09a84 merge RC_1_1 into master 2017-08-10 16:44:57 +02:00
arvidn 378a0e974b fix issue of force-recheck or seeding from read-only media, torrents with empty files in them. Previously libtorrent would create empty files up-front unconditionally, now they won't be created if they already exist 2017-08-09 18:48:49 +02:00
arvidn c4eb4c8b5f use span in torrent_info constructors and deprecate the redundant flags argument 2017-07-22 00:00:44 -07:00
arvidn 4947602a2f make add_torrent_params::flags_t an enum class and move it out into its own header 2017-07-17 01:05:31 -07:00
AllSeeingEyeTolledEweSew 00655d562b Refactor several flags to torrent_handle::get_flags/set_flags. 2017-07-17 01:05:31 -07:00
arvidn c4afb5e949 use a dedicated class template for flags types instead of enum class. It's more backwards compatible and improves ergonomics 2017-07-15 01:15:57 -07:00
arvidn ffaabd846c make file open mode flags be an enum class for type-safety 2017-05-28 11:16:59 -04:00
Arvid Norberg 660cdaf2d1 deprecate direct access to array in session_stats_alert (#2033) 2017-05-27 20:33:31 -04:00
Arvid Norberg 1925d1e7aa add test for recent duplicate add bug (#2003) 2017-05-17 23:04:50 -04:00
Steven Siloti a693565df0 hack to get test_stop_tracker_timeout working 2017-04-30 08:11:56 -04:00
arvidn d138f02424 introduce lt namespace alias 2017-04-23 23:43:58 -04:00
arvidn 79d7ae3638 separate path and filesystem functions out into its own translation unit/header file pair, separating it from the file and directory class 2017-04-11 18:07:55 -04:00
Arvid Norberg 64ad4f5c96 enable warnings when building tests (#1880) 2017-04-02 14:22:17 -04:00
arvidn 3a1379ef1e merged RC_1_1 into master 2017-03-14 12:55:13 -04:00
Arvid Norberg 3f90501934 add support for IPv6 peers from udp trackers (#1802)
add support for IPv6 peers from udp trackers
2017-03-11 02:46:51 -05:00
Alden Torres 1ab1b98138 optimized dht_get_peers_reply_alert storage and created alerts unit test (#1714)
optimized dht_get_peers_reply_alert storage and created alerts unit test
2017-02-18 00:13:46 -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 3d06371f31 factor out some common storage utilities out of storage.cpp (#1515)
factor out some common storage utilities out of storage.cpp
2017-01-11 00:42:10 -05:00
Pavel Pimenov 6afb1f3e83 aux::to_hex(sha1) -> sha1.to_hex() (#1418)
generate hex strings into std::string instead of stack-allocated char arrays
2016-12-22 10:44:36 -05: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
arvidn 20aeed09e1 clean up tests 2016-11-12 17:39:34 -05:00
arvidn 583082a3a0 merged RC_1_1 into master 2016-11-09 19:53:55 -05:00
arvidn 200b3c4965 add rename file test 2016-11-05 15:20:38 -04:00
Steven Siloti f5366bd816 use span for scatter/gather lists (#1260)
use span for gather/scatter buffers. remove explicit size parameter from file_op
2016-10-26 20:40:56 -04:00