Commit Graph

868 Commits

Author SHA1 Message Date
arvidn 08bceec4c7 fix typo in win_crypto_provider assignment operator 2019-01-20 02:07:54 +01:00
Alden Torres bcda184e59 [WIP] refactor in file_progress to avoid dependency of alert_manager 2019-01-13 02:40:15 +01:00
arvidn f4f1425115 use UNC paths pervasively on windows 2019-01-12 21:00:40 +01:00
arvidn 12cbcfd380 make settings_pack enums specify a narrower underlying type and remove deprecated, internal enums 2018-11-24 16:47:41 +01:00
arvidn 50ae1838e6 wrap inclusion of windows.h with appropriate defines 2018-11-21 10:09:23 +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 6d886f29a9 support moving the whole add_torrent_params object into the add_torrent call on session 2018-11-14 19:11:11 +01:00
arvidn 0c76a3a0c5 require tracker_request objects be moved into queue_manager. also replace non-const reference parameter with rvalue reference 2018-11-14 17:09:04 +01:00
arvidn 4d88c83576 add rvalue reference overloads for add_torrent_params, settings_pack and session_params. Those structures are pretty large so being able to take them by rvalue reference may be beneficial 2018-11-13 08:05:56 +01:00
arvidn 9d26f4f96c fix asio-debugging build of dht test 2018-11-09 16:39:39 +01:00
arvidn e2f8bce539 add tests for low level I/O functions, read_* and write_*. also turn some raw for loops into range-for loops in the I/O functions 2018-11-07 14:35:30 +01:00
arvidn 1f9e74f40d merged RC_1_1 into master 2018-11-06 23:57:04 +01:00
arvidn 3988be348f simplify SFINAE on write_impl to just use enable_if 2018-11-03 11:57:16 +01:00
Arvid Norberg ede7dbf0aa add LGTM badge to README and fix warnings 2018-10-19 16:28:33 +02:00
Arvid Norberg 1a27ff7107 parse_magnet_uri simplification 2018-10-05 11:01:45 +02:00
Arvid Norberg a4267d61e7 fix overflow in sliding_average in the case of very high download rates 2018-10-03 00:53:05 +02:00
Arvid Norberg 6724c1eec0 fix some warnings 2018-09-19 22:12:45 -07:00
arvidn c9cbb122e2 fix some warnings from sonar-cube 2018-09-05 18:10:57 -07:00
arvidn 7be9547817 add a few more stats counters measuring outgoing connection attempts. simplify session_stats_header_alert by posting it on first call to post_session_stats() instead of making it gated by the alert_mask 2018-08-09 20:10:35 +02:00
Steven Siloti 92f1937b97 fix typo in #if tests for TORRENT_DISABLE_ENCRYPTION 2018-07-29 09:04:16 +02:00
Arvid Norberg b3856d3027 narrow the scope affected by TORRENT_DISABLE_EXTENSIONS to only disable the user extensions, but always support the extension message and the built-in extensions, like lt_donthave and seed_mode 2018-07-26 09:31:49 +02:00
Arvid Norberg 8f0cf7e1a9 some refactor to reduce duplicate code 2018-07-25 18:48:34 +02:00
Arvid Norberg 4282dd072a factor out generate_peer_id into its own file 2018-07-25 08:49:18 +02:00
Arvid Norberg dcb8b816a3 only post alerts for newly opened listen sockets, and only attempt to map ports for newly opened sockets. track has_incoming_connections per listen socket 2018-07-23 15:04:23 +02:00
arvidn 4633258fbe make the DHT announce flags a strong type 2018-07-16 12:04:16 +02:00
Steven Siloti e5be30157f set port in handshake based on source address (#3172) 2018-07-15 21:15:04 +02:00
Steven Siloti 961cf62cad dht: announce with per-interface listen port 2018-07-12 08:36:57 +02:00
arvidn b750b6cc2c deprecate (and disable) the force-proxy setting. Instead, always use the proxy when set, never fall back on circumventing it 2018-07-08 18:26:47 +02:00
Alden Torres 6d2f804d9f code refactor related to the use of index_range and end index 2018-07-08 17:32:30 +02:00
arvidn efe3036879 clean up proxy_settings constructors 2018-07-07 18:02:43 +02:00
arvidn d439c8729a qualify some assignment operators to disallow assignment to temporaries 2018-07-01 17:29:50 +02:00
Alden Torres 2c5da2778a more lint oriented code refactor/cleanup 2018-06-29 13:27:29 +02:00
Steven Siloti fbaa1afd62 return a vector of mapping ids from add_port_mapping 2018-06-07 18:18:31 -07:00
Steven Siloti 78be52112f create a natpmp instance for each listen socket 2018-06-07 18:16:08 -07:00
arvidn 95cfc16bca fix integer overflow in alert_manager 2018-06-02 15:16:08 +02:00
Alden Torres 6c4869f044 moved instantiate_connection to aux namespace 2018-05-29 09:25:25 +02:00
Arvid Norberg ccdfd7383e move export.hpp into aux_ folder. put assert symbols in libtorrent namespace 2018-05-14 09:09:01 +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
arvidn ddd1168296 don't attempt to make uTP connections if we don't have any outgoing UDP sockets 2018-05-12 13:34:58 +02:00
arvidn 4d17e0132e fix empty outgoing interfaces for UDP sockets 2018-05-12 13:34:58 +02:00
Steven Siloti 8fdba2aa39 don't specialize standard type trait is_integral
Concerning type traits, the C++ standard states: "The behavior of a program
that adds specializations for any of the templates defined in this subclause is
undefined unless otherwise specified."

There is no exception for is_integral.
2018-05-10 19:06:18 +02:00
arvidn 8808eb7cdd introduce a recursive mutex to protect the alert_manager, and hold the mutex while calling user callbacks and plugin hooks. This is required to ensure the underlying storage for alert allocations (in the stack allocators) is synchronized with the thread that may be accessing it 2018-05-01 23:17:51 +02:00
Xiyue Deng 21d8e9e26b Add missing header <cstdarg> for va_list.
* Fix building on OpenBSD.
2018-04-24 23:09:25 -04:00
arvidn f0227451a6 merged RC_1_1 into master 2018-04-13 01:47:41 +02:00
arvidn a7406de2b8 remove the global cache of the current time, just use clock::now() instead 2018-04-07 21:43:18 +02:00
Alden Torres d6edf26e11 minor code tidy 2018-04-07 00:30:36 +02:00
Alden Torres 1f06a6684c avoid calling address to test protocol, more consts and minor lint oriented code changes 2018-03-29 12:20:59 +02:00
Alden Torres f963f2c726 minor lint oriented code refactor 2018-03-28 15:55:05 +02:00
arvidn 5413eae900 declare tag types in-line 2018-03-23 11:21:08 +01:00
arvidn 9696082355 merged RC_1_1 into master 2018-02-25 09:36:12 +01:00
arvidn 53b4725da3 clean up noexcept specifiers to adapt to what the implementation provides 2018-02-20 08:43:52 +01:00
arvidn 1ede34da8a undo the patch to restore incoming TCP connections over SOCKS5 2018-02-19 00:01:42 +01:00
Alden Torres fedee2b5fa more headers code cleanup and some lint oriented refactor 2018-02-13 00:46:13 +01:00
arvidn e126d7bce0 move socket_type into aux-namespace 2018-01-29 08:33:45 +01:00
arvidn a33c81ad33 shave down session_interface by one function, reduce the dependencies between torrent and session 2018-01-29 03:00:59 +01:00
arvidn 308cbfe097 merged RC_1_1 into master 2018-01-27 02:36:55 +01:00
arvidn bc4d53c71f restore support for incoming connections over SOCKS5 (disabled by default) 2018-01-25 09:14:14 +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
arvidn 89c6f0b4a8 merged RC_1_1 into master 2018-01-21 15:51:22 +01:00
arvidn 0ee6b7d142 build for iOS on travis 2018-01-18 22:37:37 +01:00
arvidn 65fef972a2 apply some c++11 modernization 2018-01-11 04:51:39 -05:00
arvidn 3a9861e237 complete the error handling test and make it part of the default simulation test suite. It will run a file transfer between two clients repeatedly, each time cause another memory allocation fail, until every single memory allocation has failed once. Any invariant check failure, assertion or signal will cause the test to fail 2018-01-08 04:44:52 -05:00
arvidn fac9931eb6 fix noexcept marking on entry, and make move assignment 2018-01-04 19:34:42 -05:00
arvidn 5f0c9a0c1d improve error handling during session shutdown 2017-12-28 13:52:07 +01:00
arvidn c3bdc6f825 use an intrusive linked list for peer_cache_entry instead an unordered set, to avoid heap allocations and make cache operations not able to fail. This simplifies error handling 2017-12-28 00:52:09 +01:00
arvidn c1abafc0cc reserve space in the undead peers list up-front, to not have to allocate memory when disconnecting 2017-12-27 21:24:16 +01:00
arvidn 347555ea8f handle errors in peer_connection 2017-12-26 10:39:54 +01:00
arvidn 56ca5fa63c support asio handler allocators in deferred_handler 2017-12-26 09:44:51 +01:00
arvidn 40292a1d51 don't heap-allocate handlers for incoming UDP packets 2017-12-24 11:22:30 +01:00
arvidn 62bf524e75 disable DHT logging with the TORRENT_DISABLE_LOGGING macros as well 2017-12-23 12:01:18 +01:00
arvidn a54f76d5df deprecate status_code from tracker_error_alert (it's already part of the error_code), simplify code a bit 2017-12-19 00:55:51 +01:00
Alden Torres db61d9cc20 minor cleanup, refactor and typos (#2593) 2017-12-07 07:51:55 +01:00
arvidn c16eb32b94 merge RC_1_1 into master 2017-12-03 18:12:35 +01:00
arvidn 4b467f82ac fix issue with initializing settings on session construction 2017-12-02 12:20:36 +01:00
arvidn a6656aeb93 generate random keys for use in tracker announces. keys are unique for each torrent and the listen interface they announce via 2017-11-29 00:10:35 +01:00
arvidn 5e7666526e fix IPv6 tracker announce issue 2017-11-23 10:11:59 +01:00
Arvid Norberg c734f42ac3
make tracker announces happen even if there are no open listen sockets (#2529)
support announcing to IPv6 trackers and running an IPv6 DHT when not listening for incoming connections
2017-11-20 23:42:22 +01:00
arvidn 237856f7f1 more fixes of unwanted macro expansions of min/max in headers (windows.h compatibility) 2017-11-13 15:36:42 +01:00
arvidn 0378ae47f4 fix some macro expansions of 'max' in headers, to improve compatibility with windows.h 2017-11-12 23:01:47 +01:00
arvidn b6a73eeaaa simplify trigger_unchoke and trigger_optimistic_unchoke on session_impl, abd make them noexcept 2017-11-12 15:48:46 +01:00
arvidn 254f813626 factor out handler allocator and reuse it for posting deferred peer removals on torrents 2017-11-11 10:41:39 +01:00
arvidn fc74c032f0 minor cleanup and modernization of torrent_peer 2017-11-09 15:48:27 +01: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 f57b90b500 introduce type for torrent queue_position 2017-11-01 10:52:45 +01:00
Alden Torres 5480c08184 enable/disable the internal ip notifier with new setting (#2487) 2017-11-01 10:51:51 +01:00
Alden Torres f040d6d860 added reopen_network_sockets method to allow manual reopen of listen/outgoing sockets (#2476) 2017-10-28 12:15:35 +02:00
arvidn 9e69bf3618 introduce a type to refer to a torrent-list-index, to improve type safety 2017-10-25 13:39:37 +02:00
Alden Torres 6409cb42e1 fix implicit-fallthrough warnings with gcc 7 2017-10-23 19:18:33 +02:00
Alden Torres bb409c5ee9 missing return if error in session_impl::on_port_mapping, doc typo (#2459) 2017-10-23 12:36:51 +02:00
Alden Torres 762ae9aec4 pick standard std::aligned_union if using clang (#2447) 2017-10-15 04:29:33 +02:00
arvidn 9111d5977e make the variables holding the source of external IPs type-safe 2017-10-10 22:38:36 +02: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 1d15e6bfb4 merge RC_1_1 into master 2017-10-08 18:21:25 +02:00
arvidn cdd9f91999 fix leak of torrent_peer objecs (entries in peer_list) 2017-10-07 11:43:42 +02:00
arvidn c66f4cc62a fix some warnings, mostly 0 -> nullptr 2017-09-28 07:33:10 -07:00
arvidn edad33d270 fix const correctness in get_peer_class 2017-09-24 14:49:55 -07:00
Steven Siloti 8648de3706 DHT nodes should only handle requests on their socket (#2355) 2017-09-21 21:00:38 -07:00