Commit Graph

267 Commits

Author SHA1 Message Date
arvidn 3f87801142 fix some cppcheck warnings 2018-11-27 13:53:38 +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 164982c63a pass the dht item object by const reference instead of by value 2018-11-15 00:18:53 +01:00
Arvid Norberg 81356cfce1 add make_tcp() and make_udp() to convert endpoint types 2018-09-19 10:57:28 -07:00
arvidn c9cbb122e2 fix some warnings from sonar-cube 2018-09-05 18:10:57 -07:00
Arvid Norberg b90564d418 remove the IPv6 enable/disable build config 2018-08-19 22:20:54 +02:00
arvidn e92cf18340 fix some warnings around unused variables, dead stores, potentially dereferencing nullptr and calling virtual functions from constructor 2018-07-20 01:03:16 +02:00
arvidn 4633258fbe make the DHT announce flags a strong type 2018-07-16 12:04:16 +02:00
Steven Siloti 961cf62cad dht: announce with per-interface listen port 2018-07-12 08:36:57 +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 f0227451a6 merged RC_1_1 into master 2018-04-13 01:47:41 +02:00
arvidn aaf9304a3b update year in copyright header 2018-04-09 09:04:33 +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
Alden Torres 135e47c929 minimal optimization by using node_id::is_all_zero 2018-03-05 09:01:25 +01:00
Alden Torres 80f5edc500 added some static and const in node.cpp and minor cleanup in rpc_manager.cpp 2018-03-02 11:29:59 +01:00
arvidn 65fef972a2 apply some c++11 modernization 2018-01-11 04:51:39 -05:00
Alden Torres c771f16c5c lint guided refactor in dht source code (#2516) 2017-11-12 00:50:24 +01:00
arvidn f41d2b5d3b move shared_ptr instead of copying them, when constructing DHT observers 2017-11-08 23:09:43 +01:00
pavel.pimenov f3796060d3 add const 2017-09-29 14:06:40 -07:00
Steven Siloti 8648de3706 DHT nodes should only handle requests on their socket (#2355) 2017-09-21 21:00:38 -07:00
arvidn 93bb84d94c some random cleanup 2017-09-13 08:28:46 +02: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 ec2fb91aa5 reject put messages with incorrect bencoding (#2118)
add function to check for soft bdecode errors. reject put messages with incorrect bencoding
2017-07-02 18:30:32 -04:00
pavel.pimenov 7af38ba05a add const and static 2017-06-30 16:07:23 -04:00
pavel.pimenov 92a923134c fix generate_token 2017-06-30 13:22:30 -04:00
Alden Torres 48ef3b6bf7 implemented support for BEP 51 (#1652) 2017-06-12 11:54:11 +02:00
Pavel Pimenov 98a0344196 refactor traversal_algorithm look_for_nodes (#1982) 2017-05-29 12:20:52 -04:00
Steven Siloti cdd50be859 create a separate DHT node for each listen socket 2017-04-23 19:49:49 -04:00
arvidn 480bde9333 change formatting of namespace declarations 2017-04-12 14:26:35 -04:00
arvidn 86786770b7 merged RC_1_1 into master 2017-03-27 01:24:43 -04:00
arvidn 4d397f5ebf fix minor robustness issue in DHT bootstrap logic 2017-03-21 12:29:08 -04:00
Alden Torres 014a07a5c8 allow DHT bootstrap to use nodes of both IP protocols 2017-03-17 20:51:38 -04:00
pavel.pimenov 78442e9a2c bdecode_node - add const 2017-02-27 19:44:12 -05:00
Arvid Norberg 29db3de6c0 wrap most instances of throw, and terminate on builds where exceptions are disabled (#1639)
wrap most instances of throw, and terminate on builds where exceptions are disabled
2017-01-29 15:37:42 -05:00
Alden Torres 070e85090b more std:: prefix, consts, auto refactor, formatting 2017-01-26 08:30:20 -05:00
Alden Torres c33af5a552 added dht_invalid_find_node counter metric 2017-01-18 00:55:32 -05: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
Pavel Pimenov 6afb1f3e83 aux::to_hex(sha1) -> sha1.to_hex() (#1418)
generate hex strings into std::string instead of stack-allocated char arrays
2016-12-22 10:44:36 -05:00
Steven Siloti 916fc92c49 create separate function for reading a node from a list 2016-12-17 02:22:13 -05:00
Alden Torres d5c4cd7280 fixed sign-compare warnings and some refactor (#1354)
fixed sign-compare warnings and some refactor. make sequence_number backed by std::int64_t
2016-11-27 08:46:53 -05:00
Alden Torres 86251adb1b more fixes of integral type conversion warnings 2016-11-21 20:22:18 -05:00
Alden Torres 84e0362180 more fixes in signed compare warnings (#1345)
more fixes in signed compare warnings
2016-11-21 01:49:56 -05:00
Alden Torres 4c7e24ea35 more use of std::make_shared, fixing warnings of over-aligned 2016-11-18 00:28:29 -05:00
Angel Leon 9cdf0ee50c Boolean simplifications (oct 13th 2016) (#1211)
boolean simplifications
2016-10-14 16:13:18 -04:00
Alden Torres 31ce1e5a2c dht headers and minor cleanup (#1157) 2016-09-26 18:04:42 -04:00
Alden Torres 4693fcf3f1 dht source code and headers cleanup (#1150) 2016-09-24 22:20:20 -04:00
Alden Torres c7ec987a1b refactor in msg verify_message and minor cleanup (#1131) 2016-09-21 23:04:05 -07:00
Steven Siloti c75b243490 remove redundant protocol parameter (#1128) 2016-09-21 20:00:39 -07:00
Steven Siloti dad0000015 send write token if peer is alraedy stored 2016-09-20 19:35:24 -07:00
Steven Siloti 6e24bbe77a only send a write token if we have storage space available 2016-09-19 21:51:10 -07:00