Commit Graph

58 Commits

Author SHA1 Message Date
arvidn e8543ecf54 remove empty statements and fix integral promotion warning 2019-08-20 14:36:03 +02:00
arvidn 20cb26fcc1 remove duplicate copy of escape_string 2019-03-23 20:30:40 +01:00
Alden Torres f23daa8262 marked final error category classes, avoid -Wnon-virtual-dtor 2019-01-20 00:38:25 +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 a0fa0b14bb merged RC_1_1 into master 2018-11-04 19:12:22 +01:00
Arvid Norberg 939b380fda fix build against boost-1.69 2018-11-02 11:10:26 +01: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
arvidn 53b4725da3 clean up noexcept specifiers to adapt to what the implementation provides 2018-02-20 08:43:52 +01:00
arvidn 65fef972a2 apply some c++11 modernization 2018-01-11 04:51:39 -05:00
Alden Torres 7fe75dd1eb trivial code refactor in entry and string_util related code 2017-11-29 20:08:15 +01:00
arvidn d4864b8b18 some noexcept fixes 2017-11-10 09:05:15 +01:00
arvidn 8af89da689 fix GCC-4.9 build 2017-10-13 10:08:51 +02:00
arvidn 93bb84d94c some random cleanup 2017-09-13 08:28:46 +02:00
arvidn 05b5b4ef4d merged RC_1_1 into master 2017-08-16 22:46:47 +02:00
arvidn fcb9c7b6f3 fix invalid read in parse_int() in bdecode_node() and lazy_bdecode() 2017-08-15 00:01:37 +02: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
arvidn 20c1407612 corrected missing const qualifiers on bdecode_node 2017-06-30 08:19:10 -04:00
arvidn 2b91b1070d merged RC_1_1 into master 2017-06-24 12:37:13 -04:00
Steven Siloti ec30a5e9ec fix out-of-bounds read in bdecode
Fixes #2099
2017-06-24 10:52:49 -04:00
arvidn 6967d17a42 make move constructors and move assignment operators noexcept 2017-06-01 23:42:15 +02:00
pavel.pimenov 781a35a210 use operator+=(char) 2017-06-01 16:21:27 +02:00
arvidn 23ba9d12d1 construct and destruct objects in stack allocations (alloca()) 2017-04-28 21:34:31 -04:00
arvidn 480bde9333 change formatting of namespace declarations 2017-04-12 14:26:35 -04:00
Arvid Norberg b8e77444d5 use span for read_resume_data() (#1867)
use span for read_resume_data()
2017-03-29 16:10:32 -04:00
Andrei Kurushin 8cd0bb6eb3 optimize bdecode_node offset calculation (#1767)
optimize bdecode_node offset calculation
2017-03-05 10:45:27 -05:00
pavel.pimenov 78442e9a2c bdecode_node - add const 2017-02-27 19:44:12 -05:00
Alden Torres 2437b3c134 created aux::typed_span and related refactor 2017-01-28 23:28:38 -05:00
Alden Torres 3803661863 moved alloca.hpp to private aux_ and size refactor (#1634)
moved alloca.hpp to private aux_ and size refactor
2017-01-27 12:43:34 -05:00
Alden Torres 2bc7a60f33 fixing sign-conversion warnings, part 8, created aux::unique_ptr, refactor (#1616)
fixing sign-conversion warnings, part 8, created aux::unique_ptr, refactor
2017-01-26 08:31:20 -05:00
Alden Torres 4ddd4b72c6 fixing sign-conversion warnings, part 7 (#1604)
fixing sign-conversion warnings, part 7
2017-01-24 01:35:17 -05:00
Alden Torres f382936d56 headers, end of file, code cleanup 2016-12-12 23:36:45 -05:00
Alden Torres a05f0ba8a4 refactor for more modern struct initialization and use of api 2016-12-12 02:15:27 -05:00
Alden Torres 3a92908f39 formatting, added std:: and spaces 2016-12-10 23:11:43 -05:00
Alden Torres 37cbdc5b37 fixing shorten-64-to-32 warnings, part 1 2016-12-05 00:22:17 -05:00
Alden Torres 86251adb1b more fixes of integral type conversion warnings 2016-11-21 20:22:18 -05:00
Steven Siloti a6e5ba8804 return a span from TORRENT_ALLOCA (#1244)
return a span from TORRENT_ALLOCA

Unfortunately this requires moving the variable declaration inside the macro.
Due to alloca’s unique properties pretty much the only safe way to call it is
in a simple assign-to-pointer expression. Therefor we need to use a temporary
pointer to store the value returned from alloca before we can call span’s ctor.

This also causes double evaluation of the size parameter which is unfortunate,
but no current callers of TORRENT_ALLOCA have a problem with this. Passing
expressions with side effects to macros is bad mojo anyways.
2016-10-22 14:43:40 -04:00
Arvid Norberg 7a52a285a1 back-port error_code cleanup from master (#1173)
back-port error_code cleanup from master
2016-10-03 16:32:40 -07:00
Arvid Norberg cebd976cc2 fix error_code vs. error_condition traits (#1169)
fix error_code vs. error_condition traits. deprecate get_*_category(), instead use *_category()
2016-10-02 12:27:50 -07:00
Arvid Norberg e36e5efaba use boost::string_ref (#996)
use boost::string_ref/boost::string_view in various parts of the code, in file_storage, some file functions and in bdecode.
2016-08-13 07:04:53 -04:00
arvidn 231dffd392 fix whitespace 2016-08-08 18:16:05 -04:00
Arvid Norberg 9c2325ff6b modernize and improve type-safety of the DHT put implementation and test (#929)
modernize and improve type-safety of the DHT put implementation and tests. use unique_ptr instead of malloc for dht put items.
2016-07-23 15:57:04 -07:00
Arvid Norberg 8c03718117 apply modernization transforms to headers too. nullptr, explicit constructors, = default (#903) 2016-07-10 14:27:42 -04:00
Arvid Norberg e782783814 modernize use override (#895) 2016-07-09 20:10:38 -04:00
Arvid Norberg 770935cd46 modernize-use-nullptr (#894) 2016-07-09 16:26:26 -04:00
Arvid Norberg 6aabe3762b general modernization (#836)
general modernization. use nullptr instead of NULL, use std::tuple instead of boost::tuple, transition some unordered set/map from boost to std. some clean-up of includes
2016-06-20 11:32:06 -04:00
Alden Torres 38f4765ebc added assert and documentation typos (#816) 2016-06-13 17:16:09 -04:00
Alden Torres db65eb320a making dht counters additive (#783)
make dht counters additive to support both IPv4 and IPv6
2016-06-04 14:04:29 -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