- added NETWORK_WIDE flag to remote dir model download

- added file priority strategy based on which files are requested first. This provides:
	- equal file speed for files with equal (source,priority)
	- effective priority speed for file of same source but different priority
- removed state variable load/save from turtle, as it's not needed anymore (FileRequest re-opens tunnels as needed)
- manage availability per peer instead of per file type: direct peer ids always assume file availability, while turtle tunnels don't

I still need to make the download queue work, and code this gui for it.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2133 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-01-26 20:40:21 +00:00
parent 0266420798
commit a70b106005
15 changed files with 352 additions and 209 deletions

View file

@ -424,7 +424,7 @@ std::list<RsItem*> p3turtle::saveList(bool& cleanup)
#endif
cleanup = true ;
std::list<RsItem*> lst ;
#ifdef TO_REMOVE
RsTurtleSearchResultItem *item = new RsTurtleSearchResultItem ;
item->PeerId("") ;
@ -441,11 +441,13 @@ std::list<RsItem*> p3turtle::saveList(bool& cleanup)
item->result.push_back(finfo) ;
}
lst.push_back(item) ;
#endif
return lst ;
}
bool p3turtle::loadList(std::list<RsItem*> load)
{
#ifdef TO_REMOVE
#ifdef P3TURTLE_DEBUG
std::cerr << "p3turtle: loading list..." << std::endl ;
#endif
@ -468,6 +470,7 @@ bool p3turtle::loadList(std::list<RsItem*> load)
}
delete item ;
}
#endif
return true ;
}
@ -797,8 +800,10 @@ void p3turtle::routeGenericTunnelItem(RsTurtleGenericTunnelItem *item)
case RS_TURTLE_SUBTYPE_FILE_MAP_REQUEST: handleRecvFileMapRequest(dynamic_cast<RsTurtleFileMapRequestItem *>(item)) ;
break ;
default:
std::cerr << "Unknown packet type received: id=" << (void*)(item->PacketSubType()) << std::endl ;
std::cerr << "WARNING: Unknown packet type received: id=" << (void*)(item->PacketSubType()) << ". Is somebody trying to DOS you ?" << std::endl ;
#ifdef P3TURTLE_DEBUG
exit(-1) ;
#endif
}
delete item ;

View file

@ -263,7 +263,7 @@ class p3turtle: public p3Service, public pqiMonitor, public RsTurtle,/* public f
/************* Communication with ftserver *******************/
/// Does the turtle router manages tunnels to this peer ? (this is not a
/// real id, but a fake one, that the turtle router is capable of connecting with a tunnel id).
bool isTurtlePeer(const std::string& peer_id) const ;
virtual bool isTurtlePeer(const std::string& peer_id) const ;
/// Examines the peer id, finds the turtle tunnel in it, and respond yes if the tunnel is ok and operational.
bool isOnline(const std::string& peer_id) const ;