Commit Graph

266 Commits

Author SHA1 Message Date
Alden Torres 6c31ea3d44 created dht state and session params refactor (#1100)
created dht state and session params refactor
2016-09-17 09:42:04 -04:00
Steven Siloti 3d3367387a check the address family of peers in get_peers (#1090) 2016-09-14 11:29:27 -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 3fa74c6fd5 more consts refs and formatting (#1080) 2016-09-12 09:20:15 -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 5480e2eedc some consts refs and refactor (#1075)
some consts refs and refactor
2016-09-09 15:02:20 -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
Alden Torres 585a760588 headers cleanup (#1054)
headers cleanup
2016-09-01 15:04:58 -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
Alden Torres 658fa46f0a no warnings in random with openssl-1.1 and minor refactor 2016-08-30 21:23:08 -04:00
Alden Torres f51e782905 using string_view in node::incoming_request and plugin::on_dht_request (#1001)
use string_view in node::incoming_request. changed plugin::on_dht_request to use string_view
2016-08-15 16:17:13 -04:00
arvidn 8c8c3d5587 replace boost::function with std::function 2016-08-13 07:07:26 -04: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
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
arvidn 680a09cfa5 merged RC_1_1 into master 2016-07-26 02:14:58 -04:00
Steven Siloti 3321ca10f1 update our id in the rpc manager when it changes (#942)
update our id in the rpc manager when it changes
2016-07-24 21:30:36 -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 7bf49c0a1c modernize hasher to use array_view (#931)
modernize hasher to use array_view as well as adding array_view support to entry
2016-07-22 07:29:39 -07:00
Arvid Norberg a740a49fd6 modernize misc (#898)
modernize misc
2016-07-10 07:34:45 -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
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
Arvid Norberg ead11737b4 fix uses of defines for whether or not asserts are active (#832) 2016-06-18 08:31:07 -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 8c8f5bb03b deprecated public to_hex() and from_hex() functions (#784) 2016-06-04 10:01:43 -04:00
Alden Torres 7c4d92a627 Share the DHT storage for both IPv4 and IPv6 (#762) 2016-06-03 19:44:16 -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
arvidn aa0d29b67d merged RC_1_1 into master 2016-05-19 01:28:22 -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
Arvid Norberg 53bd03558c Dht stats 1.1 (#720)
fix missing dht stats counter updates
2016-05-12 21:27:11 -04:00
Arvid Norberg c91a700c07 Msvc warnings (#685)
fix msvc warnings and build examples with warnings-as-errors
2016-05-02 12:36:21 -04:00
Arvid Norberg 20b41ad0b9 Threads (#671)
use std::thread, std::mutex, std::condition_variable instead of pulling them in from boost.asio internals.
2016-04-30 18:54:23 -04:00
Arvid Norberg 3c785b96fc Merge pull request #268 from ssiloti/dht-ipv6
Support DHT over IPv6
2016-04-25 19:19:48 -04:00
Andrei Kurushin 62eb956c54 fix x64 build with VS2015 UP2 compiler (#640)
fix VS2015 compiler warnings for: address-model=64, deprecated-functions=on, link=shared
2016-04-25 17:22:09 -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
Steven Siloti 356d2506bd extend dht_observer to support IPv6 external addresses 2016-04-24 14:26:57 -07:00
arvidn d5203c67d9 add DHT rate limit test (simulation). introduce a new counter for dropped incoming dht messages. 2016-01-18 14:34:42 -05:00
arvidn 06b52f1421 some cleanup of the dht_socket_interface and fix tests and simulations to build with the dht disabled 2016-01-18 14:34:42 -05: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
arvidn 01e6b93854 simplify and improve unit test for distance_exp. make some immutable variables const in the DHT implementation. instead of waking up periodically just to check if it's time to refresh the DHT secret key, set the timer to only wake up to refresh the key. If we don't have a DHT observer (to ask for our external IP) or if we don't know our external IP, don't generate a node ID based on 0.0.0.0, just generate a random ID instead. Simplified and improved node replacement logic in the routing table a little bit 2016-01-01 16:42:37 -05:00
Steven Siloti ac01ccc43a add templated wrapper around verify_message
It was too easy to forget to update the ret and size parameters
when the size of desec changed. With this change we now automatically
get the size of desc and enforce that ret has the same size.

It would be nice if we could use bdecode_node ret[static Size] from C99
but that is not widely supported.
2015-12-29 20:35:36 -08:00
Steven Siloti c6f1e0bd7b export verify_message and incoming_error
Also move these functions to a new msg.cpp. They are useful for plugins
which implement DHT extensions.
2015-12-05 18:20:08 -08:00
arvidn 7540a6e5cc correctly check incoming DHT error messages 2015-11-30 18:02:00 -05:00
Steven Siloti 1f13343a70 const correctness 2015-11-22 10:02:26 -08:00
Steven Siloti 6c5bed63d3 whitespace cleanup 2015-11-22 10:02:26 -08:00
Thomas Yuan ab70ad3e05 fix comments and unit test 2015-11-20 00:06:08 -05:00
Thomas Yuan 194ad410dc Make dht_put_alert more accurate. 2015-11-20 00:06:08 -05:00
arvidn 3cc464805f update libsimulator submodule 2015-10-25 10:55:20 -04:00
Alden Torres 62b24d8b67 Add set_dht_storage to session API. 2015-10-02 09:00:07 -04:00
Thomas Yuan f9fa8ffdec Use ping instead of get_peers if current bucket is full. 2015-09-22 10:35:10 -04:00
Alden Torres 25ed70b977 Create dht_storage_counters to avoid internal counter in future public API. 2015-09-21 07:46:23 -04:00
Thomas Yuan 20708fa5b6 Only re-bootstrap when there is no enough nodes in routing table. 2015-09-17 11:22:23 -04:00
Alden Torres e2d682275a Implementing and using new dht storage interface 2015-09-16 08:30:27 -04:00
Thomas Yuan d6bb387ab9 Use dht_settings directly instead of add a read_only member variable.
Since rpc_manager has a reference of dht_settings, needn't pass it
as a parameter for incoming().
2015-09-08 10:35:30 -04:00
Thomas Yuan 3d4ed9f37f Add read-only support in dht_settings and outgoing query messages. 2015-09-07 14:24:46 -04:00
arvidn 17c5759829 disable warning for unused command line argument and fix warnings. remove redundant travis build config. use new preprocessor on clang to avoid warnings 2015-09-06 22:55:41 -04:00
arvidn ffa870d280 fixed some GCC warnings 2015-08-20 01:33:20 +02:00
arvidn 8d8c049d9e fix warnings and invalid defines in disk_io_thread.cpp 2015-08-18 07:55:50 -04:00
Steven Siloti 182c30f2d6 fix typo in class name 2015-08-10 20:33:04 -07:00
Steven Siloti 86fd8c3048 enable arbitrary direct dht requests and extension dht requests
If you're wondering why I used an alert for handling responses but not requests,
it's because the former was easy to do that way but the latter would have
involved some major refactoring or kludging. The DHT node is written with the
(IMO reasonable) assumption that all responses will be generated immediately, so
there was no way to easily accommodate getting a response asynchronously via
an alert.
2015-08-10 20:33:04 -07:00
Arvid Norberg 27c5a28637 Merge pull request #70 from thomas-yuan/master
Call callback function immediately when get data for mutable data.
2015-08-08 21:51:18 -04:00
Thomas e51b61870a Call callback function immediately when get mutable data. 2015-08-08 20:28:53 -04:00
arvidn a91e7ce25d fix warnings 2015-08-06 02:30:06 -04:00
Alden Torres 5c8c9cd653 Refactor to expose a more convenient get_peers function as part of the DHT api.
Now announce (a particular case of get_peers DHT operation) uses the function get_peers.
2015-06-24 21:22:24 -04:00
Arvid Norberg d43f7b56a2 update copyright year 2015-06-03 05:18:48 +00:00
Arvid Norberg 0052fa6c19 some cleanup to dht observers (don't expose internals) 2015-05-22 02:42:26 +00:00
Arvid Norberg 71ee44ae5e fix build issue, some warnings 2015-05-17 23:32:13 +00:00
Arvid Norberg 88fe6eba9c fix issues introduced in dht logging patch 2015-05-17 20:59:18 +00:00
Arvid Norberg 99de70604a remove dht-verbose logging build configuration. tie it to the main logging configuration (which now is on by default) and make it less costly when dht logging alerts are disabled 2015-05-16 19:29:49 +00:00
Arvid Norberg 494b425ea1 fix warnings and a peer logging bug 2015-05-10 18:38:10 +00:00
Arvid Norberg b60934288b turn DHT logging into alerts instead of writing to a file 2015-05-10 04:54:02 +00:00
Arvid Norberg ca581f2258 rename dht::node_impl -> dht::node, since this hasn't been a pimpl for quite a while 2015-05-09 19:00:22 +00:00
Arvid Norberg 6557910c7f remove the DHT's last dependency on session_impl 2015-05-09 18:06:02 +00:00
Arvid Norberg 2fff222235 silence some warnings on msvc 2015-04-27 02:21:12 +00:00
Arvid Norberg 3951377d95 fix include paths for warning push and pop headers 2015-04-21 01:16:28 +00:00
Arvid Norberg f5629eb403 cleanup and fixing of more warnings 2015-04-21 00:23:00 +00:00
Arvid Norberg 4d15f1410f fix warnings, some clean-up and todo comments 2015-04-20 04:52:49 +00:00
Arvid Norberg 408232cfc8 raise warning level. fix a few of them. filter out warnings from boost 2015-04-18 02:33:39 +00:00
Arvid Norberg 013ed36f09 landed alert_queue feature branch into trunk 2015-04-03 20:15:48 +00:00
Arvid Norberg 37225b71ae const static -> static const (thanks gubatron). helps swigs parser 2015-03-14 00:42:27 +00:00
Arvid Norberg 6c1df7eb55 landed the bdecode branch in master. lazy_bdecode/lazy_entry is now being replaced by bdecode/bdecode_node 2015-03-12 05:20:12 +00:00
Arvid Norberg c1dc982f4f deprecate the ptime type and related time types. just use boost::chrono / std::chrono 2015-03-12 04:34:54 +00:00
Arvid Norberg 0afea4bb3e move some DHT verbose stats logging over to performance counters 2015-01-18 01:06:36 +00:00
Arvid Norberg 58d93e5aa1 add new (non-deprecated) access to dht stats, asynchronously via an alert 2015-01-17 17:02:58 +00:00
Arvid Norberg 35b41858cf deprecated session_status and session::status() in favor of performance counters 2015-01-04 21:31:02 +00:00
Arvid Norberg 55e51ab57c merged changes from RC_1_0 2015-01-04 21:18:00 +00:00
Arvid Norberg 0977d94dbc merged changes from RC_1_0 2014-12-25 11:24:02 +00:00
Arvid Norberg edade10561 merged fix from RC_1_0 2014-11-26 03:58:55 +00:00
Arvid Norberg 8ec7cff993 merged changes from RC_1_0 2014-11-26 02:02:32 +00:00
Arvid Norberg aae56c991c merged changes from RC_1_0 2014-11-08 16:58:18 +00:00
Arvid Norberg 601f0dc434 merged changes from RC_1_0 2014-11-03 06:15:51 +00:00
Arvid Norberg 3742fd2699 merged changes from RC_1_0 2014-11-02 09:41:29 +00:00
Arvid Norberg 34af25beaa merged chagnes from RC_1_0 2014-11-01 22:47:56 +00:00