Commit Graph

708 Commits

Author SHA1 Message Date
Arvid Norberg 76c2794923
fix build with boost-1.70 (#3788)
fix build with boost 1.70.0 Fix #3683
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-04-19 20:56:19 +02:00
arvidn 102387f4a8 make all tests run cleanly with leak sanitizer 2019-03-27 17:10:36 +01:00
arvidn 1b2832e018 convert some for-loops into std algorithms 2018-11-27 19:43:01 +01:00
arvidn 3f87801142 fix some cppcheck warnings 2018-11-27 13:53:38 +01:00
arvidn 9ae4aedeb0 deprecate slow bdecode() function 2018-11-19 09:09:55 +01:00
arvidn 8841c58435 improve interoperability between bdecode_node and entry (for encoding). Make it possible to construct an entry from a bdecode_node. move comparison operators out of entry to support implicit conversions from bdecode_node 2018-11-18 22:54:36 +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
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 9d26f4f96c fix asio-debugging build of dht test 2018-11-09 16:39:39 +01:00
arvidn 6be8b395da some cleanup turning memcmp() and memcpy() into span comparisons and std::copy(). some more use of random_bytes() instead of loops. 2018-11-05 18:52:45 +01:00
Amir Abrams 88266edd43 Update comment in put_mutable_item
Trivial update to a comment in put_mutable_item.
2018-10-24 13:13:20 +02: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 10deff2f91 fix some unintentional copies (with explicit moves) 2018-07-01 18:22:32 +02:00
Alden Torres 7621be6df1 fixed signed/unsigned warnings with latest version of Xcode clang (#3032) 2018-05-16 16:06:33 +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
Steven Siloti 96d215a32a only allow pinged nodes into the routing table (#3006)
This is an attempt to prevent bogus nodes entering the routing table and
being propogated to other nodes.
2018-05-08 12:47:29 +02:00
arvidn 52e1a7b6c9 merged RC_1_1 into master 2018-04-15 11:00:57 +02:00
arvidn 9cd0ae67e7 another boost-1.67 build fix 2018-04-13 14:43:41 +02:00
arvidn f0227451a6 merged RC_1_1 into master 2018-04-13 01:47:41 +02:00
Steven Siloti 236e0e7699 pass default constructed boost::function instead of NULL
Clang 6 defines NULL as nullptr which breaks implicit construction
of boost::function from NULL.
2018-04-12 14:32:31 +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
Arvid Norberg 16f1deb3ec merged RC_1_1 into master 2018-04-04 15:28: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
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
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
Alden Torres 5d230a69f2 minor code cleanup 2018-01-30 12:38:08 +01:00
arvidn 65fef972a2 apply some c++11 modernization 2018-01-11 04:51:39 -05: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
arvidn 94dcd8e14b remove unused transaction id member of DHT observers 2017-11-12 15:46:33 +01: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
Alden Torres 7cc2619aad more use of auto and minor code refactor in routing_table.cpp 2017-09-08 08:49:06 +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 7b98af8145 improve type-safety of observer_flags and traversal_flags 2017-08-05 20:20:13 +02:00
arvidn 6b1037eff5 convert enum values that are just used as constants, to actual constants with the correct type 2017-08-04 15:23:20 +02:00
arvidn 8d0f38930e make udp send flags type safe 2017-07-26 18:09:17 -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