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:
drbob 2012-01-08 16:14:40 +00:00
parent 9da96aef97
commit e432d89310
2 changed files with 153 additions and 10 deletions

View file

@ -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++)
{