Commit Graph

39 Commits

Author SHA1 Message Date
arvidn 4ceb2ea467 limit tracker announces and SOCKS5 connection attempts to listen_socket_t that actually can reach the target 2020-01-19 08:27:33 +01:00
arvidn 3995ffeafd similar to how low RTT DHT nodes are preferred over high RTT nodes, also have an affinity for nodes with node IDs derived from their IP 2019-07-28 16:13:16 -07:00
Steven Siloti aec5c50282 Track the mapped port for each NAT mapping transport (#3793)
* Track the mapped port for each NAT mapping transport
Each transport needs to be tracked separately so that a failed mapping request
doesn't cause the listen port for a socket to be cleared to zero.
* add template specialization to allow enums as indexes
* use aux::array for port mappings
2019-04-22 01:50:44 +02:00
arvidn eab1055938 more warnings on appveyor 2018-11-18 11:49:45 +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
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
Steven Siloti 961cf62cad dht: announce with per-interface listen port 2018-07-12 08:36:57 +02:00
arvidn 55babc57e6 merged RC_1_1 into master 2017-12-15 17:18:27 +01:00
arvidn 9111d5977e make the variables holding the source of external IPs type-safe 2017-10-10 22:38:36 +02:00
Steven Siloti 8648de3706 DHT nodes should only handle requests on their socket (#2355) 2017-09-21 21:00:38 -07: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 8d0f38930e make udp send flags type safe 2017-07-26 18:09:17 -07:00
Steven Siloti 5eba09fce7 changes based on review feedback 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 2e79c5e648 fix handling of SSL listen sockets 2017-07-10 21:41:39 -07:00
Alden Torres 80036f0377 avoid executing timed async task if the dht node is already removed (#2133) 2017-07-08 08:32:24 -07:00
arvidn d138f02424 introduce lt namespace alias 2017-04-23 23:43:58 -04:00
Steven Siloti cdd50be859 create a separate DHT node for each listen socket 2017-04-23 19:49:49 -04:00
Arvid Norberg b74bdfa7db make dht logging deterministic (#1460)
make dht logging deterministic (ues an id instead of this-pointer to identify a traversal algorithm)

try with more DHT nodes
2016-12-27 07:12:57 -08:00
Steven Siloti 6691531ebb fix missing include in dht_rate_limit test
cmath is needed for abs(float)
2016-11-04 08:11:06 -04:00
Alden Torres 8caebbd026 alerts refactor to use span, don't break ABI when logging, fix compilation (#1159)
alerts to use span, don't break ABI when logging, fix compilation
2016-09-27 23:21:18 -04:00
Alden Torres 6c31ea3d44 created dht state and session params refactor (#1100)
created dht state and session params refactor
2016-09-17 09:42:04 -04:00
Alden Torres 0507764d04 consts and refactor, hash_address returns the hash (#1093)
consts and refactor
2016-09-15 21:13:43 -04:00
Alden Torres 4d4eb66c8b some refactor, more const refs and span use (#1078)
some refactor, more const refs and span use
2016-09-11 01:58:48 -04:00
Alden Torres 99da5c8017 dht log optimization, consts and refactor (#1073)
dht log optimization and refactor
2016-09-08 19:13:46 -04:00
Alden Torres bf0008933a refactor to use std::shared_ptr with peer_connection, core and tests (#1050) 2016-08-31 21:42:18 -04:00
Alden Torres f51e782905 using string_view in node::incoming_request and plugin::on_dht_request (#1001)
use string_view in node::incoming_request. changed plugin::on_dht_request to use string_view
2016-08-15 16:17:13 -04:00
arvidn 8c8c3d5587 replace boost::function with std::function 2016-08-13 07:07:26 -04:00
Alden Torres f57612b82d rename of aux::array_view to span (#933) 2016-07-22 09:31:42 -07:00
Arvid Norberg e782783814 modernize use override (#895) 2016-07-09 20:10:38 -04:00
Arvid Norberg 717ed8bd3b Msvc warnings (#822)
fix msvc warnings in python bindings and simulations
2016-06-18 19:24:27 -04:00
Arvid Norberg 223f24ca27 some cleanup and transition to std::unique_ptr (#786)
some cleanup and transition to std::unique_ptr
2016-06-05 14:07:24 -04:00
Alden Torres 7c4d92a627 Share the DHT storage for both IPv4 and IPv6 (#762) 2016-06-03 19:44:16 -04:00
Arvid Norberg 96999ad67f replace uses of boost::bind with std::bind and lambdas (#745) 2016-05-25 00:31:52 -04:00
Arvid Norberg e8380e1d0b factor out includes from config.hpp into the files actually using it. primarily, printf family of functions, since C++11 version is used now. This removes the need for an snprintf-wrapper on windows (#732) 2016-05-17 09:24:06 -04:00
Arvid Norberg 4e97bf556c use override and final keywords (unconditionally) (#668)
use override and final keywords instead of macros.
2016-04-30 11:05:54 -04:00
Steven Siloti 2abd9867ce IPv6 DHT support
Fixes #110
2016-04-24 14:26:57 -07:00
Arvid Norberg 7251575d98 This patch does: (#633)
1. simplifies and regularizies creation of listen sockets based on the listen
   interfaces setting.
2. simplifies and improves the behavior of UDP sockets, which are now explicitly
   opened per listen interface
3. transitions udp tracker, DHT and uTP socket manager over to using the new
   udp sockets
4. greatly simplified udp_socket to only wrap a single underlying socket (as
   opposed to one IPv4 and IPv6 socket)
5. improved behavior of bind-to-device
6. introduce an array_view type to make udp packet passing code simpler
7. simplify and make setting of DF flag more robust
8. simplify and regularize port mapping of listen sockets
2016-04-24 15:26:28 -04:00
arvidn d5203c67d9 add DHT rate limit test (simulation). introduce a new counter for dropped incoming dht messages. 2016-01-18 14:34:42 -05:00