Commit Graph

1497 Commits

Author SHA1 Message Date
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
arvidn ba731ef0cf make sure session cleanup releases all its references to torrents 2019-04-22 22:31:51 +02: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
Arvid Norberg 3a4a7b742a deduplicate code implementing log2p1() 2019-03-23 22:44:32 +01:00
Arvid Norberg 57e56d5070 factor out logic around adding torrents to the session into insert_torrent() 2019-03-03 12:56:24 +01:00
arvidn a2196a4194 fix warning in session_impl 2019-02-12 00:58:40 +01:00
Alden Torres 3e582100d0 removed repeated code and minor code refactor 2018-12-05 09:13:54 +01:00
arvidn 507fffe872 move where socket buffers are set up, to happen after the socket is opened. log errors in the peer's log instead of session and torrent 2018-12-02 04:03:03 +01:00
arvidn 7a51813d32 improve peer debug logging 2018-12-02 04:03:03 +01:00
arvidn 35ec87af4f add stats counter for the number of outstanding async_accept calls 2018-11-30 02:15:45 +01:00
Steven Siloti cc49a7fb15 fix assertion when sending a udp packet to a closed socket
This can happen particularly during shutdown. We should eventually get to a
point where this doesn't happen, but since we close the sockets immediately
upon initiating shutdown it's hard to avoid for now.
2018-11-30 02:15:22 +01:00
arvidn 1b2832e018 convert some for-loops into std algorithms 2018-11-27 19:43:01 +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 5929ad4cae merge RC_1_1 into master (again) 2018-11-15 22:55:52 +01:00
arvidn 29cddaa23e merged RC_1_1 into master 2018-11-15 15:19:24 +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 13dd7cfe1e a better fix to the ssl port announce bug 2018-11-14 07:36:22 +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 d0e146eb75 merged RC_1_1 into master 2018-11-01 09:48:41 +01:00
Arvid Norberg e1eb12e60f ssl listen port fix and improved tracker announce logging 2018-10-29 18:38:14 +01:00
pavel.pimenov b00ce69d58 remove params.url.clear(); 2018-10-25 09:49:38 +02:00
arvidn 3fb05d77d8 fix warnings 2018-10-20 20:56:26 +02:00
Arvid Norberg d2f19a2d73 merged RC_1_1 into master 2018-10-01 16:34:21 +02:00
Arvid Norberg 81356cfce1 add make_tcp() and make_udp() to convert endpoint types 2018-09-19 10:57:28 -07:00
arvidn c9043dec53 force proxy no longer disables the DHT 2018-08-20 08:24:31 +02:00
Alden Torres 28c94b54ed minor code refactor for more use of const and emplace 2018-08-20 08:06:37 +02:00
Arvid Norberg b90564d418 remove the IPv6 enable/disable build config 2018-08-19 22:20:54 +02:00
Arvid Norberg fef1b947f3 fix issue in self-connection detection introduced with the change to generate unique peer-ids for each connection. Now, the torrent keeps track of all of our peer-ids generated for outgoing (bittorrent) connections, and we check them against incoming peers' peer-ids 2018-08-19 22:19:53 +02:00
arvidn b3dbce5790 merge RC_1_1 into master 2018-08-13 09:32:17 +02:00
arvidn 6d2541f131 improve connect-boost feature, to make new torrents quickly connect peers 2018-08-09 20:12:56 +02: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 4282dd072a factor out generate_peer_id into its own file 2018-07-25 08:49:18 +02:00
arvidn 730ef15b08 minor cleanups 2018-07-24 16:34:46 +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 f4b0dbf115 merged RC_1_1 into master 2018-07-20 09:28:21 +02:00
arvidn 1ebc5f9ef2 remove special handling of uTP peers 2018-07-20 07:47:08 +02:00
Alden Torres d9d387d711 minor code cleanup, more use of const (#3174)
* minor code cleanup, more use of const, using u literal per lint

* revert use of unsigned literal

* reverted loop change
2018-07-16 18:23:38 +02:00
arvidn 4aa3c4573a use the strong type for pause flags 2018-07-16 12:06:21 +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 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 f6720e31ed don't re-map all listen sockets when changing listen_interfaces
New sockets will be mapped regardless of the remap parameter. Requesting
full re-mapping just creates unecessary network traffic.
2018-06-07 18:16:08 -07:00
Steven Siloti 78be52112f create a natpmp instance for each listen socket 2018-06-07 18:16:08 -07:00
Alden Torres 6c4869f044 moved instantiate_connection to aux namespace 2018-05-29 09:25:25 +02:00