Commit Graph

1488 Commits

Author SHA1 Message Date
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 a7406de2b8 remove the global cache of the current time, just use clock::now() instead 2018-04-07 21:43:18 +02:00
Alden Torres 0d9862a8dd fix wrong variable name 2018-04-04 19:41:03 +02:00
Arvid Norberg 16f1deb3ec merged RC_1_1 into master 2018-04-04 15:28:33 +02:00
arvidn 98d5313598 don't perform DNS lookups for the DHT bootstrap unless DHT is enabled 2018-04-01 23:53:12 +02:00
Alden Torres 5b922072e9 avoid calls to .address() when looking for endpoint protocol (#2892)
using is_v4 and is_v6 where possible
2018-04-01 13:48:17 +02:00
arvidn 6a2df1034a add some asserts and checks preventing IPv6 addresses to make it into libtorrent when IPv6 support is disabled 2018-03-31 14:17:06 +02:00
arvidn 9696082355 merged RC_1_1 into master 2018-02-25 09:36:12 +01:00
arvidn 1ede34da8a undo the patch to restore incoming TCP connections over SOCKS5 2018-02-19 00:01:42 +01:00
arvidn a0a63341c7 fix haiku build 2018-02-04 19:10:43 +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 785fffd976 make url_random take a span 2018-01-15 01:49:42 -05:00
arvidn a67eb2f059 fix tracker connection bind issue for IPv6 trackers 2018-01-14 06:47:13 -05: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 88643dd121 fix m_in_constructor assert for peer_connection (if the peer connection is constructed, but bt_peer_connection constructor fails, it needs to be cleared). Fix an invariant in session on ungraceful shutdown. Make test framework a bit more robust 2018-01-06 14:29:20 -05:00
Alden Torres 98ade28237 using make_address instead of deprecated from_string when boost>=1.66 (#2659)
using make_address instead of deprecated from_string when boost>=1.66
2018-01-04 04:48:22 -05:00
arvidn 0731200149 block_size is a constant, no need in passing it around as a variable 2018-01-03 08:45:25 -05:00
arvidn aae12250ae support forced shutdown/destruction of torrent objects 2017-12-28 14:11:55 +01:00
arvidn 5f0c9a0c1d improve error handling during session shutdown 2017-12-28 13:52:07 +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 5ebd05b047 handle serious errors in on_accept_connection handler 2017-12-27 21:23:25 +01:00
arvidn ab9fcdf029 reserve space in torrent lists up-front, to make transitioning list membership unable to fail 2017-12-27 15:42:46 +01:00
arvidn 40292a1d51 don't heap-allocate handlers for incoming UDP packets 2017-12-24 11:22:30 +01:00
arvidn 753826cbb8 merger RC_1_1 into master 2017-12-23 18:15:01 +01:00
arvidn 62bf524e75 disable DHT logging with the TORRENT_DISABLE_LOGGING macros as well 2017-12-23 12:01:18 +01:00
sledgehammer_999 94f4e88e05 Fix local network address mappings. 2017-12-20 11:28:36 +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
arvidn 96bf0ad5de fix reopening of listen sockets when disabling force-proxy 2017-12-17 08:25:51 +01:00
arvidn 55babc57e6 merged RC_1_1 into master 2017-12-15 17:18:27 +01:00
arvidn d1a63cd781 fix build against boost-1.66, specifically the boost.asio changes 2017-12-15 11:29:53 +01:00
Steven Siloti 9e0a3aead1 use info hash from params instead of passing it separately 2017-12-14 10:18:33 +01:00
arvidn 7b06a5ee6e merged RC_1_1 into master 2017-12-13 12:36:35 +01:00
arvidn fe6473039c fix rate limit utp feature 2017-12-11 08:40:35 -05:00
arvidn c16eb32b94 merge RC_1_1 into master 2017-12-03 18:12:35 +01:00
arvidn c745d3f00d fix incorrect use of make_tick_handler 2017-12-02 12:20:36 +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
arvidn a57ad00e15 fix force-proxy regression (udp sockets would not be opened) 2017-11-21 08:54:16 +01:00
arvidn 22f8bdfebc merge RC_1_1 into master 2017-11-21 00:50:02 +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 096ce54fae fix issue where new listen sockets would not be opened when leaving force_proxy mode 2017-11-14 12:38:22 +01:00
arvidn d00451994b stop posting alerts when the session is shutting down. Nobody will be able to see them anyway. It also solves some issues around destruction order where posting alerts require certain things to still be around in the session_impl object 2017-11-12 09:12:59 +01:00
arvidn b88c193742 fix sign conversion warning in peer_class_type_filter 2017-11-11 09:17:37 +01:00
arvidn 1ed68551d7 merged RC_1_1 into master 2017-11-10 01:37:35 +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
Steven Siloti dc612b6423 keep updating aux::time_now() while there are announces
This fixes an infinite loop when an announce during shutown fails and
aux::time_now() has fallen behind clock_type::now() by more than the
delay calculated in announce_entry::failed(). If this happens,
announce_entry::can_announce() can forever return true when called from
torrent::announce_with_tracker() because that function uses
clock_type::now().

Also change torrent::announce_with_tracker() to use aux::time_now() just
for consistency with the reset of the announce related functions.
2017-10-26 23:42: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 7216b69188 revert early return in session_impl::on_port_mapping and only check for error if cast_vote (#2468) 2017-10-24 09:54:57 +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
arvidn bb65acb082 make feature_flags proper type-safe 2017-10-14 23:33:48 +02:00
arvidn 9111d5977e make the variables holding the source of external IPs type-safe 2017-10-10 22:38:36 +02:00
arvidn 4e1c5738a2 back-port openssl API compat patch from master 2017-10-07 01:10:41 +02:00
Alden Torres 7f3c38025f making use of openssl API 1.1 compatible 2017-10-06 11:03:16 +02:00
arvidn 69dc73914a merged RC_1_1 into master 2017-10-04 11:43:01 +02:00
arvidn 99b19366a9 fix leak of peer_class objects (when setting per-torrent rate limits) 2017-10-03 17:32:49 +02:00
pavel.pimenov f3796060d3 add const 2017-09-29 14:06:40 -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
arvidn ccbd6cbcfe remove rss_reader.py, since rss has been reprecated. fix python binding for torrent_handle, to be hashable. update client_test.py to not use deprecated APIs and follow best (libtorrent) practice 2017-09-11 22:28:57 +02:00
Steven Siloti df8a57efb7 select which DHT port to report based on the connection's local endpoint (#2316) 2017-09-10 10:25:04 +02:00
arvidn bb51dcdbb9 move dht_settings into its own header cpp file-pair and dht_settings into the dht namespace 2017-09-04 22:38:16 +02:00
arvidn fe1c395579 merged RC_1_1 into master 2017-09-03 13:57:19 +02:00
arvidn 7087a16b36 move some initialization of torrent from start() into the constructor 2017-09-02 21:24:00 +02:00
arvidn 11f008e90e use a strong typedef for port mapping id 2017-09-02 07:02:07 +02:00
Alden Torres ac914d4415 avoid port mapping of local addresses (#2296) 2017-09-01 19:28:27 +02:00
Arvid Norberg f734ad067b straighten out some type-safety in port mapping enums (#2285) 2017-08-30 20:47:49 +02:00
Alden Torres fe09ca9b97 more use of auto, const and minor cleanup in session_impl.cpp 2017-08-30 20:30:06 +02:00
Arvid Norberg 1075ae3b8d remove session pool allocator and use the buffer class instead (#2274)
simplify append_buffer by using size() to determine size of the buffer. make the move explicit in chained_buffer::init_buffer_entry
2017-08-28 11:37:53 +02:00
arvidn 1ce4089229 log failures to parse interface and node lists from settings 2017-08-24 07:59:22 +02:00
arvidn e92cbf502c remove the last use of session_impl get_ipv6_interface and get_ipv4_interface 2017-08-23 21:01:15 +02:00
arvidn f311bf354e remove left-overs from disk buffer pool allocator 2017-08-21 16:36:00 +02:00
Steven Siloti 2365611507 remove support for using a pool allocator for disk buffers (#2257) 2017-08-19 11:04:39 +02:00
Alden Torres bde4718e3f typos, auto loop refactor and more std:: 2017-08-16 07:01:50 +02:00
arvidn 6fa181ece8 some cleanup of type-safe flags 2017-07-30 18:20:15 -07:00
arvidn 322007bb6a make save_state_flags a strong type 2017-07-30 09:06:41 -07:00
arvidn 24e4263bae make torrent status flags be type safe 2017-07-27 09:33:35 -07:00
arvidn 8d0f38930e make udp send flags type safe 2017-07-26 18:09:17 -07:00
arvidn 83ca755d1b simplify setup_listener 2017-07-26 12:02:58 -07:00
arvidn b38efb6c65 make alert category flags be a strong type 2017-07-26 07:20:47 -07:00
Steven Siloti 5eba09fce7 changes based on review feedback 2017-07-21 19:18:44 -07:00
Steven Siloti 1a64490ef0 fix 2017-07-21 19:18:44 -07:00
Steven Siloti f0ae2145ea use a handle class for listen sockets instead of raw pointers
Listen socket handles need to be week_ptr so that they can detect when a listen
socket is removed in the middle of a tracker announce on it. Use a wrapper class
to enforce that no one outside of session_impl can hold ownership of the socket
across event boundaries.

To support unit tests, listen_socket_t is also split into a base class which
holds the members needed to support the public listen socket API.
2017-07-21 19:18:44 -07:00
Steven Siloti e0dcd34352 convert m_listen_sockets to a vector of shared_ptr 2017-07-21 19:18:43 -07:00
Steven Siloti 0f30815d8f Revert "don't move listen_socket_t when deleting sockets"
This reverts commit 718c5f0dcb.
2017-07-21 19:18:43 -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
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
Steven Siloti 389b4eb3f2 make listen_socket_t non-copyable and non-movable (#2137)
The DHT stores a pointer to this struct so it must not be copied or moved once
it is stored in m_listen_sockets.
2017-07-10 10:14:36 -07:00
Steven Siloti 718c5f0dcb don't move listen_socket_t when deleting sockets
Pointers to listen_socket_t are stored in dht_tracker, so they
cannot be copied or moved once they are added to m_listen_sockets.

listen_socket_t should really be made non-copyable and non-moveable, but the
socket creation path needs to be refactored before that can be done.
2017-07-08 08:42:04 -07:00
arvidn 35491bc476 convert remaining alerts to use operation_t instead of string literal 2017-06-18 22:05:50 -04:00
arvidn ff454a92d4 unify some operation-enums and strings to use operation_t 2017-06-18 07:31:45 -04:00