mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 02:55:18 -04:00
Improved the proxy/relay selection.
Limited Search Replies on Relay Servers. NB: Re-check this code! git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-dhtmods@4766 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9da96aef97
commit
e432d89310
2 changed files with 153 additions and 10 deletions
|
@ -655,15 +655,23 @@ void bdNode::processRemoteQuery()
|
|||
case BD_QUERY_NEIGHBOURS:
|
||||
{
|
||||
/* search bdSpace for neighbours */
|
||||
//std::list<bdId> excludeList;
|
||||
|
||||
std::list<bdId> nearList;
|
||||
std::multimap<bdMetric, bdId> nearest;
|
||||
std::multimap<bdMetric, bdId>::iterator it;
|
||||
|
||||
//mNodeSpace.find_nearest_nodes(&(query.mQuery), BITDHT_QUERY_NEIGHBOUR_PEERS, excludeList, nearest, 0);
|
||||
|
||||
if (mRelayMode == BITDHT_RELAYS_SERVER)
|
||||
{
|
||||
std::list<bdId> excludeList;
|
||||
mNodeSpace.find_nearest_nodes_with_flags(&(query.mQuery),
|
||||
BITDHT_QUERY_NEIGHBOUR_PEERS,
|
||||
excludeList, nearest, BITDHT_PEER_STATUS_DHT_RELAY_SERVER);
|
||||
}
|
||||
else
|
||||
{
|
||||
mNodeSpace.find_nearest_nodes(&(query.mQuery), BITDHT_QUERY_NEIGHBOUR_PEERS, nearest);
|
||||
}
|
||||
|
||||
for(it = nearest.begin(); it != nearest.end(); it++)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue