Commit Graph

126 Commits

Author SHA1 Message Date
Arvid Norberg b90564d418 remove the IPv6 enable/disable build config 2018-08-19 22:20:54 +02:00
arvidn 10deff2f91 fix some unintentional copies (with explicit moves) 2018-07-01 18:22:32 +02:00
arvidn f0227451a6 merged RC_1_1 into master 2018-04-13 01:47:41 +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
Alden Torres c771f16c5c lint guided refactor in dht source code (#2516) 2017-11-12 00:50:24 +01:00
arvidn 7b98af8145 improve type-safety of observer_flags and traversal_flags 2017-08-05 20:20:13 +02:00
Pavel Pimenov 98a0344196 refactor traversal_algorithm look_for_nodes (#1982) 2017-05-29 12:20:52 -04:00
arvidn e870852c66 fix branch factor overflow in traversal algorithm 2017-05-13 08:10:21 -04:00
Alden Torres 4ea318faa0 compilation fix when not TORRENT_ASSERT 2017-04-26 13:46:35 -04:00
arvidn a9a12e873f make DHT bootstrapping more robust by not throwing away nodes 2017-04-25 23:03:52 -04:00
arvidn 480bde9333 change formatting of namespace declarations 2017-04-12 14:26:35 -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 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 c34a2541cc Log refactoring (#1446)
factor out common logging code in some dht traversal algorithms
2016-12-24 06:46:21 -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 f382936d56 headers, end of file, code cleanup 2016-12-12 23:36:45 -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
Arvid Norberg 25195a7260 back port DHT fixes from master (#1209)
back port DHT fixes from master
2016-10-14 23:47:59 -04:00
Arvid Norberg 540b5b28d7 use signed counters in traversa_algorithm, and add some more asserts (#1208)
use signed counters in traversal_algorithm, and add some more asserts
2016-10-14 08:03:09 -04:00
Arvid Norberg e0c8ad738d include target in DHT lookups, when queried from the session (#1207) 2016-10-12 23:39:00 -04:00
Alden Torres 9343f2fbfb minor header cleanup and refactor (#1179) 2016-10-04 07:43:34 -07:00
Alden Torres 4693fcf3f1 dht source code and headers cleanup (#1150) 2016-09-24 22:20:20 -04:00
Alden Torres 65cdc15543 more on log, consts, refs and cleanup in dht related code (#1082)
more on log, consts, refs and cleanup in dht related code. moving print_state out of main source code
2016-09-13 08:18:47 -04:00
Alden Torres 4d4eb66c8b some refactor, more const refs and span use (#1078)
some refactor, more const refs and span use
2016-09-11 01:58:48 -04:00
Alden Torres 99da5c8017 dht log optimization, consts and refactor (#1073)
dht log optimization and refactor
2016-09-08 19:13:46 -04:00
Alden Torres 29a4075555 refactor to use std::shared_ptr with dht observer (#1057)
refactor to use std::shared_ptr with dht observer
2016-09-02 21:05:11 -04:00
Alden Torres fd4c09d7b2 refactor to use std::shared_ptr with traversal_algorithm (#1056)
refactor to use std::shared_ptr with traversal_algorithm. use a more stable linaro gcc link
2016-09-02 16:42:55 -04:00
Steven Siloti 29e6cbbdae fix exit condition when parsing nodes (#1046)
fix exit condition when parsing nodes
2016-09-01 00:49:21 -04:00
Arvid Norberg 71f5510d62 make the random function produce proper random distributions, based o… (#981)
make the random function produce proper random distributions, based on uniform_int_distribution of C++11. also clean up piece_picker's priority_range to return two results instead of taking pointers to out-parameters. fix recent pe-crypto regression exposed by this change
2016-08-06 13:18:48 -04:00
arvidn 83dba91168 use span for to_hex and from_hex functions 2016-07-29 18:42:18 -04:00
Arvid Norberg 770935cd46 modernize-use-nullptr (#894) 2016-07-09 16:26:26 -04:00
Arvid Norberg ed077c8358 use cstdint intead of boost/cstdint.hpp (#833)
use cstdint intead of boost/cstdint.hpp
2016-06-18 14:01:38 -04:00
arvidn dfc2206b9f merged RC_1_1 into master 2016-06-11 01:00:41 -04:00
Arvid Norberg 5ecd00c5c5 fix osx build (#804)
fix osx build with asserts enabled
2016-06-11 00:48:13 -04:00
Arvid Norberg 8c8f5bb03b deprecated public to_hex() and from_hex() functions (#784) 2016-06-04 10:01:43 -04:00
Arvid Norberg 96999ad67f replace uses of boost::bind with std::bind and lambdas (#745) 2016-05-25 00:31:52 -04:00
Arvid Norberg 748af6eec1 general cleanup. remove valgrind markup, log_hash_failures and C headers (#752)
general cleanup. remove valgrind markup, log_hash_failures and C headers
2016-05-23 08:15:39 -04:00
Steven Siloti 2d9a6b76f1 use asio::protcol instead of an enum/bool 2016-04-24 15:18:47 -07:00
Steven Siloti 2abd9867ce IPv6 DHT support
Fixes #110
2016-04-24 14:26:57 -07:00
arvidn 1f9f588e75 merge copyright year update and changelog from RC_1_0 2016-01-17 18:57:46 -05:00
arvidn f4d643bd2d instead of restarting the whole DHT when changing external IP, just rebuild the routing table and change the node IDs 2016-01-11 21:17:25 -05:00
Steven Siloti 86116caf4c fix assert after a DHT get/put request
If an observer is abandoned due to there being more than 100 results in a
traversal then the traversal may complete while the observer is still
outstanding. When the observer times out or is aborted it calls
traversal_algorithm::failed() which asserts because m_invoke_count has been
cleared to zero by traversal_algorithm::done().

To fix this add a check when abandoning observers to see if they have an
outstanding query. If they do then flag them as done to prevent them from
calling back into the traversal and decrement the invoke count.

Fixes #271
2015-11-16 21:05:32 -08:00
Steven Siloti ba1ccdec66 fix assert in dht::observer
This is was introduced by c2277b3ea5
"fix traversal_algorithm::done() being invoked more than once".
2015-11-14 18:30:42 -08:00
Steven Siloti c2277b3ea5 fix traversal_algorithm::done() being invoked more than once
A traversal can be done while there are still outstanding queries (i.e.
m_invoke_count is non-zero) if K good responses have already been received and
none of the outstanding queries are closer than the nodes which have responded.

When this happens and the outstanding queries eventually complete or timeout
they call traversal_algorithm::failed() or traversal_algorithm::finished() as
usual which will cause traversal_algorithm::done() to be called yet again.

The fix is to always set the done flag on all queried observers in
traversal_algorithm::done() so that the observers will refrain from calling
back into the traversal.

This also makes traversal_algorithm::abort() redundant since this was the only
thing it did before it called into done().
2015-11-09 20:47:33 -08:00
arvidn b628692223 separate out announce_entry and torrent_status into their own headers 2015-09-18 08:08:08 -04:00