Commit Graph
81 Commits
Author SHA1 Message Date
Adrien Béraud 7f84c1e397 utils: remove useless definitions 2016-11-23 15:12:37 -05:00
Simon Désaulniers 2d9f6241a9 net: don't close socket on listen renew 2016-11-08 16:07:15 -05:00
Simon Désaulniers ab7d1d6582 dht,net: introduce socket, support multiple listen
Since the initial implementation of listen operation, multiple listen requests
from a single node on a same hash was not possible without singular
inconsistencies. The flaw was coming from the fact that nodes receiving listen
request could not differentiate between listen refresh request and a new
independent listen request.

This patch introduces the new net::Socket structure which in time will enable
remote nodes to send update for a storage while differentiating between
concurrent listen requests. A socket has a unique identifier which consists of a
transaction id as defined in the OpenDHT protocol.
2016-11-07 06:44:15 -05:00
Simon Désaulniers 77ea6d8c2f net: create net namespace, moving relevant structs 2016-11-05 19:29:00 -04:00
Adrien Béraud 6703e039b1 network_engine: deserialize proper number of fields 2016-10-26 17:50:30 -04:00
Adrien Béraud 1d62b3ca64 log: add InfoHash filter
* filter log entries with new method setLogFilter
* filter by node id, search or infohash
* add optional parameter to 'log' in dhtnode
2016-10-24 02:09:38 -04:00
Adrien Béraud 9dc6004329 network engine: cancel request when clearing listen status 2016-10-19 13:58:18 -04:00
Adrien Béraud d4bd17a2dc dhtrunner: use a second condition variable for bootstrap 2016-10-19 13:34:33 -04:00
Adrien Béraud 0d646eb244 network engine: log cleanup 2016-10-19 01:01:51 -04:00
Simon Désaulniers 6743cbbf50 dht: introduce "refresh" operation
This operation requests a node to refresh a value's time_point information of
its lifetime begining. This is intended to fix the *permanent put* operation
which has been having syncing issues since the introduction of an enhanced and
lighter put operation.
2016-10-17 11:56:54 -04:00
Adrien Béraud 96da4cd85d build: make logs optional at build time 2016-10-16 22:36:42 -04:00
Adrien Béraud 9440c03048 dht: log cleanup 2016-10-16 22:36:24 -04:00
Adrien Béraud aa611bde50 network engine: cleanup 2016-10-15 20:07:37 -04:00
Adrien Béraud 7af856508e dht: make connectivityChanged family dependent 2016-10-15 19:13:15 -04:00
Adrien Béraud eed8ffc792 Merge pull request #139 from savoirfairelinux/recover-from-network-changes
dhtrunner: recover from network changes
2016-10-11 11:57:31 -04:00
Simon Désaulniers 8567b7ad84 network_engine: expire requests when clearing NE
This is to prevent any thread relying on network_engine's callback to block
forever just like the Dht::sendPing's callback.
2016-10-10 01:51:26 -04:00
Adrien Béraud 659d893dee network: transmit large values in multiple packets 2016-10-09 16:22:33 -04:00
Simon Désaulniers 87cf6faedd dht/node: don't allow more than 3 auth errors 2016-09-23 19:27:59 -04:00
Simon Désaulniers 16e55416a6 network_engine: fix bug token not sent for listen 2016-09-23 19:27:58 -04:00
Adrien Béraud ccd0cbd8f2 add per IP rate limiting (#131) 2016-09-21 15:44:20 -04:00
Adrien Béraud 6d38c18572 introduce SockAddr to store IP addresses 2016-09-15 01:38:26 -04:00
Simon Désaulniers 669c08210e dht: erase find node request status when done
This was memory leak and produced inconsistency in SearchNode::canGet timings.
2016-08-22 18:26:53 -04:00
Simon Désaulniers c04ede4909 dht: unify bootstrapSearch and refill method
Since bootstrapSearch was rewritten to use the node cache, it made it clear that
refill should be rewritten as such. However, then bootstrapSearch becomes
irrelevant.

An enhancement to refill is that it will let insertNode review its whole list
of nodes and then let it insert nodes up to SEARCH_NODES nodes. The previous
method would not garantee this behavior since, most of the times, it would pass
less than SEARCH_NODES nodes to insertNode.
2016-08-06 21:14:17 -04:00
Simon Désaulniers a21d4d4adc queries: fix deserialization bug
Only the first two entries of the array would be accessed in a consistent way.
Therefor, only the two first field value index would be returned.
2016-08-05 21:20:58 -04:00
kaldoran df3317a5b2 dht: bootstrap from cache instead of routing table 2016-08-03 10:04:02 -04:00
kaldoran 33f95c00a9 NodeCache: getNode takes bool not int
Since this was old code which use int as bool I edit that for a bool [and change related code]
2016-08-02 18:57:20 -04:00
Simon Désaulniers a4834efd37 dht: use queries in dht 2016-07-10 19:26:13 +02:00
Simon Désaulniers 07e4435a07 value: add Query relevant structures 2016-07-10 19:26:04 +02:00
Adrien Béraud b09e3df2e2 add network id to distinguish different networks 2016-06-21 03:06:47 -04:00
Adrien Béraud 4d75f64576 log: rename ERROR to ERR to build on Windows 2016-05-27 12:30:32 -04:00
Adrien Béraud ac23464044 network engine: retransmit 'done' param 2016-05-24 03:44:18 -04:00
Adrien Béraud ce162a39c6 network engine: add logs 2016-05-22 17:00:16 -04:00
Adrien Béraud ff2193dcc6 network_engine: add log on node expire 2016-05-19 17:37:39 -04:00
Adrien Béraud f7e01da20d expire node on blacklist 2016-05-19 17:28:31 -04:00
Adrien Béraud 16290961fb network engine: add sent data size 2016-05-19 01:55:06 -04:00
Adrien Béraud bd72c6468f network engine: handle unexpected node id 2016-05-15 01:36:25 -04:00
Adrien Béraud a926e273af dht: forward-declare more internal structures 2016-05-14 15:48:34 -04:00
Adrien Béraud d3b9c4b7b6 network engine: improve node packing 2016-05-13 16:38:23 -04:00
Adrien Béraud 91bf5bb41b allow to cancel request without network engine 2016-05-10 12:50:20 -04:00
Adrien Béraud 040e3770ad node: use requests to determinate state 2016-05-09 16:17:59 -04:00
Adrien Béraud ef1bf5ccec move node cache to message engine 2016-05-08 00:37:52 -04:00
Adrien Béraud 92613f5fbf net: improve request state consistency 2016-05-03 18:33:38 -04:00
Adrien Béraud 820598c179 network engine: change sendError message argument to std::string 2016-05-02 15:25:15 -04:00
Adrien Béraud d062f7bd24 make sendPing use Node by default
previous code was duplicating nodes, causing
sending many "dubious node" pings to the same node.
2016-05-02 15:25:15 -04:00
Adrien Béraud f9e6662f7d use Node in tellListener 2016-05-02 15:25:15 -04:00
Adrien Béraud 20662a9b4c cancel request when receiving token error 2016-05-02 15:25:15 -04:00
Adrien Béraud 995196ce08 clear getStatus after token error 2016-05-02 15:25:15 -04:00
Adrien Béraud 3367043e92 NE fixes 2016-05-02 15:25:15 -04:00
Simon Désaulniers 08dc666839 dht: network engine does the node ping count 2016-05-02 15:25:15 -04:00
Simon Désaulniers ce8af64775 removed unwanted check when receiving listen request 2016-05-02 15:25:15 -04:00