Commit Graph
92 Commits
Author SHA1 Message Date
Adrien Béraud 5323ebd6b1 dht: use a listen keep-alive of 30 seconds 2015-07-27 14:33:39 -04:00
Adrien Béraud a2eed7e7af dht: limit total node number per search 2015-07-24 01:02:35 -04:00
Adrien Béraud 178eeae94f dht: log cleanup 2015-07-24 01:02:35 -04:00
Adrien Béraud d95b11aefa dht:use appropriate node array size 2015-07-23 11:06:16 -04:00
Adrien Béraud a090baba08 doc update 2015-07-23 11:06:16 -04:00
Adrien Béraud ae178c4d25 fix some compiler warnings 2015-07-23 11:06:04 -04:00
Adrien Béraud d2ed99742e zero-initialise sockaddr structures 2015-07-23 11:05:50 -04:00
Adrien Béraud 3d2a74be49 python: add PyNode 2015-07-13 13:24:55 -04:00
Adrien Béraud e2004d69cb prevent sending listen or announce to unsynched nodes 2015-07-11 18:38:11 -04:00
Adrien Béraud 7a3a95bf3e dht: use time_point::min() as invalid time_point value 2015-07-11 18:38:11 -04:00
Adrien Béraud 5bec9f6764 log cleanup 2015-07-10 23:31:09 -04:00
Adrien Béraud d2c57b867d update copyright headers 2015-07-10 23:25:43 -04:00
Adrien Béraud d0f4f57116 dht: fix typo, warnings 2015-07-04 23:56:16 -04:00
Adrien Béraud f05ce4865d dht: round 2 of search performance optimisations
This patch makes search nodes candidates when they failed to reply
to a first message. This allows the search operations to go forward,
while preserving the node opportunity to reply.
2015-07-02 02:59:28 -04:00
Adrien Béraud f1ff9a1a87 dht: optimisations in search behavior
A candidate flag is added to new search nodes when a search
is already synced.
The flag is waived when a token is retreived from the node.
Candidate nodes behave normally but are not considered
to evaluate the search state (synced etc.).

The behavior of searches if also changed so GET_NODES
updates are now done the same way, no matter if the search
is currently synced. This allow candidate nodes to behave
normally and makes token update asynchronous, causing
less frequent performance hickups.
2015-07-02 02:59:28 -04:00
Adrien Béraud 04623d09f8 dht: simplify get search node selection 2015-07-02 02:59:28 -04:00
Adrien Béraud a63fc649b6 refactoring: move Node out of Dht 2015-07-02 02:59:01 -04:00
Adrien Béraud 680186976f dht: add node list to done callback 2015-06-25 15:56:03 -04:00
Adrien Béraud 40f0488203 dht: address family can be omited in isRunning 2015-06-17 22:34:57 -04:00
cberaud 41406833a8 add crypto::random_device 2015-05-15 19:57:04 +05:30
Guillaume Roguez 98233954c4 dht: drop incoming msg with unknown protocol
We filter out incoming packet if my_v field is not known.
This prevents to be flooded by others bittorrent-like clients.

Signed-off-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2015-05-14 13:44:11 -04:00
Guillaume Roguez 23961ad9f3 dht: fix buffer-overflow in Dht::blacklistNode
ASAN build shows a buffer-overflow that happens frequently
when blacklistNode tryies to remove blacklisted node from
searches using erase/remove_if std C++ pattern.
This is more frequent using optimized build (gcc -O3).
erase/remove_if pattern is a valid design, so it may be a
failure in stdc++ implementation (not confirmed).
To solve that we fallback to an explicit search loop/erase
pattern.

Signed-off-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2015-05-14 09:28:49 -04:00
Adrien Béraud c5c61b838e dht: fix compilation for LLVM 3.5 2015-04-27 15:14:46 -04:00
Adrien Béraud d42f404f26 dht: improve update time consistency 2015-04-07 11:07:48 -04:00
Adrien Béraud 06988396e9 searches: only remove old expired nodes 2015-04-06 12:35:09 -04:00
Adrien Béraud d03f09f810 dht: proprely update receive time 2015-04-06 02:07:47 -04:00
Adrien Béraud 39b8ca3fce searches: prefer to remove expired nodes 2015-04-06 00:04:10 -04:00
Adrien Béraud 8f9089abba dht: don't expire some ongoing searches 2015-04-05 23:31:27 -04:00
Adrien Béraud 45e32892c6 dht: don't unexpire expired nodes on request 2015-04-04 21:07:46 -04:00
Adrien Béraud 777a5035d2 searches: introduce expired internal state 2015-04-04 16:50:15 -04:00
Adrien Béraud 1ae29f201d dht: timeout searches with no synced nodes 2015-03-30 11:47:48 -04:00
Adrien Béraud 30d5ad5f33 dhtrunner: add bootstrap from host and service strings 2015-03-29 13:09:36 -04:00
Adrien Béraud e638f014ab dht: nodecache factoring 2015-03-23 15:29:01 -04:00
Adrien Béraud ac1e322dac clarify logs for lastest changes 2015-03-23 15:02:33 -04:00
Adrien Béraud 571ccac012 always cache new nodes 2015-03-23 15:02:11 -04:00
Adrien Béraud a8bd2a6ee1 use node reply time for MSG_CONFIRM 2015-03-23 14:59:48 -04:00
Adrien Béraud 13385faaf4 add tryInsertSearch 2015-03-23 14:06:53 -04:00
Adrien Béraud 736d4f77c7 fix nullptr access 2015-03-23 14:06:09 -04:00
Adrien Béraud 955b68a439 dht: reduce listen period from 10 to 3 minutes 2015-03-17 13:29:49 -04:00
Adrien Béraud 643dbc6268 dht: keep bad nodes in searches 2015-03-17 12:08:26 -04:00
Adrien Béraud 5de9bcfab0 dht: use std::map::emplace instead of insert where possible 2015-03-16 17:50:26 -04:00
Adrien Béraud 8426314628 dht: share node state through routing table and searches 2015-03-16 17:50:26 -04:00
Adrien Béraud 4c28dfb632 listeners: avoid race condition 2015-03-14 18:30:22 -04:00
Adrien Béraud f1fae52916 listeners: only send new/updated values 2015-03-06 12:16:07 -05:00
Adrien Béraud 56b0610827 log: add print_addr helper method 2015-03-06 11:06:31 -05:00
Adrien Béraud 4452452efb log cleanup 2015-02-22 21:01:35 -05:00
Adrien Béraud b5d9347174 Fix invalidated listener iterator 2015-02-18 14:56:57 -05:00
Adrien Béraud d178984b6a check for null value filters 2015-02-04 11:10:52 -05:00
Adrien Béraud 902c604b98 using namespace std::chrono in periodic 2015-01-19 10:30:33 -05:00
Adrien Béraud 6003770d6a zero initialize sockaddr fields 2015-01-19 10:30:14 -05:00