Commit Graph

1520 Commits

Author SHA1 Message Date
arvidn f5ebd4e354 simplify natpmp by requiring it to be tied to a specific network, and use get_gateway() and remove unused get_default_route() functions 2020-01-20 01:24:22 +01:00
arvidn a53d3a8746 factor out get_gateway function and add unit tests. IPv6 gateways are not addressed in the same network, so we can't use match_addr_mask(). Assume all local IPv6 addresses do not have a gateway 2020-01-19 08:27:33 +01:00
arvidn a1d78aa60e only start natpmp on listen sockets that have a router (since NATPMP needs one) 2020-01-19 08:27:33 +01:00
arvidn 88d9c05e3c expand IPv4 in expand_unspecified_address 2020-01-19 08:27:33 +01:00
arvidn 0961427b50 expand unspecified to loopback as well 2020-01-19 08:27:33 +01:00
arvidn 8be7ab559a remove outgoing udp sockets and replace with listen_socket_t 2020-01-19 08:27:33 +01:00
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 82d4d1927d restrict DHT nodes to the network they are associated with (multi-homed) 2020-01-17 00:01:10 +01:00
arvidn df85b31490 deprecate and remvoe broadcast_lsd setting 2020-01-16 16:02:00 +01:00
arvidn fa79697f45 deprecate (and remove) upnp_ignore_nonrouters setting 2020-01-16 10:35:50 +01:00
arvidn bd43c9b83f remove unused overload of set_external_address 2020-01-15 19:53:52 +01:00
arvidn e18366bb6b make sure &key= stays consistent between different source IPs (as mandated by BEP7) 2020-01-11 11:37:54 +01:00
arvidn 2e15b3edfa use span in expand_unspecified_address 2020-01-08 10:24:54 +01:00
arvidn f508a433a4 fix binding of outgoing interface, when configured 2020-01-08 10:21:41 +01:00
arvidn af3d084092 convert the duplex enum into a flags field, on listen_socket_t and listen_endpoint 2020-01-06 20:22:55 +01:00
Arvid Norberg 0675bd263f add new socks5_alert to trouble shoot SOCKS5 proxies 2019-12-28 17:57:44 +01:00
arvidn 69d85ed110 replace use of deprecated shared_ptr<>::unique with shared_ptr<>::use_count 2019-12-12 19:40:39 +01:00
arvidn 59a29a44e2 promote errors in parsing listen_interfaces to post listen_failed_alert 2019-12-09 06:54:31 +01:00
arvidn 0c2d3a0dac optimize setting with unlimited unchoke slots 2019-11-26 20:54:52 +01:00
Steven Siloti b26629885b fix storing udp port mappings in listen_socket_t 2019-10-23 15:50:37 +02:00
arvidn 7878f68370 add some missing documentation. undeprecate error_file_metadata ahead of master undeprecating it 2019-09-08 10:51:46 +02:00
arvidn a3440e54bb make aux::session_settings thread-safe. this allows all threads to share the same settings object, which has low contention and is rarely updated 2019-09-01 03:41:36 +02:00
Arvid Norberg bfe0e1f27d hide some internal functions. error if namespaces are preceded by whitespace (as the docs generation script requires them to start at the beginning of the line) 2019-08-07 20:48:26 -07: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
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