Commit Graph

206 Commits

Author SHA1 Message Date
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 592544f30f fix some PVS studio warnings 2019-11-07 16:38:08 +00:00
patch3proxyheaders915360 832857e384 set HTTP Host to request-target when using proxy
To make the Host field carry the request-target it is enough to set
the Host information before changing the connection destination.

Many proxies rely on the Host field-value to route requests
in a violation of RFC7230 section 5.4.

https://tools.ietf.org/html/rfc7230#section-5.4

A request with the Host field set to the proxy hostname and port
in place of the request-target produces error responses and otherwise
confuses such misconfigured middleboxes.
2019-07-01 10:17:20 +02:00
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 f025c67185 fix memory leaks in test_http_connection simulation 2019-03-30 14:44:21 +01:00
arvidn 7f2a78d0c9 make random_shuffle() take a range instead of two iterators. use random_bytes() instead of std::generate() and random_byte(). Remove unused hasher.hpp includes 2019-02-19 01:48:08 +01:00
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 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 6c4869f044 moved instantiate_connection to aux namespace 2018-05-29 09:25:25 +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
arvidn e126d7bce0 move socket_type into aux-namespace 2018-01-29 08:33:45 +01:00
Alden Torres 98ade28237 using make_address instead of deprecated from_string when boost>=1.66 (#2659)
using make_address instead of deprecated from_string when boost>=1.66
2018-01-04 04:48:22 -05:00
arvidn 55babc57e6 merged RC_1_1 into master 2017-12-15 17:18:27 +01:00
arvidn d1a63cd781 fix build against boost-1.66, specifically the boost.asio changes 2017-12-15 11:29:53 +01:00
arvidn 7b06a5ee6e merged RC_1_1 into master 2017-12-13 12:36:35 +01:00
arvidn b00b3184c0 some minor i2p cleanups 2017-12-08 09:57:21 +01:00
arvidn a286b9da47 fix i2p support 2017-12-08 09:57:21 +01:00
arvidn 5e7666526e fix IPv6 tracker announce issue 2017-11-23 10:11:59 +01:00
Alden Torres 74ecf63906 close connection in upnp::on_upnp_xml and added abort/closing returns 2017-10-20 11:46:41 +02:00
Alden Torres 58a76e26a8 fix warnings from asio/ssl includes 2017-10-13 21:06:42 +02:00
Arvid Norberg 60b74d2616 merged RC_1_1 into master 2017-10-10 14:25:12 +02:00
Arvid Norberg 830ef0bedd prevent dependency on openssl from leaking outside of libtorrent (libssl and libcrypto should not be a usage requirement). This cleans up most tests to build without having to also link against openssl 2017-10-09 17:15:35 +02:00
Steven Siloti 0c6b17ed82 don't try to connect to a global address with a local source address 2017-10-09 01:10:26 +02:00
arvidn 93bb84d94c some random cleanup 2017-09-13 08:28:46 +02:00
arvidn 95c8c3018a use span in gzip, http_parser and http_connection 2017-09-04 22:33:38 +02:00
Alden Torres 070066e892 more use of emplace_back and minor code simplification 2017-08-17 08:08:51 +02:00
Alden Torres 0ac01a8532 header fix for use of stringstream 2017-08-10 22:02:10 +02:00
arvidn 5f4816f1d8 fix include in http_connection.cpp 2017-08-10 19:47:42 +02:00
arvidn 865ff09a84 merge RC_1_1 into master 2017-08-10 16:44:57 +02:00
arvidn 560ef29276 fix issue with very long tracker- and web seed URLs. Instead of using a fixed length stack allocated request buffer, use a dynamically growing stringstream 2017-08-10 14:01:11 +02:00
arvidn c4afb5e949 use a dedicated class template for flags types instead of enum class. It's more backwards compatible and improves ergonomics 2017-07-15 01:15:57 -07:00
arvidn afce0d3a86 make resolver_flags use enum class for improved type-safety 2017-05-29 18:38:59 -04:00
arvidn b1b4360df6 merged RC_1_1 into master 2017-05-08 07:48:42 -04:00
Jan Berkel fe9f877087 Set connection timeout when next endpoint is tried (#1952) 2017-05-04 17:32:47 -04:00
Steven Siloti fd50630020 announce to trackers for all listen interfaces 2017-04-30 08:11:56 -04:00
Alden Torres 0132221031 minor code cleanup, std:: prefix, consts, typos 2017-04-04 23:12:48 -04:00
arvidn 1dd0e9b280 use string_view instead of strcmp 2017-03-18 15:54:38 -04:00
Alden Torres a5825c0d2e fixing sign-conversion warnings, part 5, minor refactor (#1559)
fixing sign-conversion warnings, part 5, minor refactor
2017-01-16 21:51:49 -05:00
Alden Torres df6cb6a48d fixing sign-conversion warnings, part 4, minor refactor (#1549)
fixing sign-conversion warnings, part 4, minor refactor
2017-01-14 18:53:25 -05:00
Alden Torres c3d9614dfb minor code refactor and cleanup 2017-01-14 06:59:44 -05:00
Alden Torres dd7179fb10 added a few consts to arguments and local variables 2016-12-10 18:19:14 -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 c30027e4a1 more integral type conversion warning fixes, now only needs shorten-64-to-32 (#1349)
more integral type conversion warning fixes, now only needs shorten-64-to-32
2016-11-25 11:17:25 -05:00
Alden Torres 6751a1eeb1 removed spaces in template types and more c++11 auto/loop refactor 2016-10-26 00:08:00 -04:00
Alden Torres 8839722bec minor http related code cleanup (#1212) 2016-10-14 16:12:02 -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