Commit Graph
357 Commits
Author SHA1 Message Date
Simon Désaulniers d60672e8ba dht: remove unnecessary return value 2016-09-07 16:15:06 -04:00
Simon Désaulniers fd4cce4883 NetworkEngine: insertNode tells routing table 2016-09-07 15:54:16 -04:00
Adrien Béraud c33c2e7e95 crypto: add key, hash length parameters 2016-09-06 12:06:30 -04:00
Adrien Béraud 00ef660952 dht: hide more internal structures 2016-09-02 14:30:08 -04:00
Adrien Béraud 89d0d2f109 pht: fix compilation with pedantic 2016-09-01 18:02:23 -04:00
kaldoran 2d8fe502f2 Fix print of the lookup output 2016-09-01 18:02:23 -04:00
kaldoran 73df308250 Adding ZCurve algorithm 2016-09-01 18:02:23 -04:00
kaldoran cdca40cb59 Rework prefix [add flags] and prepare prefix 2016-09-01 18:02:23 -04:00
kaldoran 6f4923da2e dht: fix some typo 2016-09-01 18:02:23 -04:00
kaldoran ae26a2b39a Update of algorithm, by using new feature of api 2016-09-01 18:02:23 -04:00
kaldoran 48c40c8a27 pht: correction on the algorithm of complet node splitting 2016-09-01 18:02:23 -04:00
kaldoran a4a4eee495 pht: introduction of complet node splitting 2016-09-01 18:02:23 -04:00
kaldoran 6855aaa6f4 Correction of error on SwapBit 2016-09-01 18:02:23 -04:00
kaldoran 2aee4f418f Correction of the size of the prefix, now size does not include the size of the padding 2016-09-01 18:02:23 -04:00
kaldoran 95aef01a59 Pht : Fix out of range in isActiveBit function 2016-09-01 18:02:23 -04:00
kaldoran d2ccde4859 pht: bit padding when the key is too short 2016-09-01 18:02:23 -04:00
Simon Désaulniers 7ab64ea0e6 pht: validKey must check for key field value len 2016-09-01 18:02:23 -04:00
Simon Désaulniers fe1b8b88e1 pht: provide simpler lookup callback
From a user point of view, the structure Prefix doesn't make sense really. It's
better to provide a simpler callback function signature for the user then.
2016-09-01 18:02:23 -04:00
Simon Désaulniers b6832869b1 pht: moved some defs in cpp file 2016-09-01 18:02:23 -04:00
Simon Désaulniers f8cf1316ad pht: add key spec, handling maximum prefix length
This commit adds the new KeySpec in the Pht constructor signature so that all
keys used inside a same PHT structure have the same maximal length.
2016-09-01 18:02:23 -04:00
Simon Désaulniers 736606a845 pht: a Key is rather map str:Blob not str:Prefix 2016-09-01 18:02:23 -04:00
Adrien Béraud eb90fffb5e update for API changes 2016-09-01 18:02:23 -04:00
kaldoran 041e280bde benchmark: timing pht insert operations 2016-09-01 18:02:23 -04:00
kaldoran 33fae1cb66 pht: add prefix cache 2016-09-01 18:02:23 -04:00
Simon Désaulniers e85a423f6a Revert "[Bug] Correction of function commonBits" 2016-09-01 18:02:23 -04:00
kaldoran 532cb40665 Correction of error on commonBits 2016-09-01 18:02:23 -04:00
kaldoran dd58b0497e Correction of prefix, sometime some bit remain at they default value 2016-09-01 18:02:23 -04:00
Kaldoran cc070c80ba Fix the autotool Makefile, missing pht include
Fix indentation for pull request #37

Fix include error, and use only needed file in pht

Fix implementation of function in pht
2016-09-01 18:02:23 -04:00
Simon Désaulniers 5a5f7012d8 add pht insert test 2016-09-01 18:02:23 -04:00
Simon Désaulniers 5a239cddf7 pht: fix insert always to root bug
This makes the pht node recover all indexed data on a DHT node (maximum
MAX_NODE_ENTRY_COUNT per node) so that the pht node can be aware if it has to
split its data in the leaf.
2016-09-01 18:02:23 -04:00
Simon Désaulniers c8fcffbe6b fix possible out of range error in Prefix ctor 2016-09-01 18:02:23 -04:00
Simon Désaulniers 63c4eeb9c9 cover empty leaf case in inexact match lookup
In case this is inexact match lookup and we end up on an empty leaf (diffrent
than the root), the search goes on in the leaf's sibling subtree.
2016-09-01 18:02:23 -04:00
Simon Désaulniers d45f777099 pht tools 2016-09-01 18:02:23 -04:00
Simon Désaulniers 9c4035dd8f add inexact match lookup
This is meant to enable random lookup queries.
2016-09-01 18:02:23 -04:00
Simon Désaulniers acc2b71c86 base pht indexation 2016-09-01 18:02:23 -04:00
Adrien Béraud b3401828e4 dht: set "connecting" state when waiting for a ping 2016-08-25 00:42:50 -04:00
Adrien Béraud 2759a136df infohash: add istream operator overload 2016-08-16 10:27:31 -04:00
Adrien Béraud 690682408b build with -pedantic-errors, fix pedantic build errors 2016-08-16 10:26:44 -04:00
Simon Désaulniers 5c41cbb964 dht: value pagination
Instead of literally asking to a node all values for givent `h`, we first ask
for all ids the node has. Then, we concurently and individually ask for each
values that match each id we recovered in our first request.
2016-08-09 15:43:55 -04:00
Simon Désaulniers e192e3beaf better indentation and comments 2016-08-09 15:42:05 -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
Adrien Béraud a1eaf2e83c Merge pull request #107 from sim590/minor-search-refactor
dht: more accurate name for requested nodes count
2016-08-05 23:03:25 -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
Simon Désaulniers f0a92d999c dht: more accurate name for requested nodes count
The number of currently requested nodes, formerly named currentGetRequests, was
renamed since it was not accurately describing the behavior. The number we are
counting is not the number of 'get' requests, but rather the number of nodes
being requested simultaneously.
2016-08-05 21:19:46 -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
Adrien Béraud 7383505dcc value: increase max value size to 16KiB 2016-08-01 10:47:21 -04:00
Nicolas 7721aa5643 api: Add value creation timepoint (#97) 2016-07-28 17:03:11 -04:00
Simon Désaulniers 62835bdc54 dht: make main store a vector<unique_ptr<Storage>>
Since the elements inside are going to be moved constantly during the life of
the node, this design is better. Also, it works around a crash when the store is
resized (elements inside moved) at some point (always happenned the 3rd time)
for some reason. This bug was known when compiled with LLVM >7.3.0 (>clang-703.0.31).
2016-07-22 16:57:46 -04:00
Simon Désaulniers f474f6499b value: missing return, errors on non-gcc
Gcc understands the syntax without return value, but this confuses other
compilers.
2016-07-18 14:18:37 -04:00