Commit Graph
220 Commits
Author SHA1 Message Date
Adrien Béraud 92613f5fbf net: improve request state consistency 2016-05-03 18:33:38 -04:00
Adrien Béraud 733cf335d3 dht: limit concurrent search requests instead of steps intervals 2016-05-03 12:05:14 -04:00
Adrien Béraud 92df1f5a2b dht: recompute step time for existing searches 2016-05-02 18:42:14 -04:00
Adrien Béraud 0890ed9c4f move routing table to a different file 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 f7a334a979 dht: make sure searchStep is called when needed. 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 4a9ae1d42a handling the reply_time in network engine 2016-05-02 15:25:15 -04:00
Simon Désaulniers ee31881825 changed license to GPLv3 2016-05-02 15:25:15 -04:00
Simon Désaulniers dafae934c4 actually cancelling listens when appropriate
Just before, listens were "cancelled", but unsued memory in network engine's
data structure would be left there.
2016-05-02 15:25:15 -04:00
Simon Désaulniers 2a88117dd4 netengine: merging RequestStatus, Request
This is a change needed to enable easy and clean cancelling of requests from the
upper layer (dht layer). Request's content that was hidden from (dht layer) is
still hidden (private), but enable NetworkEngine as a friend of the Request
class for accessing lower layer attributes.
2016-05-02 15:25:15 -04:00
Simon Désaulniers 65cd72b8d5 dht: remove reply time setting. handled by net engine 2016-05-02 15:25:15 -04:00
Simon Désaulniers 72f4d58f7e dht: fix listen confirmation, getvalues concurency
Upon receiving a listen confirmation, a Request structure shall be left alive in
the NetworkEngine's map so that further 'get values' answers for that same
listen can be treated properly. This was sort of handled before, but with a
concurency issue between the set of values returned associated to the listen
request and just before the listenConfirmation was returned.
2016-05-02 15:25:15 -04:00
Simon Désaulniers 717b58fcc6 dht: handling get token only after 'get' request. 2016-05-02 15:25:15 -04:00
Simon Désaulniers d52fb6ad5d make sure expire functions are scheduled 2016-05-02 15:25:15 -04:00
Simon Désaulniers 0240ca6394 dht: fix first put hang due to empty token
At some point, old nodes didn't provide token in a find_node request. Since a
find_node request may be used to initiate a search before a 'put', now have to
be provided. In order to discard old nodes which don't have that behavior, we
blacklist the nodes.
2016-05-02 15:25:15 -04:00
Simon Désaulniers 1ecfbb7181 properly handle empty token case after get request
Upon a response, if token is empty, the treatment of the response shall not be
done.
2016-05-02 15:25:15 -04:00
Simon Désaulniers 608be10446 using SearchNode::last_get_reply in dumpsearch 2016-05-02 15:25:15 -04:00
Simon Désaulniers d5f67e97d0 dht: let Dht::inserNode set SearchNode reply time 2016-05-02 15:25:15 -04:00
Simon Désaulniers ba5953bc6b reference instead of copy, removing forgotten cout 2016-05-02 15:25:15 -04:00
Simon Désaulniers dc1e1d9454 stop stacking jobs now rescheduling instead 2016-05-02 15:25:15 -04:00
Simon Désaulniers 674f25fcae fix listen was not handled... 2016-05-02 15:25:15 -04:00
Simon Désaulniers abd358f57d fix: 'get' requests responses without values... 2016-05-02 15:25:15 -04:00
Simon Désaulniers 2f26580881 fix unused variables... 2016-05-02 15:25:15 -04:00
Simon Désaulniers 6a46466493 dht: mybucket grow time optimization
this lets a new network grow faster and appropriately triggers bucket
neighborhood maintenance when intended: when our bucket is growing.
2016-05-02 15:25:15 -04:00
Simon Désaulniers 120dc509cf fix 'get' request stuck/slow, handling candidates
Making a call to searchSendGetValues() when a 'get' request finishes/expires,
accelerates the process in the same way it was done before. Candidates also let
the requests resolve faster.
2016-05-02 15:25:15 -04:00
Simon Désaulniers ff72487b02 fix no values sent in response to 'find' request
This was due to using the wrong InfoHash field from the ParsedMessage when
responding to 'find' request.
2016-05-02 15:25:15 -04:00
Simon Désaulniers 8cc6c21d19 keeping last get reply time in search nodes 2016-05-02 15:25:15 -04:00
Simon Désaulniers 66e8cf431b add missing MSG_CONFIRM definition 2016-05-02 15:25:15 -04:00
Simon Désaulniers e32e480a12 fixing scheduler wrong time returned on run() 2016-05-02 15:25:15 -04:00
Simon Désaulniers 8b35e2bc09 fix some segfault errors 2016-05-02 15:25:15 -04:00
Simon Désaulniers 24527e921a preventing Dht::confirmNode to be auto scheduled twice
Since Dht::confirmNode is called on a connectivity change, Dht::confirmNode
would be scheduled and rescheduling itself all over again and such a chain of
event would be triggered *each* time a connectivity change happenned. We only
want Dht::confirmNode to be called once when a connectivity change happen. Then,
the initial chain of confirmNode calls will go on fine.
2016-05-02 15:25:15 -04:00
Simon Désaulniers 6c0c87a53f fix variable captured in lambda after findNode
findNode requests are not related to searches. No operations other than calling
newNode() is required after a findNode request have completed. NetworkEngine
already takes care of calling newNode().
2016-05-02 15:25:15 -04:00
Simon Désaulniers e001d8560d fix ipv4 vs ipv6 search node dumping properly 2016-05-02 15:25:15 -04:00
Simon Désaulniers 848d95c8b2 Properly handling request status as shared_ptr
this is concerning the shared_ptr objects in SearchNode.
2016-05-02 15:25:15 -04:00
Simon Désaulniers e8ec4bb8b4 fix scheduler wrong returned time upon run()
makes more sense to return the "nextJobTime".
2016-05-02 15:25:15 -04:00
Simon Désaulniers 82f67f642f fix wrong nodes serlialisation bug 2016-05-02 15:25:14 -04:00
Simon Désaulniers 407d717c5e handling request status editing in NetworkEngine 2016-05-02 15:25:14 -04:00
Simon Désaulniers cc0d3f4195 all refs to Search are std::shared_ptr 2016-05-02 15:25:14 -04:00
Simon Désaulniers b74e42eae9 using scheduler for timing dht operations 2016-05-02 15:25:14 -04:00
Simon Désaulniers 8364a61082 moving network stuff to NetworkEngine
dht_socket variables can be handled in NetworkEngine. Dht::network_engine now
declared as value instead of std::unique_ptr.
2016-05-02 15:25:14 -04:00
Simon Désaulniers 4b13fcac70 fixing various compilation errors 2016-05-02 15:25:14 -04:00
Simon Désaulniers 17216afe0f request status fixups 2016-05-02 15:25:14 -04:00
Simon Désaulniers 2df9cd5363 send* calls to network engine + on done routines 2016-05-02 15:25:14 -04:00
Simon Désaulniers 69fab983f5 [WIP] ondone + searchnode status 2016-05-02 15:25:14 -04:00
Simon Désaulniers 74b265641d checking UDP replytime in network engine 2016-05-02 15:25:14 -04:00
Simon Désaulniers ba8d1af008 using map for ordering searches structures
Now ordering searches by InfoHash in different maps (ipv4 and ipv6). This is a
minor improvement for queries over searches.
2016-05-02 15:25:14 -04:00