- 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

@ -25,6 +25,7 @@
#include "util/rsdebug.h"
#include "util/rsdir.h"
#include "rsiface/rstypes.h"
const int ftserverzone = 29539;
#include "ft/ftserver.h"
@ -249,7 +250,7 @@ bool ftServer::FileRequest(std::string fname, std::string hash, uint64_t size, s
if(mFtController->alreadyHaveFile(hash))
return false ;
const DwlDetails details(fname, hash, size, dest, flags, srcIds, Normal);
const DwlDetails details(fname, hash, size, dest, flags, srcIds, PRIORITY_NORMAL);
mFtDwlQueue->insertDownload(details);
return true ;
@ -278,13 +279,14 @@ bool ftServer::FileClearCompleted()
/* Control of Downloads Priority. */
bool ftServer::changePriority(const std::string hash, int priority)
{
return mFtDwlQueue->changePriority(hash, (DwlPriority) priority);
mFtController->setPriority(hash, (DwlPriority) priority);
return true ;
}
bool ftServer::getPriority(const std::string hash, int & priority)
{
DwlPriority _priority;
int ret = mFtDwlQueue->getPriority(hash, _priority);
int ret = mFtController->getPriority(hash, _priority);
if (ret) {
priority = _priority;
}