Commit Graph
398 Commits
Author SHA1 Message Date
Adrien Beraud 2acdc1f1aa wip 2017-10-17 19:00:52 +02:00
Adrien Béraud 5c87e81c42 allow to retrieve nodes from ping callback 2017-10-17 18:58:07 +02:00
Adrien Beraud ac06dbe45f expired 2017-10-17 18:58:07 +02:00
Adrien Béraud 4a97265b22 use libuv for networking and event scheduling 2017-10-17 18:58:07 +02:00
Adrien Béraud 376486e64f node: use full range of socket IDs 2017-10-17 15:25:09 +02:00
Adrien Béraud 6bc2f19a36 dht: log total number of nodes in onGetValuesDone 2017-10-16 17:12:33 +02:00
Adrien Béraud 63e0c1266a dht: use OpStatus in put
Factorize shared pointers.
2017-10-13 02:07:14 +02:00
Adrien Béraud 1a54aff7bc storage policies: use SockAddr
API-breaking change to use const SockAddr& instead of sockaddr*.
2017-10-13 01:10:09 +02:00
Adrien Béraud f2b9f8eeda dht: move bucket time update to routing table 2017-10-13 01:10:09 +02:00
Adrien Béraud e9f007025f node: make most fields private 2017-10-13 01:10:09 +02:00
Adrien Béraud 84a45c4f91 dht: factorize shared pointer dereference 2017-10-12 15:44:14 +02:00
Adrien Béraud 024dd42e5a dht: remove processMessage 2017-10-11 17:36:20 +02:00
Adrien Béraud 3bb5e7ee12 network engine: move transaction ownership to Node 2017-10-11 17:36:20 +02:00
Adrien Béraud bdb0bef0ee network engine: move RequestAnswer out of class 2017-10-11 02:22:03 +02:00
Adrien Béraud 97ee4b6fea dht: move onNewNode to RoutingTable 2017-10-07 11:35:56 +02:00
Adrien Béraud 1c45f34262 SockAddr: use pointer to sockaddr
Save memory and reduce copies by using a pointer
to a sockaddr structure of the right size instead of
using a full sockaddr_storage structure for every address.
2017-09-26 16:30:29 +02:00
Adrien Beraud c40750f6e4 dht: use proper value type to compute expiration 2017-08-10 15:00:34 -04:00
Adrien Beraud 6f3eafc5ee dht: set refill time even when no nodes where found 2017-07-16 23:30:58 -04:00
Adrien Beraud 83d1cb97c8 dht: cleanup sendCachedPing 2017-07-16 23:30:58 -04:00
Adrien Beraud 477799a2b9 dht: remove unused method 2017-07-16 23:30:58 -04:00
Adrien Beraud 7e8c9ce944 dht: use SockAddr& in makeToken 2017-07-16 23:30:58 -04:00
Adrien Beraud 6decb6609a dht: use uint64_t to store secret 2017-07-16 23:30:58 -04:00
Adrien Beraud f1e7cd897d dht: use crypto::hash 2017-07-16 18:11:06 -04:00
Adrien Beraud 9bfaa224bc dht: move set_nonblocking to NetworkEngine 2017-07-16 18:10:49 -04:00
Adrien Beraud 5657661249 dht: move Search out of the Dht class 2017-07-16 17:46:54 -04:00
Adrien Beraud 61f91d626b dht: move Storage, Listener out of the Dht class 2017-07-16 15:04:18 -04:00
Adrien Beraud 732d10713d dht: minor coverity fixes 2017-07-16 13:39:14 -04:00
Adrien Béraud 7f2b5a44ff Merge pull request #186 from sim590/search-step-after-announce
dht: fix searchstep not scheduled after announcing
2017-04-05 20:12:23 +02:00
Adrien Beraud 25b6df5355 removeExpiredNode: cleanup 2017-04-05 17:52:34 +02:00
Simon Désaulniers 26a7aec7cc dht: fix searchstep not scheduled after announcing 2017-04-03 17:39:15 -04:00
Adrien Beraud 95d98f4659 rng: add getSeededRandomEngine
Add a routine to seed a pseudo-engine to
use the full range of possible internal states
by using seed_seq.
2017-03-07 17:08:46 +01:00
Adrien Béraud 1e7ba56aeb Merge pull request #174 from sim590/announce-status-fix
dht: standardize announce status check
2017-02-16 23:01:10 +01:00
Simon Désaulniers faf23195a4 dht: standardize announce status check
Fixes a bug where some callbacks wouldn't be called when a dummy request was
inserted to cancel some operation while not using the
net::Request::State::COMPLETED flag as per 19c47ec.
2017-02-16 16:29:21 -05:00
Adrien Béraud 0d66b9435f dht: print IPv6 search log 2017-02-16 11:49:38 -05:00
Adrien Béraud 49353e2d5c dht: replace expired node only when bucket is full 2017-02-10 00:38:51 -05:00
Simon Désaulniers 9d83ee169b dht: randomize id in Dht layer 2017-02-07 15:58:04 -05:00
Adrien Béraud ac65ca5177 add shortcut Sp for std::shared_ptr 2017-01-24 23:38:31 -05:00
Simon Désaulniers efa6930de2 dht: fix multiple put on a single search segfault
"Iterators pointing to an element between the new logical end and the physical
end of the range are still dereferenceable, but the elements themselves have
unspecified values (as per MoveAssignable post-condition)."

- http://en.cppreference.com/w/cpp/algorithm/remove
2017-01-20 02:40:05 -05:00
Simon Désaulniers 19c47ec781 dht: correctly tell if value is announced
* A value should be considered announced if all good nodes up to a count of
  TARGET_NODES have been tried in the search .
* Bug fix where SearchNode::isAnnounced criteria was not consistent with
  announce operation.
2017-01-20 02:39:59 -05:00
Adrien Béraud bd822fce19 dht: don't stop node insertion on expired search 2017-01-17 16:43:32 -05:00
Adrien Béraud 756e0bd3d8 dht: cleanup paginate
Reduce indentation level by 4,
add code documentation,
remain under 120 chars wide.
2017-01-15 19:02:15 -05:00
Simon Désaulniers b03a8b5b50 update license notice (2017) 2017-01-13 17:27:29 -05:00
Adrien Béraud 32f5175d68 dht: expire storage just on time 2017-01-13 16:06:46 -05:00
Adrien Béraud 7d3a54db57 dht: storage rate limiting 2017-01-13 16:06:46 -05:00
Adrien Béraud b6dca5ccd6 dht: use new NodeStats structure to provide stats 2017-01-10 23:34:56 -05:00
Adrien Béraud 23b2712400 dht: use SHA265 instead of SHA512 for the op token
The op token is renewed regularly (around every 30 minutes),
so SHA256 provides enough security for this non-sensitive token.
SHA256 takes 32 bytes instead of 64 bytes for SHA512,
and the token is included in every listen requests,
renewed every 30 seconds, and every answer to get.
In the context of limited bandwith usage, using SHA256 seems more appropriate.
This change is backward and forward compatible.
2017-01-10 23:34:56 -05:00
Adrien Béraud 19fdec96ca dht: remove getStatus with get 2017-01-09 14:38:51 -05:00
Adrien Béraud 2208a06232 dht: clear acked with announce
Clear the search node acked when clearing
the corresponding announce, after checking
the announce status for all announces.
2017-01-09 00:06:54 -05:00
Simon Désaulniers 620868b5d6 routing_table: complete connecting state resolution
After a connectivity change, the DHT would enter the "connecting" state in order
to try to resolve good nodes. However, the previous algorithm would
probabilistically increase time for completion each time a node would fail to
resolve. We now avoid this by prioritizing non-expired nodes in the process.
Also, a subtle error would sensibly stop the process for 30 minutes due to using
the Node::NODE_EXPIRE_TIME constant instead of Node::MAX_RESPONSE_TIME.
2017-01-03 17:48:40 -05:00
Adrien Béraud 7f84c1e397 utils: remove useless definitions 2016-11-23 15:12:37 -05:00