mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-06 16:15:23 -04:00
fixed flags conflicts
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-FileSharingPermissions@5758 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
dc82cee700
commit
e753f22909
43 changed files with 383 additions and 386 deletions
|
@ -46,7 +46,7 @@
|
|||
#include <fstream>
|
||||
|
||||
//***********
|
||||
//#define FIM_DEBUG 1
|
||||
#define FIM_DEBUG 1
|
||||
// ***********/
|
||||
|
||||
FileIndexMonitor::FileIndexMonitor(CacheStrapper *cs, NotifyBase *cb_in,std::string cachedir, std::string pid,const std::string& config_dir)
|
||||
|
@ -267,7 +267,7 @@ FileIndexMonitor::~FileIndexMonitor()
|
|||
/* Data cleanup - TODO */
|
||||
}
|
||||
|
||||
int FileIndexMonitor::SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,uint32_t flags,const std::string& peer_id)
|
||||
int FileIndexMonitor::SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,FileSearchFlags flags,const std::string& peer_id)
|
||||
{
|
||||
results.clear();
|
||||
std::list<FileEntry *> firesults;
|
||||
|
@ -280,7 +280,7 @@ int FileIndexMonitor::SearchKeywords(std::list<std::string> keywords, std::list<
|
|||
return filterResults(firesults,results,flags,peer_id) ;
|
||||
}
|
||||
|
||||
int FileIndexMonitor::SearchBoolExp(Expression *exp, std::list<DirDetails>& results,uint32_t flags,const std::string& peer_id) const
|
||||
int FileIndexMonitor::SearchBoolExp(Expression *exp, std::list<DirDetails>& results,FileSearchFlags flags,const std::string& peer_id) const
|
||||
{
|
||||
results.clear();
|
||||
std::list<FileEntry *> firesults;
|
||||
|
@ -293,7 +293,7 @@ int FileIndexMonitor::SearchBoolExp(Expression *exp, std::list<DirDetails>& resu
|
|||
return filterResults(firesults,results,flags,peer_id) ;
|
||||
}
|
||||
|
||||
int FileIndexMonitor::filterResults(std::list<FileEntry*>& firesults,std::list<DirDetails>& results,TransferInfoFlags flags,const std::string& peer_id) const
|
||||
int FileIndexMonitor::filterResults(std::list<FileEntry*>& firesults,std::list<DirDetails>& results,FileSearchFlags flags,const std::string& peer_id) const
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if((flags & ~RS_FILE_HINTS_PERMISSION_MASK) > 0)
|
||||
|
@ -304,14 +304,14 @@ int FileIndexMonitor::filterResults(std::list<FileEntry*>& firesults,std::list<D
|
|||
for(std::list<FileEntry*>::const_iterator rit(firesults.begin()); rit != firesults.end(); ++rit)
|
||||
{
|
||||
DirDetails cdetails ;
|
||||
RequestDirDetails (*rit,cdetails,0);
|
||||
RequestDirDetails (*rit,cdetails,FileSearchFlags(0u));
|
||||
#ifdef FIM_DEBUG
|
||||
std::cerr << "Filtering candidate " << (*rit)->name << ", flags=" << cdetails.flags ;
|
||||
#endif
|
||||
|
||||
TransferInfoFlags permission_flags = rsPeers->computePeerPermissionFlags(peer_id,cdetails.flags,cdetails.parent_groups) ;
|
||||
FileSearchFlags permission_flags = rsPeers->computePeerPermissionFlags(peer_id,cdetails.flags,cdetails.parent_groups) ;
|
||||
|
||||
if (cdetails.type == DIR_TYPE_FILE && (( permission_flags & flags & RS_FILE_HINTS_PERMISSION_MASK) > 0 ))
|
||||
if (cdetails.type == DIR_TYPE_FILE && ( permission_flags & flags ))
|
||||
{
|
||||
cdetails.id = "Local";
|
||||
results.push_back(cdetails);
|
||||
|
@ -327,7 +327,7 @@ int FileIndexMonitor::filterResults(std::list<FileEntry*>& firesults,std::list<D
|
|||
return !results.empty() ;
|
||||
}
|
||||
|
||||
bool FileIndexMonitor::findLocalFile(std::string hash,uint32_t hint_flags, const std::string& peer_id,std::string &fullpath, uint64_t &size) const
|
||||
bool FileIndexMonitor::findLocalFile(std::string hash,FileSearchFlags hint_flags, const std::string& peer_id,std::string &fullpath, uint64_t &size) const
|
||||
{
|
||||
std::list<FileEntry *> results;
|
||||
bool ok = false;
|
||||
|
@ -354,12 +354,12 @@ bool FileIndexMonitor::findLocalFile(std::string hash,uint32_t hint_flags, const
|
|||
|
||||
// turn share flags into hint flags
|
||||
|
||||
uint32_t shflh = rsPeers->computePeerPermissionFlags(peer_id,share_flags,parent_groups) ;
|
||||
FileSearchFlags shflh = rsPeers->computePeerPermissionFlags(peer_id,share_flags,parent_groups) ;
|
||||
#ifdef FIM_DEBUG
|
||||
std::cerr << "FileIndexMonitor::findLocalFile: Filtering candidate " << fe->name << ", flags=" << share_flags << ", hint_flags=" << hint_flags << std::endl ;
|
||||
#endif
|
||||
|
||||
if(shflh & (hint_flags & RS_FILE_HINTS_PERMISSION_MASK))
|
||||
if(shflh & hint_flags)
|
||||
{
|
||||
#ifdef FIM_DEBUG
|
||||
std::cerr << "FileIndexMonitor::findLocalFile() Found Name: " << fe->name << std::endl;
|
||||
|
@ -533,13 +533,13 @@ void FileIndexMonitor::run()
|
|||
updateCycle();
|
||||
|
||||
#ifdef FIM_DEBUG
|
||||
{
|
||||
RsStackMutex mtx(fiMutex) ;
|
||||
std::cerr <<"*********** FileIndex **************" << std::endl ;
|
||||
fi.printFileIndex(std::cerr) ;
|
||||
std::cerr <<"************** END *****************" << std::endl ;
|
||||
std::cerr << std::endl ;
|
||||
}
|
||||
// {
|
||||
// RsStackMutex mtx(fiMutex) ;
|
||||
// std::cerr <<"*********** FileIndex **************" << std::endl ;
|
||||
// fi.printFileIndex(std::cerr) ;
|
||||
// std::cerr <<"************** END *****************" << std::endl ;
|
||||
// std::cerr << std::endl ;
|
||||
// }
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -820,7 +820,7 @@ void FileIndexMonitor::updateCycle()
|
|||
|
||||
#ifdef FIM_DEBUG
|
||||
/* print out the new directory structure */
|
||||
fi.printFileIndex(std::cerr);
|
||||
// fi.printFileIndex(std::cerr);
|
||||
#endif
|
||||
/* now if we have changed things -> restore file/hash it/and
|
||||
* tell the CacheSource
|
||||
|
@ -1012,8 +1012,6 @@ void FileIndexMonitor::locked_saveFileIndexes()
|
|||
//
|
||||
#ifdef FIM_DEBUG
|
||||
std::cerr << "FileIndexMonitor::updateCycle() FileIndex modified ... updating" << std::endl;
|
||||
std::cerr << "FileIndexMonitor::updateCycle() saving total file list to to: " << fname_total << std::endl ;
|
||||
std::cerr << "FileIndexMonitor::updateCycle() saving browsable file list to: " << fname_browsable << std::endl ;
|
||||
#endif
|
||||
// Make for each peer the list of forbidden shared directories. Make a separate cache file for each different set.
|
||||
// To figure out which sets are different, we index them by the set of forbidden indexes from the directory list.
|
||||
|
@ -1027,13 +1025,14 @@ void FileIndexMonitor::locked_saveFileIndexes()
|
|||
for(std::list<std::string>::const_iterator it(online_ids.begin());it!=online_ids.end();++it)
|
||||
{
|
||||
std::cerr << "About to save, with the following restrictions:" << std::endl ;
|
||||
std::cerr << "Peer : " << *it << std::endl;
|
||||
|
||||
std::set<std::string> forbidden_dirs ;
|
||||
for(std::map<std::string,SharedDirInfo>::const_iterator dit(directoryMap.begin());dit!=directoryMap.end();++dit)
|
||||
{
|
||||
std::cerr << " dir=" << dit->first << " : " ;
|
||||
|
||||
uint32_t permission_flags = rsPeers->computePeerPermissionFlags(*it,dit->second.shareflags,dit->second.parent_groups) ;
|
||||
FileSearchFlags permission_flags = rsPeers->computePeerPermissionFlags(*it,dit->second.shareflags,dit->second.parent_groups) ;
|
||||
|
||||
if(!(permission_flags & RS_FILE_HINTS_BROWSABLE))
|
||||
{
|
||||
|
@ -1083,8 +1082,7 @@ void FileIndexMonitor::locked_saveFileIndexes()
|
|||
if(size > 0)
|
||||
{
|
||||
#ifdef FIM_DEBUG
|
||||
std::cerr << "FileIndexMonitor::updateCycle() saved with hash:" << calchash;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "FileIndexMonitor::updateCycle() saved with hash:" << hash << std::endl;
|
||||
#endif
|
||||
|
||||
/* should clean up the previous cache.... */
|
||||
|
@ -1350,7 +1348,7 @@ uint32_t FileIndexMonitor::getType(void *ref) const
|
|||
|
||||
return fi.getType(ref) ;
|
||||
}
|
||||
int FileIndexMonitor::RequestDirDetails(void *ref, DirDetails &details, uint32_t flags) const
|
||||
int FileIndexMonitor::RequestDirDetails(void *ref, DirDetails &details, FileSearchFlags flags) const
|
||||
{
|
||||
/* remove unused parameter warnings */
|
||||
(void) flags;
|
||||
|
@ -1390,7 +1388,7 @@ int FileIndexMonitor::RequestDirDetails(void *ref, DirDetails &details, uint32_t
|
|||
details.hash = "";
|
||||
details.path = "root";
|
||||
details.age = 0;
|
||||
details.flags = 0;
|
||||
details.flags.clear() ;
|
||||
details.min_age = 0 ;
|
||||
|
||||
return true ;
|
||||
|
@ -1415,7 +1413,7 @@ int FileIndexMonitor::RequestDirDetails(void *ref, DirDetails &details, uint32_t
|
|||
|
||||
void FileIndexMonitor::locked_findShareFlagsAndParentGroups(FileEntry *file,FileStorageFlags& flags,std::list<std::string>& parent_groups) const
|
||||
{
|
||||
flags = 0 ;
|
||||
flags.clear() ;
|
||||
static const FileStorageFlags PERMISSION_MASK = DIR_FLAGS_BROWSABLE_OTHERS | DIR_FLAGS_NETWORK_WIDE_OTHERS | DIR_FLAGS_BROWSABLE_GROUPS | DIR_FLAGS_NETWORK_WIDE_GROUPS ;
|
||||
|
||||
DirEntry *dir = dynamic_cast<DirEntry*>(file) ;
|
||||
|
@ -1437,7 +1435,8 @@ void FileIndexMonitor::locked_findShareFlagsAndParentGroups(FileEntry *file,File
|
|||
std::cerr << "*********** ERROR *********** In " << __PRETTY_FUNCTION__ << std::endl ;
|
||||
else
|
||||
{
|
||||
flags = it->second.shareflags & PERMISSION_MASK ;
|
||||
flags = it->second.shareflags ;
|
||||
flags &= PERMISSION_MASK ;
|
||||
parent_groups = it->second.parent_groups ;
|
||||
}
|
||||
#ifdef FIM_DEBUG2
|
||||
|
|
|
@ -111,12 +111,12 @@ class FileIndexMonitor: public CacheSource, public RsThread
|
|||
virtual ~FileIndexMonitor();
|
||||
|
||||
/* external interface for filetransfer */
|
||||
bool findLocalFile(std::string hash,uint32_t flags,const std::string& peer_id, std::string &fullpath, uint64_t &size) const;
|
||||
bool findLocalFile(std::string hash,FileSearchFlags flags,const std::string& peer_id, std::string &fullpath, uint64_t &size) const;
|
||||
|
||||
int SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,uint32_t flags,const std::string& peer_id) ;
|
||||
int SearchBoolExp(Expression *exp, std::list<DirDetails> &results,uint32_t flags,const std::string& peer_id) const ;
|
||||
int SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,FileSearchFlags flags,const std::string& peer_id) ;
|
||||
int SearchBoolExp(Expression *exp, std::list<DirDetails> &results,FileSearchFlags flags,const std::string& peer_id) const ;
|
||||
|
||||
int filterResults(std::list<FileEntry*>& firesults,std::list<DirDetails>& results,TransferInfoFlags flags,const std::string& peer_id) const ;
|
||||
int filterResults(std::list<FileEntry*>& firesults,std::list<DirDetails>& results,FileSearchFlags flags,const std::string& peer_id) const ;
|
||||
|
||||
|
||||
/* external interface for local access to files */
|
||||
|
@ -136,7 +136,7 @@ class FileIndexMonitor: public CacheSource, public RsThread
|
|||
void updateCycle();
|
||||
|
||||
// Interface for browsing dir hirarchy
|
||||
int RequestDirDetails(void*, DirDetails&, uint32_t) const ;
|
||||
int RequestDirDetails(void*, DirDetails&, FileSearchFlags) const ;
|
||||
uint32_t getType(void*) const ;
|
||||
int RequestDirDetails(const std::string& path, DirDetails &details) const ;
|
||||
|
||||
|
|
|
@ -1346,7 +1346,7 @@ bool FileIndex::extractData(void *ref,DirDetails& details)
|
|||
details.ref = file;
|
||||
details.hash = file->hash;
|
||||
details.age = now - file->modtime;
|
||||
details.flags = 0;//file->pop;
|
||||
details.flags.clear() ;
|
||||
|
||||
/* find parent pointer, and row */
|
||||
details.parent = file->parent ;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "dbase/fistore.h"
|
||||
#include "retroshare/rsexpr.h"
|
||||
#include "retroshare/rsfiles.h"
|
||||
#include "serialiser/rsserviceids.h"
|
||||
#include "pqi/p3peermgr.h"
|
||||
|
||||
|
@ -200,7 +201,7 @@ int FileIndexStore::RequestDirDetails(const std::string& uid, const std::string&
|
|||
#endif
|
||||
}
|
||||
|
||||
int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, uint32_t flags) const
|
||||
int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, FileSearchFlags flags) const
|
||||
{
|
||||
/* remove unused parameter warnings */
|
||||
(void) flags;
|
||||
|
@ -258,7 +259,7 @@ int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, uint32_t f
|
|||
details.path = "";
|
||||
details.count = indices.size();
|
||||
details.age = 0;
|
||||
details.flags = 0;
|
||||
details.flags.clear() ;
|
||||
details.min_age = 0;
|
||||
|
||||
unlockData();
|
||||
|
@ -329,7 +330,7 @@ int FileIndexStore::SearchHash(std::string hash, std::list<FileDetail> &results)
|
|||
}
|
||||
|
||||
|
||||
int FileIndexStore::SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,uint32_t flags) const
|
||||
int FileIndexStore::SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,FileSearchFlags flags) const
|
||||
{
|
||||
lockData();
|
||||
std::map<RsPeerId, FileIndex *>::const_iterator pit;
|
||||
|
@ -341,7 +342,7 @@ int FileIndexStore::SearchKeywords(std::list<std::string> keywords, std::list<Di
|
|||
#ifdef FIS_DEBUG
|
||||
std::cerr << "FileIndexStore::SearchKeywords()" << std::endl;
|
||||
#endif
|
||||
if(flags & DIR_FLAGS_REMOTE)
|
||||
if(flags & RS_FILE_HINTS_REMOTE)
|
||||
for(pit = indices.begin(); pit != indices.end(); pit++)
|
||||
{
|
||||
firesults.clear();
|
||||
|
@ -359,7 +360,7 @@ int FileIndexStore::SearchKeywords(std::list<std::string> keywords, std::list<Di
|
|||
}
|
||||
}
|
||||
|
||||
if(flags & DIR_FLAGS_LOCAL)
|
||||
if(flags & RS_FILE_HINTS_LOCAL)
|
||||
if (localindex)
|
||||
{
|
||||
firesults.clear();
|
||||
|
|
|
@ -75,7 +75,7 @@ virtual int loadCache(const CacheData &data); /* actual load, once data availa
|
|||
int SearchHash(std::string hash, std::list<FileDetail> &results) const;
|
||||
|
||||
/* Search Interface - For Search Interface */
|
||||
int SearchKeywords(std::list<std::string> terms, std::list<DirDetails> &results,uint32_t flags) const;
|
||||
int SearchKeywords(std::list<std::string> terms, std::list<DirDetails> &results,FileSearchFlags flags) const;
|
||||
|
||||
/* Search Interface - for Adv Search Interface */
|
||||
int searchBoolExp(Expression * exp, std::list<DirDetails> &results) const;
|
||||
|
@ -83,7 +83,7 @@ virtual int loadCache(const CacheData &data); /* actual load, once data availa
|
|||
|
||||
/* Search Interface - For Directory Access */
|
||||
int RequestDirDetails(const std::string& uid, const std::string& path, DirDetails &details) const;
|
||||
int RequestDirDetails(void *ref, DirDetails &details, uint32_t flags) const;
|
||||
int RequestDirDetails(void *ref, DirDetails &details, FileSearchFlags flags) const;
|
||||
uint32_t getType(void *ref) const ;
|
||||
|
||||
private:
|
||||
|
|
|
@ -83,7 +83,7 @@ ftFileControl::ftFileControl()
|
|||
|
||||
ftFileControl::ftFileControl(std::string fname,
|
||||
std::string tmppath, std::string dest,
|
||||
uint64_t size, std::string hash, uint32_t flags,
|
||||
uint64_t size, std::string hash, TransferRequestFlags flags,
|
||||
ftFileCreator *fc, ftTransferModule *tm)
|
||||
:mName(fname), mCurrentPath(tmppath), mDestination(dest),
|
||||
mTransfer(tm), mCreator(fc), mState(DOWNLOADING), mHash(hash),
|
||||
|
@ -127,7 +127,7 @@ bool ftController::getFileDownloadChunksDetails(const std::string& hash,FileChun
|
|||
if(it != mDownloads.end())
|
||||
{
|
||||
it->second->mCreator->getChunkMap(info) ;
|
||||
info.flags = it->second->mFlags ;
|
||||
//info.flags = it->second->mFlags ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ bool ftController::getFileDownloadChunksDetails(const std::string& hash,FileChun
|
|||
info.file_size = it->second->mSize ;
|
||||
info.strategy = mDefaultChunkStrategy ;
|
||||
info.chunk_size = ChunkMap::CHUNKMAP_FIXED_CHUNK_SIZE ;
|
||||
info.flags = it->second->mFlags ;
|
||||
//info.flags = it->second->mFlags ;
|
||||
uint32_t nb_chunks = it->second->mSize/ChunkMap::CHUNKMAP_FIXED_CHUNK_SIZE ;
|
||||
if(it->second->mSize % ChunkMap::CHUNKMAP_FIXED_CHUNK_SIZE != 0)
|
||||
++nb_chunks ;
|
||||
|
@ -327,7 +327,7 @@ void ftController::cleanCacheDownloads()
|
|||
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
|
||||
|
||||
for(std::map<std::string,ftFileControl*>::iterator it(mDownloads.begin());it!=mDownloads.end();++it)
|
||||
if (((it->second)->mFlags & RS_FILE_HINTS_CACHE) && it->second->mState != ftFileControl::DOWNLOADING)
|
||||
if (((it->second)->mFlags & RS_FILE_REQ_CACHE) && it->second->mState != ftFileControl::DOWNLOADING)
|
||||
// check if a cache file is downloaded, if the case, timeout the transfer after TIMOUT_CACHE_FILE_TRANSFER
|
||||
{
|
||||
#ifdef CONTROL_DEBUG
|
||||
|
@ -429,7 +429,7 @@ void ftController::checkDownloadQueue()
|
|||
for(uint32_t p=0;p<_queue.size();++p)
|
||||
{
|
||||
if(p < _min_prioritized_transfers)
|
||||
if(_queue[p]->mFlags & RS_FILE_HINTS_CACHE) // cache file. add to potential move list
|
||||
if(_queue[p]->mFlags & RS_FILE_REQ_CACHE) // cache file. add to potential move list
|
||||
to_move_before.push_back(p) ;
|
||||
else
|
||||
++user_transfers ; // count one more user file in the prioritized range.
|
||||
|
@ -438,7 +438,7 @@ void ftController::checkDownloadQueue()
|
|||
if(to_move_after.size() + user_transfers >= _min_prioritized_transfers) // we caught enough transfers to move back to the top of the queue.
|
||||
break ;
|
||||
|
||||
if(!(_queue[p]->mFlags & RS_FILE_HINTS_CACHE)) // non cache file. add to potential move list
|
||||
if(!(_queue[p]->mFlags & RS_FILE_REQ_CACHE)) // non cache file. add to potential move list
|
||||
to_move_after.push_back(p) ;
|
||||
}
|
||||
}
|
||||
|
@ -471,7 +471,7 @@ void ftController::locked_addToQueue(ftFileControl* ftfc,int add_strategy)
|
|||
// This is costly, so only use this in case we really need it.
|
||||
//
|
||||
uint32_t pos =0;
|
||||
while(pos < _queue.size() && (pos < _min_prioritized_transfers || (_queue[pos]->mFlags & RS_FILE_HINTS_CACHE)>0) )
|
||||
while(pos < _queue.size() && (pos < _min_prioritized_transfers || (_queue[pos]->mFlags & RS_FILE_REQ_CACHE)>0) )
|
||||
++pos ;
|
||||
|
||||
_queue.push_back(NULL) ;
|
||||
|
@ -622,7 +622,7 @@ void ftController::locked_checkQueueElement(uint32_t pos)
|
|||
|
||||
_queue[pos]->mState = ftFileControl::DOWNLOADING ;
|
||||
|
||||
if(_queue[pos]->mFlags & RS_FILE_HINTS_ANONYMOUS_ROUTING)
|
||||
if(_queue[pos]->mFlags & RS_FILE_REQ_ANONYMOUS_ROUTING)
|
||||
mTurtle->monitorFileTunnels(_queue[pos]->mName,_queue[pos]->mHash,_queue[pos]->mSize) ;
|
||||
}
|
||||
|
||||
|
@ -631,7 +631,7 @@ void ftController::locked_checkQueueElement(uint32_t pos)
|
|||
_queue[pos]->mState = ftFileControl::QUEUED ;
|
||||
_queue[pos]->mCreator->closeFile() ;
|
||||
|
||||
if(_queue[pos]->mFlags & RS_FILE_HINTS_ANONYMOUS_ROUTING)
|
||||
if(_queue[pos]->mFlags & RS_FILE_REQ_ANONYMOUS_ROUTING)
|
||||
mTurtle->stopMonitoringFileTunnels(_queue[pos]->mHash) ;
|
||||
}
|
||||
}
|
||||
|
@ -766,8 +766,8 @@ bool ftController::completeFile(std::string hash)
|
|||
uint64_t size = 0;
|
||||
uint32_t state = 0;
|
||||
uint32_t period = 0;
|
||||
uint32_t flags = 0;
|
||||
uint32_t extraflags = 0;
|
||||
TransferRequestFlags flags ;
|
||||
TransferRequestFlags extraflags ;
|
||||
uint32_t completeCount = 0;
|
||||
|
||||
{
|
||||
|
@ -855,7 +855,7 @@ bool ftController::completeFile(std::string hash)
|
|||
size = fc->mSize;
|
||||
state = fc->mState;
|
||||
period = 30 * 24 * 3600; /* 30 days */
|
||||
extraflags = 0;
|
||||
extraflags.clear() ;
|
||||
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "CompleteFile(): size = " << size << std::endl ;
|
||||
|
@ -866,7 +866,7 @@ bool ftController::completeFile(std::string hash)
|
|||
locked_queueRemove(it->second->mQueuePosition) ;
|
||||
|
||||
/* switch map */
|
||||
if (!(fc->mFlags & RS_FILE_HINTS_CACHE)) /* clean up completed cache files automatically */
|
||||
if (!(fc->mFlags & RS_FILE_REQ_CACHE)) /* clean up completed cache files automatically */
|
||||
{
|
||||
mCompleted[fc->mHash] = fc;
|
||||
completeCount = mCompleted.size();
|
||||
|
@ -875,7 +875,7 @@ bool ftController::completeFile(std::string hash)
|
|||
|
||||
mDownloads.erase(it);
|
||||
|
||||
if(flags & RS_FILE_HINTS_ANONYMOUS_ROUTING)
|
||||
if(flags & RS_FILE_REQ_ANONYMOUS_ROUTING)
|
||||
mTurtle->stopMonitoringFileTunnels(hash_to_suppress) ;
|
||||
|
||||
} /******* UNLOCKED ********/
|
||||
|
@ -887,13 +887,13 @@ bool ftController::completeFile(std::string hash)
|
|||
|
||||
/* If it has a callback - do it now */
|
||||
|
||||
if(flags & ( RS_FILE_HINTS_CACHE | RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_MEDIA))
|
||||
if(flags & ( RS_FILE_REQ_CACHE | RS_FILE_REQ_EXTRA))// | RS_FILE_HINTS_MEDIA))
|
||||
{
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "ftController::completeFile() doing Callback, callbackflags:" << (flags & ( RS_FILE_HINTS_CACHE | RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_MEDIA)) ;
|
||||
std::cerr << "ftController::completeFile() doing Callback, callbackflags:" << (flags & ( RS_FILE_HINTS_CACHE | RS_FILE_HINTS_EXTRA ));//| RS_FILE_HINTS_MEDIA)) ;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
if(flags & RS_FILE_HINTS_CACHE)
|
||||
if(flags & RS_FILE_REQ_CACHE)
|
||||
{
|
||||
/* callback */
|
||||
if (state == ftFileControl::COMPLETED)
|
||||
|
@ -915,7 +915,7 @@ bool ftController::completeFile(std::string hash)
|
|||
}
|
||||
}
|
||||
|
||||
if(flags & RS_FILE_HINTS_EXTRA)
|
||||
if(flags & RS_FILE_REQ_EXTRA)
|
||||
{
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "ftController::completeFile() adding to ExtraList";
|
||||
|
@ -925,13 +925,13 @@ bool ftController::completeFile(std::string hash)
|
|||
mExtraList->addExtraFile(path, hash, size, period, extraflags);
|
||||
}
|
||||
|
||||
if(flags & RS_FILE_HINTS_MEDIA)
|
||||
{
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "ftController::completeFile() NULL MEDIA callback";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
}
|
||||
// if(flags & RS_FILE_HINTS_MEDIA)
|
||||
// {
|
||||
//#ifdef CONTROL_DEBUG
|
||||
// std::cerr << "ftController::completeFile() NULL MEDIA callback";
|
||||
// std::cerr << std::endl;
|
||||
//#endif
|
||||
// }
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -942,7 +942,7 @@ bool ftController::completeFile(std::string hash)
|
|||
}
|
||||
|
||||
/* Notify GUI */
|
||||
if ((flags & RS_FILE_HINTS_CACHE) == 0) {
|
||||
if ((flags & RS_FILE_REQ_CACHE) == 0) {
|
||||
pqiNotify *notify = getPqiNotify();
|
||||
if (notify) {
|
||||
notify->AddPopupMessage(RS_POPUP_DOWNLOAD, hash, name, "");
|
||||
|
@ -994,7 +994,7 @@ bool ftController::handleAPendingRequest()
|
|||
std::cerr << "Requesting pending hash " << req.mHash << std::endl ;
|
||||
#endif
|
||||
|
||||
FileRequest(req.mName, req.mHash, req.mSize, req.mDest, req.mFlags, req.mSrcIds);
|
||||
FileRequest(req.mName, req.mHash, req.mSize, req.mDest, TransferRequestFlags(req.mFlags), req.mSrcIds);
|
||||
|
||||
{
|
||||
// See whether there is a pendign chunk map recorded for this hash.
|
||||
|
@ -1043,14 +1043,14 @@ bool ftController::alreadyHaveFile(const std::string& hash, FileInfo &info)
|
|||
return true ;
|
||||
|
||||
// check for file lists
|
||||
if (mSearch->search(hash, DIR_FLAGS_PERMISSIONS_MASK | RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_SPEC_ONLY, info))
|
||||
if (mSearch->search(hash, RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_SPEC_ONLY, info))
|
||||
return true ;
|
||||
|
||||
return false ;
|
||||
}
|
||||
|
||||
bool ftController::FileRequest(const std::string& fname, const std::string& hash,
|
||||
uint64_t size, const std::string& dest, TransferInfoFlags flags,
|
||||
uint64_t size, const std::string& dest, TransferRequestFlags flags,
|
||||
const std::list<std::string> &_srcIds)
|
||||
{
|
||||
std::list<std::string> srcIds(_srcIds) ;
|
||||
|
@ -1129,7 +1129,7 @@ bool ftController::FileRequest(const std::string& fname, const std::string& has
|
|||
#endif
|
||||
|
||||
uint32_t rate = 0;
|
||||
if (flags & RS_FILE_HINTS_BACKGROUND)
|
||||
if (flags & RS_FILE_REQ_BACKGROUND)
|
||||
rate = FT_CNTRL_SLOW_RATE;
|
||||
else
|
||||
rate = FT_CNTRL_STANDARD_RATE;
|
||||
|
@ -1191,7 +1191,7 @@ bool ftController::FileRequest(const std::string& fname, const std::string& has
|
|||
}
|
||||
} /******* UNLOCKED ********/
|
||||
|
||||
if(!(flags & RS_FILE_HINTS_NO_SEARCH))
|
||||
if(!(flags & RS_FILE_REQ_NO_SEARCH))
|
||||
{
|
||||
/* do a source search - for any extra sources */
|
||||
// add sources only in direct mode
|
||||
|
@ -1242,10 +1242,10 @@ bool ftController::FileRequest(const std::string& fname, const std::string& has
|
|||
|
||||
// We check that flags are consistent.
|
||||
|
||||
if(flags & RS_FILE_HINTS_ANONYMOUS_ROUTING)
|
||||
if(flags & RS_FILE_REQ_ANONYMOUS_ROUTING)
|
||||
mTurtle->monitorFileTunnels(fname,hash,size) ;
|
||||
|
||||
bool assume_availability = flags & RS_FILE_HINTS_CACHE ; // assume availability for cache files
|
||||
bool assume_availability = flags & RS_FILE_REQ_CACHE ; // assume availability for cache files
|
||||
|
||||
ftFileCreator *fc = new ftFileCreator(savepath, size, hash,assume_availability);
|
||||
ftTransferModule *tm = new ftTransferModule(fc, mDataplex,this);
|
||||
|
@ -1859,7 +1859,7 @@ bool ftController::RequestCacheFile(RsPeerId id, std::string path, std::string h
|
|||
return false ;
|
||||
}
|
||||
|
||||
FileRequest(hash, hash, size, path, RS_FILE_HINTS_CACHE | RS_FILE_HINTS_NO_SEARCH, ids);
|
||||
FileRequest(hash, hash, size, path, RS_FILE_REQ_CACHE | RS_FILE_REQ_NO_SEARCH, ids);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1959,7 +1959,7 @@ bool ftController::saveList(bool &cleanup, std::list<RsItem *>& saveData)
|
|||
|
||||
/* ignore cache files. As this is small files, better download them again from scratch at restart.*/
|
||||
|
||||
if (fit->second->mFlags & RS_FILE_HINTS_CACHE)
|
||||
if (fit->second->mFlags & RS_FILE_REQ_CACHE)
|
||||
{
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "ftcontroller::saveList(): Not saving (callback) file entry " << fit->second->mName << ", " << fit->second->mHash << ", " << fit->second->mSize << std::endl ;
|
||||
|
@ -1983,7 +1983,7 @@ bool ftController::saveList(bool &cleanup, std::list<RsItem *>& saveData)
|
|||
rft->file.hash = fit->second->mHash;
|
||||
rft->file.filesize = fit->second->mSize;
|
||||
RsDirUtil::removeTopDir(fit->second->mDestination, rft->file.path); /* remove fname */
|
||||
rft->flags = fit->second->mFlags;
|
||||
rft->flags = fit->second->mFlags.toUInt32();
|
||||
rft->state = fit->second->mState;
|
||||
fit->second->mTransfer->getFileSources(rft->allPeerIds.ids);
|
||||
|
||||
|
@ -2032,7 +2032,7 @@ bool ftController::saveList(bool &cleanup, std::list<RsItem *>& saveData)
|
|||
rft->file.hash = pit->mHash;
|
||||
rft->file.filesize = pit->mSize;
|
||||
RsDirUtil::removeTopDir(pit->mDest, rft->file.path); /* remove fname */
|
||||
rft->flags = pit->mFlags;
|
||||
rft->flags = pit->mFlags.toUInt32();
|
||||
rft->allPeerIds.ids = pit->mSrcIds;
|
||||
}
|
||||
|
||||
|
@ -2093,7 +2093,7 @@ bool ftController::loadList(std::list<RsItem *>& load)
|
|||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "ftController::loadList(): requesting " << rsft->file.name << ", " << rsft->file.hash << ", " << rsft->file.filesize << std::endl ;
|
||||
#endif
|
||||
FileRequest(rsft->file.name, rsft->file.hash, rsft->file.filesize, rsft->file.path, rsft->flags, rsft->allPeerIds.ids);
|
||||
FileRequest(rsft->file.name, rsft->file.hash, rsft->file.filesize, rsft->file.path, TransferRequestFlags(rsft->flags), rsft->allPeerIds.ids);
|
||||
|
||||
{
|
||||
RsStackMutex mtx(ctrlMutex) ;
|
||||
|
|
|
@ -73,7 +73,7 @@ class ftFileControl
|
|||
|
||||
ftFileControl();
|
||||
ftFileControl(std::string fname, std::string tmppath, std::string dest,
|
||||
uint64_t size, std::string hash, uint32_t flags,
|
||||
uint64_t size, std::string hash, TransferRequestFlags flags,
|
||||
ftFileCreator *fc, ftTransferModule *tm);
|
||||
|
||||
std::string mName;
|
||||
|
@ -84,7 +84,7 @@ class ftFileControl
|
|||
uint32_t mState;
|
||||
std::string mHash;
|
||||
uint64_t mSize;
|
||||
uint32_t mFlags;
|
||||
TransferRequestFlags mFlags;
|
||||
time_t mCreateTime;
|
||||
uint32_t mQueuePriority ;
|
||||
uint32_t mQueuePosition ;
|
||||
|
@ -94,7 +94,7 @@ class ftPendingRequest
|
|||
{
|
||||
public:
|
||||
ftPendingRequest(const std::string& fname, const std::string& hash,
|
||||
uint64_t size, const std::string& dest, uint32_t flags,
|
||||
uint64_t size, const std::string& dest, TransferRequestFlags flags,
|
||||
const std::list<std::string> &srcIds)
|
||||
: mName(fname), mHash(hash), mSize(size),
|
||||
mDest(dest), mFlags(flags),mSrcIds(srcIds) { return; }
|
||||
|
@ -105,7 +105,7 @@ class ftPendingRequest
|
|||
std::string mHash;
|
||||
uint64_t mSize;
|
||||
std::string mDest;
|
||||
uint32_t mFlags;
|
||||
TransferRequestFlags mFlags;
|
||||
std::list<std::string> mSrcIds;
|
||||
};
|
||||
|
||||
|
@ -129,7 +129,7 @@ class ftController: public CacheTransfer, public RsThread, public pqiMonitor, pu
|
|||
/***************************************************************/
|
||||
|
||||
bool FileRequest(const std::string& fname, const std::string& hash,
|
||||
uint64_t size, const std::string& dest, TransferInfoFlags flags,
|
||||
uint64_t size, const std::string& dest, TransferRequestFlags flags,
|
||||
const std::list<std::string> &sourceIds);
|
||||
|
||||
/// Do we already have this file, either in download or in file lists ?
|
||||
|
|
|
@ -142,7 +142,7 @@ bool ftDataMultiplex::FileDownloads(std::list<std::string> &hashs)
|
|||
}
|
||||
|
||||
|
||||
bool ftDataMultiplex::FileDetails(const std::string &hash, TransferInfoFlags hintsflag, FileInfo &info)
|
||||
bool ftDataMultiplex::FileDetails(const std::string &hash, FileSearchFlags hintsflag, FileInfo &info)
|
||||
{
|
||||
#ifdef MPLEX_DEBUG
|
||||
std::cerr << "ftDataMultiplex::FileDetails(";
|
||||
|
@ -1313,10 +1313,10 @@ bool ftDataMultiplex::handleSearchRequest(const std::string& peerId, const std::
|
|||
*/
|
||||
|
||||
FileInfo info;
|
||||
uint32_t hintflags = RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_SPEC_ONLY ;
|
||||
FileSearchFlags hintflags = RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_SPEC_ONLY ;
|
||||
|
||||
if(rsTurtle->isTurtlePeer(peerId))
|
||||
hintflags |= RS_FILE_HINTS_ANONYMOUS_ROUTING ;
|
||||
hintflags |= RS_FILE_HINTS_NETWORK_WIDE ;
|
||||
else
|
||||
hintflags |= RS_FILE_HINTS_CACHE ;
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ class ftDataMultiplex: public ftDataRecv, public RsQueueThread
|
|||
/* get Details of File Transfers */
|
||||
bool FileUploads(std::list<std::string> &hashs);
|
||||
bool FileDownloads(std::list<std::string> &hashs);
|
||||
bool FileDetails(const std::string &hash, TransferInfoFlags hintsflag, FileInfo &info);
|
||||
bool FileDetails(const std::string &hash, FileSearchFlags hintsflag, FileInfo &info);
|
||||
|
||||
void deleteUnusedServers() ;
|
||||
void handlePendingCrcRequests() ;
|
||||
|
|
|
@ -37,7 +37,7 @@ ftFiStore::ftFiStore(CacheStrapper *cs, CacheTransfer *cft, NotifyBase *cb_in,p3
|
|||
return;
|
||||
}
|
||||
|
||||
bool ftFiStore::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const
|
||||
bool ftFiStore::search(const std::string &hash, FileSearchFlags hintflags, FileInfo &info) const
|
||||
{
|
||||
/* could use hintflags to specify which bits of fileinfo to use additionally.
|
||||
eg. hintflags & FT_SEARCH_PEER_ID, then only return matching peers + hash.
|
||||
|
@ -128,12 +128,12 @@ ftFiMonitor::ftFiMonitor(CacheStrapper *cs,NotifyBase *cb_in, std::string cached
|
|||
return;
|
||||
}
|
||||
|
||||
bool ftFiMonitor::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const
|
||||
bool ftFiMonitor::search(const std::string &hash, FileSearchFlags hintflags, FileInfo &info) const
|
||||
{
|
||||
std::cerr << "(EE) ********* ftFiMonitor expects a peer id in search()!" << std::endl;
|
||||
return false ;
|
||||
}
|
||||
bool ftFiMonitor::search(const std::string &hash, uint32_t hintflags, const std::string& peer_id,FileInfo &info) const
|
||||
bool ftFiMonitor::search(const std::string &hash, FileSearchFlags hintflags, const std::string& peer_id,FileInfo &info) const
|
||||
{
|
||||
uint64_t fsize;
|
||||
std::string path;
|
||||
|
@ -147,7 +147,8 @@ bool ftFiMonitor::search(const std::string &hash, uint32_t hintflags, const std:
|
|||
// Setup search flags according to hintflags. Originally flags was 0. I (cyril) don't know
|
||||
// why we don't just pass hintflags there, so I tried to keep the idea.
|
||||
//
|
||||
uint32_t flags = hintflags & (RS_FILE_HINTS_BROWSABLE | RS_FILE_HINTS_NETWORK_WIDE);
|
||||
FileSearchFlags flags = hintflags ;
|
||||
flags &= (RS_FILE_HINTS_BROWSABLE | RS_FILE_HINTS_NETWORK_WIDE);
|
||||
|
||||
if(findLocalFile(hash, flags,peer_id,path, fsize))
|
||||
{
|
||||
|
@ -246,7 +247,7 @@ bool ftFiMonitor::saveList(bool &cleanup, std::list<RsItem *>& sList)
|
|||
RsFileConfigItem *fi = new RsFileConfigItem();
|
||||
fi->file.path = (*it).filename ;
|
||||
fi->file.name = (*it).virtualname ;
|
||||
fi->flags = (*it).shareflags ;
|
||||
fi->flags = (*it).shareflags.toUInt32() ;
|
||||
|
||||
sList.push_back(fi);
|
||||
}
|
||||
|
@ -293,7 +294,7 @@ bool ftFiMonitor::loadList(std::list<RsItem *>& load)
|
|||
/* for each item, check it exists ....
|
||||
* - remove any that are dead (or flag?)
|
||||
*/
|
||||
static const uint32_t PERMISSION_MASK = DIR_FLAGS_BROWSABLE_OTHERS | DIR_FLAGS_NETWORK_WIDE_OTHERS | DIR_FLAGS_BROWSABLE_GROUPS | DIR_FLAGS_NETWORK_WIDE_GROUPS ;
|
||||
static const FileStorageFlags PERMISSION_MASK = DIR_FLAGS_BROWSABLE_OTHERS | DIR_FLAGS_NETWORK_WIDE_OTHERS | DIR_FLAGS_BROWSABLE_GROUPS | DIR_FLAGS_NETWORK_WIDE_GROUPS ;
|
||||
|
||||
#ifdef DEBUG_ELIST
|
||||
std::cerr << "ftFiMonitor::loadList()";
|
||||
|
@ -347,7 +348,8 @@ bool ftFiMonitor::loadList(std::list<RsItem *>& load)
|
|||
SharedDirInfo info ;
|
||||
info.filename = RsDirUtil::convertPathToUnix(fi->file.path);
|
||||
info.virtualname = fi->file.name;
|
||||
info.shareflags = fi->flags & PERMISSION_MASK ;
|
||||
info.shareflags = FileStorageFlags(fi->flags) ;
|
||||
info.shareflags &= PERMISSION_MASK ;
|
||||
|
||||
dirList.push_back(info) ;
|
||||
}
|
||||
|
@ -359,6 +361,11 @@ bool ftFiMonitor::loadList(std::list<RsItem *>& load)
|
|||
|
||||
void ftFiMonitor::updateShareFlags(const SharedDirInfo& info)
|
||||
{
|
||||
std::cerr << "Updating share flags:" << std::endl;
|
||||
std::cerr << " Directory : " << info.filename << std::endl;
|
||||
std::cerr << " Virtual : " << info.virtualname << std::endl;
|
||||
std::cerr << " Flags : " << info.shareflags << std::endl;
|
||||
|
||||
FileIndexMonitor::updateShareFlags(info);
|
||||
|
||||
/* flag for config */
|
||||
|
@ -382,7 +389,7 @@ ftCacheStrapper::ftCacheStrapper(p3LinkMgr *lm)
|
|||
}
|
||||
|
||||
/* overloaded search function */
|
||||
bool ftCacheStrapper::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const
|
||||
bool ftCacheStrapper::search(const std::string &hash, FileSearchFlags hintflags, FileInfo &info) const
|
||||
{
|
||||
/* remove unused parameter warnings */
|
||||
(void) hintflags;
|
||||
|
|
|
@ -52,7 +52,7 @@ class ftFiStore: public FileIndexStore, public ftSearch
|
|||
RsPeerId ownid, std::string cachedir);
|
||||
|
||||
/* overloaded search function */
|
||||
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const;
|
||||
virtual bool search(const std::string &hash, FileSearchFlags hintflags, FileInfo &info) const;
|
||||
};
|
||||
|
||||
class ftFiMonitor: public FileIndexMonitor, public ftSearch, public p3Config
|
||||
|
@ -61,8 +61,8 @@ class ftFiMonitor: public FileIndexMonitor, public ftSearch, public p3Config
|
|||
ftFiMonitor(CacheStrapper *cs,NotifyBase *cb_in, std::string cachedir, std::string pid,const std::string& config_dir);
|
||||
|
||||
/* overloaded search function */
|
||||
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const;
|
||||
virtual bool search(const std::string &hash, uint32_t hintflags, const std::string& peer_id, FileInfo &info) const;
|
||||
virtual bool search(const std::string &hash, FileSearchFlags hintflags, FileInfo &info) const;
|
||||
virtual bool search(const std::string &hash, FileSearchFlags hintflags, const std::string& peer_id, FileInfo &info) const;
|
||||
|
||||
/* overloaded set dirs enables config indication */
|
||||
virtual void setSharedDirectories(const std::list<SharedDirInfo>& dirList);
|
||||
|
@ -94,7 +94,7 @@ class ftCacheStrapper: public CacheStrapper, public ftSearch
|
|||
ftCacheStrapper(p3LinkMgr *cm);
|
||||
|
||||
/* overloaded search function */
|
||||
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const;
|
||||
virtual bool search(const std::string &hash, FileSearchFlags hintflags, FileInfo &info) const;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ void ftExtraList::hashAFile()
|
|||
**/
|
||||
|
||||
bool ftExtraList::addExtraFile(std::string path, std::string hash,
|
||||
uint64_t size, uint32_t period, uint32_t flags)
|
||||
uint64_t size, uint32_t period, TransferRequestFlags flags)
|
||||
{
|
||||
#ifdef DEBUG_ELIST
|
||||
std::cerr << "ftExtraList::addExtraFile() path: " << path;
|
||||
|
@ -177,7 +177,7 @@ bool ftExtraList::addExtraFile(std::string path, std::string hash,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ftExtraList::removeExtraFile(std::string hash, uint32_t flags)
|
||||
bool ftExtraList::removeExtraFile(std::string hash, TransferRequestFlags flags)
|
||||
{
|
||||
/* remove unused parameter warnings */
|
||||
(void) flags;
|
||||
|
@ -273,12 +273,12 @@ bool ftExtraList::cleanupOldFiles()
|
|||
}
|
||||
|
||||
|
||||
bool ftExtraList::cleanupEntry(std::string /*path*/, uint32_t flags)
|
||||
bool ftExtraList::cleanupEntry(std::string /*path*/, TransferRequestFlags flags)
|
||||
{
|
||||
if (flags & RS_FILE_CONFIG_CLEANUP_DELETE)
|
||||
{
|
||||
/* Delete the file? - not yet! */
|
||||
}
|
||||
// if (flags & RS_FILE_CONFIG_CLEANUP_DELETE)
|
||||
// {
|
||||
// /* Delete the file? - not yet! */
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -287,7 +287,7 @@ bool ftExtraList::cleanupEntry(std::string /*path*/, uint32_t flags)
|
|||
* file is removed after period.
|
||||
**/
|
||||
|
||||
bool ftExtraList::hashExtraFile(std::string path, uint32_t period, uint32_t flags)
|
||||
bool ftExtraList::hashExtraFile(std::string path, uint32_t period, TransferRequestFlags flags)
|
||||
{
|
||||
#ifdef DEBUG_ELIST
|
||||
std::cerr << "ftExtraList::hashExtraFile() path: " << path;
|
||||
|
@ -326,14 +326,14 @@ bool ftExtraList::hashExtraFileDone(std::string path, FileInfo &info)
|
|||
}
|
||||
hash = it->second;
|
||||
}
|
||||
return search(hash, 0, info);
|
||||
return search(hash, FileSearchFlags(0), info);
|
||||
}
|
||||
|
||||
/***
|
||||
* Search Function - used by File Transfer
|
||||
*
|
||||
**/
|
||||
bool ftExtraList::search(const std::string &hash, uint32_t /*hintflags*/, FileInfo &info) const
|
||||
bool ftExtraList::search(const std::string &hash, FileSearchFlags /*hintflags*/, FileInfo &info) const
|
||||
{
|
||||
|
||||
#ifdef DEBUG_ELIST
|
||||
|
@ -396,7 +396,7 @@ bool ftExtraList::saveList(bool &cleanup, std::list<RsItem *>& sList)
|
|||
fi->file.hash = (it->second).info.hash;
|
||||
fi->file.filesize = (it->second).info.size;
|
||||
fi->file.age = (it->second).info.age;
|
||||
fi->flags = (it->second).flags;
|
||||
fi->flags = (it->second).flags.toUInt32();
|
||||
|
||||
sList.push_back(fi);
|
||||
}
|
||||
|
@ -444,7 +444,7 @@ bool ftExtraList::loadList(std::list<RsItem *>& load)
|
|||
if (ts > (time_t)fi->file.age)
|
||||
{
|
||||
/* to old */
|
||||
cleanupEntry(fi->file.path, fi->flags);
|
||||
cleanupEntry(fi->file.path, TransferRequestFlags(fi->flags));
|
||||
delete (*it);
|
||||
continue ;
|
||||
}
|
||||
|
@ -461,7 +461,7 @@ bool ftExtraList::loadList(std::list<RsItem *>& load)
|
|||
details.info.hash = fi->file.hash;
|
||||
details.info.size = fi->file.filesize;
|
||||
details.info.age = fi->file.age; /* time that we remove it. */
|
||||
details.flags = fi->flags;
|
||||
details.flags = TransferRequestFlags(fi->flags);
|
||||
|
||||
/* stick it in the available queue */
|
||||
mFiles[details.info.hash] = details;
|
||||
|
|
|
@ -65,38 +65,38 @@
|
|||
class FileDetails
|
||||
{
|
||||
public:
|
||||
FileDetails()
|
||||
{
|
||||
return;
|
||||
}
|
||||
FileDetails()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FileDetails(std::string path, uint32_t p, uint32_t f)
|
||||
{
|
||||
info.path = path;
|
||||
period = p;
|
||||
flags = f;
|
||||
}
|
||||
|
||||
FileDetails(FileInfo &i, uint32_t p, uint32_t f)
|
||||
{
|
||||
info = i;
|
||||
period = p;
|
||||
flags = f;
|
||||
}
|
||||
FileDetails(std::string path, uint32_t p, TransferRequestFlags f)
|
||||
{
|
||||
info.path = path;
|
||||
period = p;
|
||||
flags = f;
|
||||
}
|
||||
|
||||
FileInfo info;
|
||||
FileDetails(FileInfo &i, uint32_t p, TransferRequestFlags f)
|
||||
{
|
||||
info = i;
|
||||
period = p;
|
||||
flags = f;
|
||||
}
|
||||
|
||||
FileInfo info;
|
||||
|
||||
#if 0 /*** WHAT IS NEEDED ***/
|
||||
std::list<std::string> sources;
|
||||
std::string path;
|
||||
std::string fname;
|
||||
std::string hash;
|
||||
uint64_t size;
|
||||
std::list<std::string> sources;
|
||||
std::string path;
|
||||
std::string fname;
|
||||
std::string hash;
|
||||
uint64_t size;
|
||||
#endif
|
||||
|
||||
uint32_t start;
|
||||
uint32_t period;
|
||||
uint32_t flags;
|
||||
uint32_t start;
|
||||
uint32_t period;
|
||||
TransferRequestFlags flags;
|
||||
};
|
||||
|
||||
const uint32_t FT_DETAILS_CLEANUP = 0x0100; /* remove when it expires */
|
||||
|
@ -118,9 +118,9 @@ class ftExtraList: public RsThread, public p3Config, public ftSearch
|
|||
**/
|
||||
|
||||
bool addExtraFile(std::string path, std::string hash,
|
||||
uint64_t size, uint32_t period, uint32_t flags);
|
||||
uint64_t size, uint32_t period, TransferRequestFlags flags);
|
||||
|
||||
bool removeExtraFile(std::string hash, uint32_t flags);
|
||||
bool removeExtraFile(std::string hash, TransferRequestFlags flags);
|
||||
bool moveExtraFile(std::string fname, std::string hash, uint64_t size,
|
||||
std::string destpath);
|
||||
|
||||
|
@ -130,7 +130,7 @@ bool moveExtraFile(std::string fname, std::string hash, uint64_t size,
|
|||
* file is removed after period.
|
||||
**/
|
||||
|
||||
bool hashExtraFile(std::string path, uint32_t period, uint32_t flags);
|
||||
bool hashExtraFile(std::string path, uint32_t period, TransferRequestFlags flags);
|
||||
bool hashExtraFileDone(std::string path, FileInfo &info);
|
||||
|
||||
/***
|
||||
|
@ -138,7 +138,7 @@ bool hashExtraFileDone(std::string path, FileInfo &info);
|
|||
* implementation of ftSearch.
|
||||
*
|
||||
**/
|
||||
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const;
|
||||
virtual bool search(const std::string &hash, FileSearchFlags hintflags, FileInfo &info) const;
|
||||
|
||||
/***
|
||||
* Thread Main Loop
|
||||
|
@ -159,7 +159,7 @@ virtual bool loadList(std::list<RsItem *>& load);
|
|||
/* Worker Functions */
|
||||
void hashAFile();
|
||||
bool cleanupOldFiles();
|
||||
bool cleanupEntry(std::string path, uint32_t flags);
|
||||
bool cleanupEntry(std::string path, TransferRequestFlags flags);
|
||||
|
||||
mutable RsMutex extMutex;
|
||||
|
||||
|
|
|
@ -39,9 +39,9 @@ ftFileSearch::ftFileSearch()
|
|||
}
|
||||
}
|
||||
|
||||
bool ftFileSearch::addSearchMode(ftSearch *search, uint32_t hintflags)
|
||||
bool ftFileSearch::addSearchMode(ftSearch *search, FileSearchFlags hintflags)
|
||||
{
|
||||
hintflags &= 0x00ffffff;
|
||||
hintflags &= FileSearchFlags(0x000000ff);
|
||||
|
||||
#ifdef DEBUG_SEARCH
|
||||
std::cerr << "ftFileSearch::addSearchMode() : " << hintflags;
|
||||
|
@ -51,7 +51,7 @@ bool ftFileSearch::addSearchMode(ftSearch *search, uint32_t hintflags)
|
|||
uint32_t i;
|
||||
for (i = 0; i < MAX_SEARCHS; i++)
|
||||
{
|
||||
uint32_t hints = hintflags >> i;
|
||||
uint32_t hints = hintflags.toUInt32() >> i;
|
||||
if (hints & 0x0001)
|
||||
{
|
||||
/* has the flag */
|
||||
|
@ -75,7 +75,7 @@ bool ftFileSearch::addSearchMode(ftSearch *search, uint32_t hintflags)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool ftFileSearch::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const
|
||||
bool ftFileSearch::search(const std::string &hash, FileSearchFlags hintflags, FileInfo &info) const
|
||||
{
|
||||
uint32_t hints, i;
|
||||
|
||||
|
@ -87,7 +87,7 @@ bool ftFileSearch::search(const std::string &hash, uint32_t hintflags, FileInfo
|
|||
|
||||
for (i = 0; i < MAX_SEARCHS; i++)
|
||||
{
|
||||
hints = hintflags >> i;
|
||||
hints = hintflags.toUInt32() >> i;
|
||||
if (hints & 0x0001)
|
||||
{
|
||||
/* has the flag */
|
||||
|
@ -140,7 +140,7 @@ bool ftFileSearch::search(const std::string &hash, uint32_t hintflags, FileInfo
|
|||
*/
|
||||
for (i = 0; i < MAX_SEARCHS; i++)
|
||||
{
|
||||
hints = hintflags >> i;
|
||||
hints = hintflags.toUInt32() >> i;
|
||||
if (hints & 0x0001)
|
||||
{
|
||||
continue;
|
||||
|
@ -180,7 +180,7 @@ bool ftFileSearch::search(const std::string &hash, uint32_t hintflags, FileInfo
|
|||
}
|
||||
|
||||
|
||||
bool ftSearchDummy::search(std::string /*hash*/, uint32_t hintflags, FileInfo &/*info*/) const
|
||||
bool ftSearchDummy::search(std::string /*hash*/, FileSearchFlags hintflags, FileInfo &/*info*/) const
|
||||
{
|
||||
/* remove unused parameter warnings */
|
||||
(void) hintflags;
|
||||
|
|
|
@ -44,8 +44,8 @@ class ftFileSearch: public ftSearch
|
|||
|
||||
ftFileSearch();
|
||||
|
||||
bool addSearchMode(ftSearch *search, uint32_t hintflags);
|
||||
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const;
|
||||
bool addSearchMode(ftSearch *search, FileSearchFlags hintflags);
|
||||
virtual bool search(const std::string &hash, FileSearchFlags hintflags, FileInfo &info) const;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -42,12 +42,12 @@ class ftSearch
|
|||
public:
|
||||
ftSearch() { return; }
|
||||
virtual ~ftSearch() { return; }
|
||||
virtual bool search(const std::string &hash, uint32_t hintflags,const std::string& peer_id, FileInfo &info) const
|
||||
virtual bool search(const std::string &hash, FileSearchFlags hintflags,const std::string& peer_id, FileInfo &info) const
|
||||
{
|
||||
std::cerr << "Non overloaded search method called!!!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const = 0;
|
||||
virtual bool search(const std::string &hash, FileSearchFlags hintflags, FileInfo &info) const = 0;
|
||||
|
||||
};
|
||||
|
||||
|
@ -58,7 +58,7 @@ class ftSearchDummy: public ftSearch
|
|||
|
||||
ftSearchDummy() { return; }
|
||||
virtual ~ftSearchDummy() { return; }
|
||||
virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const;
|
||||
virtual bool search(std::string hash, FileSearchFlags hintflags, FileInfo &info) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -270,7 +270,7 @@ bool ftServer::alreadyHaveFile(const std::string& hash, FileInfo &info)
|
|||
return mFtController->alreadyHaveFile(hash, info);
|
||||
}
|
||||
|
||||
bool ftServer::FileRequest(const std::string& fname, const std::string& hash, uint64_t size, const std::string& dest, TransferInfoFlags flags, const std::list<std::string>& srcIds)
|
||||
bool ftServer::FileRequest(const std::string& fname, const std::string& hash, uint64_t size, const std::string& dest, TransferRequestFlags flags, const std::list<std::string>& srcIds)
|
||||
{
|
||||
std::string error_string ;
|
||||
|
||||
|
@ -415,7 +415,7 @@ bool ftServer::FileUploads(std::list<std::string> &hashs)
|
|||
return mFtDataplex->FileUploads(hashs);
|
||||
}
|
||||
|
||||
bool ftServer::FileDetails(const std::string &hash, TransferInfoFlags hintflags, FileInfo &info)
|
||||
bool ftServer::FileDetails(const std::string &hash, FileSearchFlags hintflags, FileInfo &info)
|
||||
{
|
||||
if (hintflags & RS_FILE_HINTS_DOWNLOAD)
|
||||
if(mFtController->FileDetails(hash, info))
|
||||
|
@ -429,7 +429,7 @@ bool ftServer::FileDetails(const std::string &hash, TransferInfoFlags hintflags,
|
|||
// file, we skip the call to fileDetails() for efficiency reasons.
|
||||
//
|
||||
FileInfo info2 ;
|
||||
if( (!(info.transfer_info_flags & RS_FILE_HINTS_CACHE)) && mFtController->FileDetails(hash, info2))
|
||||
if( (!(info.transfer_info_flags & RS_FILE_REQ_CACHE)) && mFtController->FileDetails(hash, info2))
|
||||
info.fname = info2.fname ;
|
||||
|
||||
return true ;
|
||||
|
@ -447,17 +447,17 @@ bool ftServer::FileDetails(const std::string &hash, TransferInfoFlags hintflags,
|
|||
/***************************************************************/
|
||||
|
||||
bool ftServer::ExtraFileAdd(std::string fname, std::string hash, uint64_t size,
|
||||
uint32_t period, TransferInfoFlags flags)
|
||||
uint32_t period, TransferRequestFlags flags)
|
||||
{
|
||||
return mFtExtra->addExtraFile(fname, hash, size, period, flags);
|
||||
}
|
||||
|
||||
bool ftServer::ExtraFileRemove(std::string hash, TransferInfoFlags flags)
|
||||
bool ftServer::ExtraFileRemove(std::string hash, TransferRequestFlags flags)
|
||||
{
|
||||
return mFtExtra->removeExtraFile(hash, flags);
|
||||
}
|
||||
|
||||
bool ftServer::ExtraFileHash(std::string localpath, uint32_t period, TransferInfoFlags flags)
|
||||
bool ftServer::ExtraFileHash(std::string localpath, uint32_t period, TransferRequestFlags flags)
|
||||
{
|
||||
return mFtExtra->hashExtraFile(localpath, period, flags);
|
||||
}
|
||||
|
@ -497,7 +497,7 @@ int ftServer::RequestDirDetails(const std::string& uid, const std::string& path,
|
|||
return mFiStore->RequestDirDetails(uid, path, details);
|
||||
}
|
||||
|
||||
int ftServer::RequestDirDetails(void *ref, DirDetails &details, FileStorageFlags flags)
|
||||
int ftServer::RequestDirDetails(void *ref, DirDetails &details, FileSearchFlags flags)
|
||||
{
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::RequestDirDetails(ref:" << ref;
|
||||
|
@ -516,7 +516,7 @@ int ftServer::RequestDirDetails(void *ref, DirDetails &details, FileStorageFlags
|
|||
else
|
||||
return mFiStore->RequestDirDetails(ref, details, flags);
|
||||
}
|
||||
uint32_t ftServer::getType(void *ref, TransferInfoFlags flags)
|
||||
uint32_t ftServer::getType(void *ref, FileSearchFlags flags)
|
||||
{
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::RequestDirDetails(ref:" << ref;
|
||||
|
@ -540,12 +540,12 @@ uint32_t ftServer::getType(void *ref, TransferInfoFlags flags)
|
|||
/***************************************************************/
|
||||
|
||||
|
||||
int ftServer::SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,uint32_t flags)
|
||||
int ftServer::SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,FileSearchFlags flags)
|
||||
{
|
||||
std::cerr << "(WW) ********* ftServer::SearchBoolExp:: called without peer id" << std::endl;
|
||||
return 0 ;
|
||||
}
|
||||
int ftServer::SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,uint32_t flags,const std::string& peer_id)
|
||||
int ftServer::SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,FileSearchFlags flags,const std::string& peer_id)
|
||||
{
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::SearchKeywords()";
|
||||
|
@ -564,12 +564,12 @@ int ftServer::SearchKeywords(std::list<std::string> keywords, std::list<DirDetai
|
|||
return mFiStore->SearchKeywords(keywords, results,flags);
|
||||
}
|
||||
|
||||
int ftServer::SearchBoolExp(Expression * exp, std::list<DirDetails> &results,uint32_t flags)
|
||||
int ftServer::SearchBoolExp(Expression * exp, std::list<DirDetails> &results,FileSearchFlags flags)
|
||||
{
|
||||
std::cerr << "(WW) ********* ftServer::SearchBoolExp:: called without peer id" << std::endl;
|
||||
return 0 ;
|
||||
}
|
||||
int ftServer::SearchBoolExp(Expression * exp, std::list<DirDetails> &results,uint32_t flags,const std::string& peer_id)
|
||||
int ftServer::SearchBoolExp(Expression * exp, std::list<DirDetails> &results,FileSearchFlags flags,const std::string& peer_id)
|
||||
{
|
||||
if(flags & RS_FILE_HINTS_LOCAL)
|
||||
return mFiMon->SearchBoolExp(exp,results,flags,peer_id) ;
|
||||
|
|
|
@ -125,7 +125,7 @@ ftController *getController() const { return mFtController ; }
|
|||
* Control of Downloads
|
||||
***/
|
||||
virtual bool alreadyHaveFile(const std::string& hash, FileInfo &info);
|
||||
virtual bool FileRequest(const std::string& fname, const std::string& hash, uint64_t size, const std::string& dest, TransferInfoFlags flags, const std::list<std::string>& srcIds);
|
||||
virtual bool FileRequest(const std::string& fname, const std::string& hash, uint64_t size, const std::string& dest, TransferRequestFlags flags, const std::list<std::string>& srcIds);
|
||||
virtual bool FileCancel(const std::string& hash);
|
||||
virtual bool FileControl(const std::string& hash, uint32_t flags);
|
||||
virtual bool FileClearCompleted();
|
||||
|
@ -154,7 +154,7 @@ virtual bool clearDownload(const std::string hash);
|
|||
***/
|
||||
virtual bool FileDownloads(std::list<std::string> &hashs);
|
||||
virtual bool FileUploads(std::list<std::string> &hashs);
|
||||
virtual bool FileDetails(const std::string &hash, TransferInfoFlags hintflags, FileInfo &info);
|
||||
virtual bool FileDetails(const std::string &hash, FileSearchFlags hintflags, FileInfo &info);
|
||||
virtual bool FileDownloadChunksDetails(const std::string& hash,FileChunksInfo& info) ;
|
||||
virtual bool FileUploadChunksDetails(const std::string& hash,const std::string& peer_id,CompressedChunkMap& map) ;
|
||||
|
||||
|
@ -162,9 +162,9 @@ virtual bool FileUploadChunksDetails(const std::string& hash,const std::string&
|
|||
/***
|
||||
* Extra List Access
|
||||
***/
|
||||
virtual bool ExtraFileAdd(std::string fname, std::string hash, uint64_t size, uint32_t period, TransferInfoFlags flags);
|
||||
virtual bool ExtraFileRemove(std::string hash, TransferInfoFlags flags);
|
||||
virtual bool ExtraFileHash(std::string localpath, uint32_t period, TransferInfoFlags flags);
|
||||
virtual bool ExtraFileAdd(std::string fname, std::string hash, uint64_t size, uint32_t period, TransferRequestFlags flags);
|
||||
virtual bool ExtraFileRemove(std::string hash, TransferRequestFlags flags);
|
||||
virtual bool ExtraFileHash(std::string localpath, uint32_t period, TransferRequestFlags flags);
|
||||
virtual bool ExtraFileStatus(std::string localpath, FileInfo &info);
|
||||
virtual bool ExtraFileMove(std::string fname, std::string hash, uint64_t size, std::string destpath);
|
||||
|
||||
|
@ -173,13 +173,13 @@ virtual bool ExtraFileMove(std::string fname, std::string hash, uint64_t size, s
|
|||
* Directory Listing / Search Interface
|
||||
***/
|
||||
virtual int RequestDirDetails(const std::string& uid, const std::string& path, DirDetails &details);
|
||||
virtual int RequestDirDetails(void *ref, DirDetails &details, FileStorageFlags flags);
|
||||
virtual uint32_t getType(void *ref,TransferInfoFlags flags) ;
|
||||
virtual int RequestDirDetails(void *ref, DirDetails &details, FileSearchFlags flags);
|
||||
virtual uint32_t getType(void *ref,FileSearchFlags flags) ;
|
||||
|
||||
virtual int SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,uint32_t flags);
|
||||
virtual int SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,uint32_t flags,const std::string& peer_id);
|
||||
virtual int SearchBoolExp(Expression * exp, std::list<DirDetails> &results,uint32_t flags);
|
||||
virtual int SearchBoolExp(Expression * exp, std::list<DirDetails> &results,uint32_t flags,const std::string& peer_id);
|
||||
virtual int SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,FileSearchFlags flags);
|
||||
virtual int SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,FileSearchFlags flags,const std::string& peer_id);
|
||||
virtual int SearchBoolExp(Expression * exp, std::list<DirDetails> &results,FileSearchFlags flags);
|
||||
virtual int SearchBoolExp(Expression * exp, std::list<DirDetails> &results,FileSearchFlags flags,const std::string& peer_id);
|
||||
|
||||
/***
|
||||
* Utility Functions
|
||||
|
|
|
@ -65,24 +65,27 @@ const uint32_t RS_FILE_PEER_OFFLINE = 0x00002000;
|
|||
|
||||
// Flags used when requesting info about transfers, mostly to filter out the result.
|
||||
//
|
||||
const TransferInfoFlags RS_FILE_HINTS_CACHE = 0x00000001;
|
||||
const TransferInfoFlags RS_FILE_HINTS_EXTRA = 0x00000002;
|
||||
const TransferInfoFlags RS_FILE_HINTS_LOCAL = 0x00000004;
|
||||
const TransferInfoFlags RS_FILE_HINTS_REMOTE = 0x00000008;
|
||||
const TransferInfoFlags RS_FILE_HINTS_DOWNLOAD = 0x00000010;
|
||||
const TransferInfoFlags RS_FILE_HINTS_UPLOAD = 0x00000020;
|
||||
const TransferInfoFlags RS_FILE_HINTS_NETWORK_WIDE = 0x00000080;// anonymously shared over network
|
||||
const TransferInfoFlags RS_FILE_HINTS_BROWSABLE = 0x00000100;// browsable by friends
|
||||
const TransferInfoFlags RS_FILE_HINTS_PERMISSION_MASK = 0x00000180;// OR of the last two flags. Used to filter out.
|
||||
const FileSearchFlags RS_FILE_HINTS_CACHE ( 0x00000001 );
|
||||
const FileSearchFlags RS_FILE_HINTS_EXTRA ( 0x00000002 );
|
||||
const FileSearchFlags RS_FILE_HINTS_LOCAL ( 0x00000004 );
|
||||
const FileSearchFlags RS_FILE_HINTS_REMOTE ( 0x00000008 );
|
||||
const FileSearchFlags RS_FILE_HINTS_DOWNLOAD ( 0x00000010 );
|
||||
const FileSearchFlags RS_FILE_HINTS_UPLOAD ( 0x00000020 );
|
||||
const FileSearchFlags RS_FILE_HINTS_SPEC_ONLY ( 0x01000000 );
|
||||
|
||||
const FileSearchFlags RS_FILE_HINTS_NETWORK_WIDE ( 0x00000080 );// anonymously shared over network
|
||||
const FileSearchFlags RS_FILE_HINTS_BROWSABLE ( 0x00000100 );// browsable by friends
|
||||
const FileSearchFlags RS_FILE_HINTS_PERMISSION_MASK ( 0x00000180 );// OR of the last two flags. Used to filter out.
|
||||
|
||||
// Flags used when requesting a transfer
|
||||
//
|
||||
const TransferInfoFlags RS_FILE_HINTS_ANONYMOUS_ROUTING = 0x00000040; // Use to ask turtle router to download the file.
|
||||
const TransferInfoFlags RS_FILE_HINTS_ASSUME_AVAILABILITY = 0x00000200; // Assume full source availability. Used for cache files.
|
||||
const TransferInfoFlags RS_FILE_HINTS_MEDIA = 0x00001000;
|
||||
const TransferInfoFlags RS_FILE_HINTS_BACKGROUND = 0x00002000; // To download slowly.
|
||||
const TransferInfoFlags RS_FILE_HINTS_SPEC_ONLY = 0x01000000;
|
||||
const TransferInfoFlags RS_FILE_HINTS_NO_SEARCH = 0x02000000; // disable searching for potential direct sources.
|
||||
const TransferRequestFlags RS_FILE_REQ_ANONYMOUS_ROUTING ( 0x00000040 ); // Use to ask turtle router to download the file.
|
||||
const TransferRequestFlags RS_FILE_REQ_ASSUME_AVAILABILITY ( 0x00000200 ); // Assume full source availability. Used for cache files.
|
||||
const TransferRequestFlags RS_FILE_REQ_CACHE ( 0x00000400 ); // Assume full source availability. Used for cache files.
|
||||
const TransferRequestFlags RS_FILE_REQ_EXTRA ( 0x00000800 );
|
||||
const TransferRequestFlags RS_FILE_REQ_MEDIA ( 0x00001000 );
|
||||
const TransferRequestFlags RS_FILE_REQ_BACKGROUND ( 0x00002000 ); // To download slowly.
|
||||
const TransferRequestFlags RS_FILE_REQ_NO_SEARCH ( 0x02000000 ); // disable searching for potential direct sources.
|
||||
|
||||
// const uint32_t RS_FILE_HINTS_SHARE_FLAGS_MASK = RS_FILE_HINTS_NETWORK_WIDE_OTHERS | RS_FILE_HINTS_BROWSABLE_OTHERS
|
||||
// | RS_FILE_HINTS_NETWORK_WIDE_GROUPS | RS_FILE_HINTS_BROWSABLE_GROUPS ;
|
||||
|
@ -95,7 +98,7 @@ struct SharedDirInfo
|
|||
{
|
||||
std::string filename ;
|
||||
std::string virtualname ;
|
||||
uint32_t shareflags ; // RS_FILE_HINTS_NETWORK_WIDE | RS_FILE_HINTS_BROWSABLE
|
||||
FileStorageFlags shareflags ; // DIR_FLAGS_NETWORK_WIDE_OTHERS | DIR_FLAGS_BROWSABLE_GROUPS | ...
|
||||
std::list<std::string> parent_groups ;
|
||||
};
|
||||
|
||||
|
@ -116,7 +119,7 @@ class RsFiles
|
|||
|
||||
virtual bool alreadyHaveFile(const std::string& hash, FileInfo &info) = 0;
|
||||
/// Returns false is we already have the file. Otherwise, initiates the dl and returns true.
|
||||
virtual bool FileRequest(const std::string& fname, const std::string& hash, uint64_t size, const std::string& dest, TransferInfoFlags flags, const std::list<std::string>& srcIds) = 0;
|
||||
virtual bool FileRequest(const std::string& fname, const std::string& hash, uint64_t size, const std::string& dest, TransferRequestFlags flags, const std::list<std::string>& srcIds) = 0;
|
||||
virtual bool FileCancel(const std::string& hash) = 0;
|
||||
virtual bool setChunkStrategy(const std::string& hash,FileChunksInfo::ChunkStrategy) = 0;
|
||||
virtual void setDefaultChunkStrategy(FileChunksInfo::ChunkStrategy) = 0;
|
||||
|
@ -144,7 +147,7 @@ class RsFiles
|
|||
***/
|
||||
virtual bool FileDownloads(std::list<std::string> &hashs) = 0;
|
||||
virtual bool FileUploads(std::list<std::string> &hashs) = 0;
|
||||
virtual bool FileDetails(const std::string &hash, TransferInfoFlags hintflags, FileInfo &info) = 0;
|
||||
virtual bool FileDetails(const std::string &hash, FileSearchFlags hintflags, FileInfo &info) = 0;
|
||||
|
||||
/// Gives chunk details about the downloaded file with given hash.
|
||||
virtual bool FileDownloadChunksDetails(const std::string& hash,FileChunksInfo& info) = 0 ;
|
||||
|
@ -155,9 +158,9 @@ class RsFiles
|
|||
/***
|
||||
* Extra List Access
|
||||
***/
|
||||
virtual bool ExtraFileAdd(std::string fname, std::string hash, uint64_t size, uint32_t period, TransferInfoFlags flags) = 0;
|
||||
virtual bool ExtraFileRemove(std::string hash, TransferInfoFlags flags) = 0;
|
||||
virtual bool ExtraFileHash(std::string localpath, uint32_t period, TransferInfoFlags flags) = 0;
|
||||
virtual bool ExtraFileAdd(std::string fname, std::string hash, uint64_t size, uint32_t period, TransferRequestFlags flags) = 0;
|
||||
virtual bool ExtraFileRemove(std::string hash, TransferRequestFlags flags) = 0;
|
||||
virtual bool ExtraFileHash(std::string localpath, uint32_t period, TransferRequestFlags flags) = 0;
|
||||
virtual bool ExtraFileStatus(std::string localpath, FileInfo &info) = 0;
|
||||
virtual bool ExtraFileMove(std::string fname, std::string hash, uint64_t size,
|
||||
std::string destpath) = 0;
|
||||
|
@ -168,14 +171,13 @@ class RsFiles
|
|||
* Directory Listing / Search Interface
|
||||
*/
|
||||
virtual int RequestDirDetails(const std::string& uid, const std::string& path, DirDetails &details) = 0;
|
||||
virtual int RequestDirDetails(void *ref, DirDetails &details, FileSearchFlags flags) = 0;
|
||||
virtual uint32_t getType(void *ref,FileSearchFlags flags) = 0;
|
||||
|
||||
virtual int RequestDirDetails(void *ref, DirDetails &details, FileStorageFlags flags) = 0;
|
||||
virtual uint32_t getType(void *ref,TransferInfoFlags flags) = 0;
|
||||
|
||||
virtual int SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,uint32_t flags) = 0;
|
||||
virtual int SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,uint32_t flags,const std::string& peer_id) = 0;
|
||||
virtual int SearchBoolExp(Expression * exp, std::list<DirDetails> &results,uint32_t flags) = 0;
|
||||
virtual int SearchBoolExp(Expression * exp, std::list<DirDetails> &results,uint32_t flags,const std::string& peer_id) = 0;
|
||||
virtual int SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,FileSearchFlags flags) = 0;
|
||||
virtual int SearchKeywords(std::list<std::string> keywords, std::list<DirDetails> &results,FileSearchFlags flags,const std::string& peer_id) = 0;
|
||||
virtual int SearchBoolExp(Expression * exp, std::list<DirDetails> &results,FileSearchFlags flags) = 0;
|
||||
virtual int SearchBoolExp(Expression * exp, std::list<DirDetails> &results,FileSearchFlags flags,const std::string& peer_id) = 0;
|
||||
|
||||
/***
|
||||
* Utility Functions.
|
||||
|
|
|
@ -1,29 +1,64 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// This class provides a representation for flags that can be combined with bitwise
|
||||
// operations. However, because the class is templated with an id, it's not possible to
|
||||
// mixup flags belonging to different classes. This avoids many bugs due to confusion of flags types
|
||||
// that occur when all flags are uint32_t values.
|
||||
//
|
||||
// To use this class, define an ID that is different than other flags classes, and do a typedef:
|
||||
//
|
||||
// #define TRANSFER_INFO_FLAGS_TAG 0x8133ea
|
||||
// typedef t_RsFlags32<TRANSFER_INFO_FLAGS_TAG> TransferInfoFlags ;
|
||||
//
|
||||
// Implementation details:
|
||||
// - we cannot have at the same time a implicit contructor from uint32_t and a bool operator, otherwise c++
|
||||
// mixes up operators and transforms flags into booleans before combining them further.
|
||||
//
|
||||
// So I decided to have:
|
||||
// - an explicit constructor from uint32_t
|
||||
// - an implicit bool operator, that allows test like if(flags & FLAGS_VALUE)
|
||||
//
|
||||
template<int n> class t_RsFlags32
|
||||
{
|
||||
public:
|
||||
t_RsFlags32() {}
|
||||
inline t_RsFlags32() { _bits=0; }
|
||||
inline explicit t_RsFlags32(uint32_t N) : _bits(N) {} // allows initialization from a set of uint32_t
|
||||
|
||||
t_RsFlags32(uint32_t N) : _bits(N) {}
|
||||
operator uint32_t() const { return _bits ; }
|
||||
inline t_RsFlags32<n> operator| (const t_RsFlags32<n>& f) const { return t_RsFlags32<n>(_bits | f._bits) ; }
|
||||
inline t_RsFlags32<n> operator^ (const t_RsFlags32<n>& f) const { return t_RsFlags32<n>(_bits ^ f._bits) ; }
|
||||
|
||||
t_RsFlags32<n> operator| (const t_RsFlags32<n>& f) const { return t_RsFlags32<n>(_bits | f._bits) ; }
|
||||
t_RsFlags32<n> operator^ (const t_RsFlags32<n>& f) const { return t_RsFlags32<n>(_bits ^ f._bits) ; }
|
||||
t_RsFlags32<n> operator& (const t_RsFlags32<n>& f) const { return t_RsFlags32<n>(_bits & f._bits) ; }
|
||||
inline bool operator!=(const t_RsFlags32<n>& f) const { return _bits != f._bits ; }
|
||||
inline bool operator& (const t_RsFlags32<n>& f) const { return (_bits & f._bits)>0 ; }
|
||||
|
||||
t_RsFlags32<n> operator|=(const t_RsFlags32<n>& f) { _bits |= f._bits ; return *this ;}
|
||||
t_RsFlags32<n> operator^=(const t_RsFlags32<n>& f) { _bits ^= f._bits ; return *this ;}
|
||||
t_RsFlags32<n> operator&=(const t_RsFlags32<n>& f) { _bits &= f._bits ; return *this ;}
|
||||
inline t_RsFlags32<n> operator|=(const t_RsFlags32<n>& f) { _bits |= f._bits ; return *this ;}
|
||||
inline t_RsFlags32<n> operator^=(const t_RsFlags32<n>& f) { _bits ^= f._bits ; return *this ;}
|
||||
inline t_RsFlags32<n> operator&=(const t_RsFlags32<n>& f) { _bits &= f._bits ; return *this ;}
|
||||
|
||||
t_RsFlags32<n> operator~() const { return t_RsFlags32<n>(~_bits) ; }
|
||||
inline t_RsFlags32<n> operator~() const { return t_RsFlags32<n>(~_bits) ; }
|
||||
|
||||
//inline explicit operator bool() const { return _bits>0; }
|
||||
inline uint32_t toUInt32() const { return _bits ; }
|
||||
|
||||
void clear() { _bits = 0 ; }
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& o,const t_RsFlags32<n>& f) // friendly print with 0 and I
|
||||
{
|
||||
for(int i=31;i>=0;--i) { o << ( (f._bits&(1<<i))?"I":"0") ; if(i%8==0) o << " " ; }
|
||||
return o ;
|
||||
}
|
||||
private:
|
||||
uint32_t _bits ;
|
||||
};
|
||||
|
||||
#define TRANSFER_INFO_FLAGS_TAG 0x8133ea
|
||||
#define FILE_STORAGE_FLAGS_TAG 0x184738
|
||||
#define FLAGS_TAG_FILE_SEARCH 0xf29ba5
|
||||
#define FLAGS_TAG_PERMISSION 0x8133ea
|
||||
#define FLAGS_TAG_TRANSFER_REQS 0x4228af
|
||||
#define FLAGS_TAG_FILE_STORAGE 0x184738
|
||||
|
||||
typedef t_RsFlags32<TRANSFER_INFO_FLAGS_TAG> TransferInfoFlags ;
|
||||
typedef t_RsFlags32<FILE_STORAGE_FLAGS_TAG > FileStorageFlags ; // this makes it a uint32_t class incompatible with other flag class
|
||||
typedef t_RsFlags32<FLAGS_TAG_PERMISSION> FilePermissionFlags ;
|
||||
typedef t_RsFlags32<FLAGS_TAG_TRANSFER_REQS> TransferRequestFlags ;
|
||||
typedef t_RsFlags32<FLAGS_TAG_FILE_STORAGE > FileStorageFlags ; // this makes it a uint32_t class incompatible with other flag class
|
||||
typedef t_RsFlags32<FLAGS_TAG_FILE_SEARCH > FileSearchFlags ; // this makes it a uint32_t class incompatible with other flag class
|
||||
|
||||
|
|
|
@ -307,7 +307,7 @@ class RsPeers
|
|||
// ... computes the sharing file permission hint flags set for this peer, that is a combination of
|
||||
// RS_FILE_HINTS_NETWORK_WIDE and RS_FILE_HINTS_BROWSABLE.
|
||||
//
|
||||
virtual TransferInfoFlags computePeerPermissionFlags(const std::string& peer_id,FileStorageFlags file_sharing_flags,const std::list<std::string>& file_parent_groups) = 0;
|
||||
virtual FileSearchFlags computePeerPermissionFlags(const std::string& peer_id,FileStorageFlags file_sharing_flags,const std::list<std::string>& file_parent_groups) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -202,19 +202,19 @@ class SearchRequest
|
|||
* (TODO)
|
||||
*/
|
||||
|
||||
const FileStorageFlags DIR_FLAGS_PARENT = 0x0001;
|
||||
const FileStorageFlags DIR_FLAGS_DETAILS = 0x0002;
|
||||
const FileStorageFlags DIR_FLAGS_CHILDREN = 0x0004;
|
||||
const FileStorageFlags DIR_FLAGS_PARENT ( 0x0001 );
|
||||
const FileStorageFlags DIR_FLAGS_DETAILS ( 0x0002 ); // apparently unused
|
||||
const FileStorageFlags DIR_FLAGS_CHILDREN ( 0x0004 ); // apparently unused
|
||||
|
||||
const FileStorageFlags DIR_FLAGS_NETWORK_WIDE_OTHERS = 0x0080; // Flags for directory sharing permissions. The last
|
||||
const FileStorageFlags DIR_FLAGS_BROWSABLE_OTHERS = 0x0100; // one should be the OR of the all four flags.
|
||||
const FileStorageFlags DIR_FLAGS_NETWORK_WIDE_GROUPS = 0x0200;
|
||||
const FileStorageFlags DIR_FLAGS_BROWSABLE_GROUPS = 0x0400;
|
||||
const FileStorageFlags DIR_FLAGS_PERMISSIONS_MASK = DIR_FLAGS_NETWORK_WIDE_OTHERS | DIR_FLAGS_BROWSABLE_OTHERS
|
||||
| DIR_FLAGS_NETWORK_WIDE_GROUPS | DIR_FLAGS_BROWSABLE_GROUPS ;
|
||||
const FileStorageFlags DIR_FLAGS_NETWORK_WIDE_OTHERS ( 0x0080 ); // Flags for directory sharing permissions. The last
|
||||
const FileStorageFlags DIR_FLAGS_BROWSABLE_OTHERS ( 0x0100 ); // one should be the OR of the all four flags.
|
||||
const FileStorageFlags DIR_FLAGS_NETWORK_WIDE_GROUPS ( 0x0200 );
|
||||
const FileStorageFlags DIR_FLAGS_BROWSABLE_GROUPS ( 0x0400 );
|
||||
const FileStorageFlags DIR_FLAGS_PERMISSIONS_MASK ( DIR_FLAGS_NETWORK_WIDE_OTHERS | DIR_FLAGS_BROWSABLE_OTHERS
|
||||
| DIR_FLAGS_NETWORK_WIDE_GROUPS | DIR_FLAGS_BROWSABLE_GROUPS );
|
||||
|
||||
const FileStorageFlags DIR_FLAGS_LOCAL = 0x1000;
|
||||
const FileStorageFlags DIR_FLAGS_REMOTE = 0x2000;
|
||||
const FileStorageFlags DIR_FLAGS_LOCAL ( 0x1000 );
|
||||
const FileStorageFlags DIR_FLAGS_REMOTE ( 0x2000 );
|
||||
|
||||
class FileInfo
|
||||
{
|
||||
|
@ -224,8 +224,8 @@ class FileInfo
|
|||
FileInfo() : mId(0) { return; }
|
||||
RsCertId id; /* key for matching everything */
|
||||
|
||||
FileStorageFlags storage_permission_flags; // Combination of the four RS_DIR_FLAGS_*. Updated when the file is a local stored file.
|
||||
TransferInfoFlags transfer_info_flags ; // various flags from RS_FILE_HINTS_*
|
||||
FileStorageFlags storage_permission_flags; // Combination of the four RS_DIR_FLAGS_*. Updated when the file is a local stored file.
|
||||
TransferRequestFlags transfer_info_flags ; // various flags from RS_FILE_HINTS_*
|
||||
|
||||
/* allow this to be tweaked by the GUI Model */
|
||||
mutable unsigned int mId; /* (GUI) Model Id -> unique number */
|
||||
|
@ -327,7 +327,6 @@ class FileChunksInfo
|
|||
|
||||
uint64_t file_size ; // real size of the file
|
||||
uint32_t chunk_size ; // size of chunks
|
||||
uint32_t flags ;
|
||||
uint32_t strategy ;
|
||||
|
||||
// dl state of chunks. Only the last chunk may have size < chunk_size
|
||||
|
|
|
@ -1100,7 +1100,7 @@ bool p3Peers::assignPeersToGroup(const std::string &groupId, const std::list<std
|
|||
return mPeerMgr->assignPeersToGroup(groupId, peerIds, assign);
|
||||
}
|
||||
|
||||
TransferInfoFlags p3Peers::computePeerPermissionFlags(const std::string& peer_id,
|
||||
FileSearchFlags p3Peers::computePeerPermissionFlags(const std::string& peer_id,
|
||||
FileStorageFlags share_flags,
|
||||
const std::list<std::string>& directory_parent_groups)
|
||||
{
|
||||
|
@ -1110,7 +1110,6 @@ TransferInfoFlags p3Peers::computePeerPermissionFlags(const std::string& peer_id
|
|||
// very simple algorithm.
|
||||
//
|
||||
|
||||
TransferInfoFlags final_flags = 0 ;
|
||||
bool found = false ;
|
||||
|
||||
for(std::list<std::string>::const_iterator it(directory_parent_groups.begin());it!=directory_parent_groups.end() && !found;++it)
|
||||
|
@ -1130,7 +1129,12 @@ TransferInfoFlags p3Peers::computePeerPermissionFlags(const std::string& peer_id
|
|||
bool network_wide = (share_flags & DIR_FLAGS_NETWORK_WIDE_OTHERS) || ( (share_flags & DIR_FLAGS_NETWORK_WIDE_GROUPS) && found) ;
|
||||
bool browsable = (share_flags & DIR_FLAGS_BROWSABLE_OTHERS) || ( (share_flags & DIR_FLAGS_BROWSABLE_GROUPS) && found) ;
|
||||
|
||||
return network_wide * RS_FILE_HINTS_NETWORK_WIDE + browsable * RS_FILE_HINTS_BROWSABLE ;
|
||||
FileSearchFlags final_flags ;
|
||||
|
||||
if(network_wide) final_flags |= RS_FILE_HINTS_NETWORK_WIDE ;
|
||||
if(browsable ) final_flags |= RS_FILE_HINTS_BROWSABLE ;
|
||||
|
||||
return final_flags ;
|
||||
}
|
||||
|
||||
RsPeerDetails::RsPeerDetails()
|
||||
|
|
|
@ -121,7 +121,7 @@ virtual bool getGroupInfoList(std::list<RsGroupInfo> &groupInfoList);
|
|||
virtual bool assignPeerToGroup(const std::string &groupId, const std::string &peerId, bool assign);
|
||||
virtual bool assignPeersToGroup(const std::string &groupId, const std::list<std::string> &peerIds, bool assign);
|
||||
|
||||
virtual TransferInfoFlags computePeerPermissionFlags(const std::string& peer_id,FileStorageFlags share_flags,const std::list<std::string>& parent_groups) ;
|
||||
virtual FileSearchFlags computePeerPermissionFlags(const std::string& peer_id,FileStorageFlags share_flags,const std::list<std::string>& parent_groups) ;
|
||||
private:
|
||||
|
||||
p3LinkMgr *mLinkMgr;
|
||||
|
|
|
@ -475,8 +475,7 @@ bool p3Channels::channelExtraFileHash(const std::string &path, const std::string
|
|||
// reverse string buff for correct file name
|
||||
fname.append(fnameBuff.rbegin(), fnameBuff.rend());
|
||||
|
||||
|
||||
uint32_t flags = RS_FILE_HINTS_NETWORK_WIDE;
|
||||
TransferRequestFlags flags = RS_FILE_REQ_ANONYMOUS_ROUTING;
|
||||
|
||||
// then hash file and get file info too
|
||||
|
||||
|
@ -490,14 +489,15 @@ bool p3Channels::channelExtraFileHash(const std::string &path, const std::string
|
|||
}
|
||||
|
||||
|
||||
bool p3Channels::channelExtraFileRemove(const std::string &hash, const std::string &chId){
|
||||
|
||||
uint32_t flags = RS_FILE_HINTS_NETWORK_WIDE | RS_FILE_HINTS_EXTRA;
|
||||
bool p3Channels::channelExtraFileRemove(const std::string &hash, const std::string &chId)
|
||||
{
|
||||
TransferRequestFlags tflags = RS_FILE_REQ_ANONYMOUS_ROUTING | RS_FILE_REQ_EXTRA;
|
||||
FileSearchFlags sflags = RS_FILE_HINTS_NETWORK_WIDE | RS_FILE_HINTS_EXTRA;
|
||||
|
||||
/* remove copy from channels directory */
|
||||
|
||||
FileInfo fInfo;
|
||||
mRsFiles->FileDetails(hash, flags, fInfo);
|
||||
mRsFiles->FileDetails(hash, sflags, fInfo);
|
||||
std::string chPath = mChannelsDir + "/" + chId + "/" + fInfo.fname;
|
||||
|
||||
if(remove(chPath.c_str()) == 0){
|
||||
|
@ -509,8 +509,7 @@ bool p3Channels::channelExtraFileRemove(const std::string &hash, const std::stri
|
|||
<< chPath.c_str() << std::endl;
|
||||
}
|
||||
|
||||
return mRsFiles->ExtraFileRemove(hash, flags);
|
||||
|
||||
return mRsFiles->ExtraFileRemove(hash, tflags);
|
||||
}
|
||||
|
||||
|
||||
|
@ -835,7 +834,7 @@ bool p3Channels::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, con
|
|||
std::string channelname = grpId;
|
||||
|
||||
std::string localpath;
|
||||
uint32_t flags;
|
||||
TransferRequestFlags flags;
|
||||
|
||||
// send to download directory if file is private
|
||||
// We also add explicit sources only if the channel is private. Otherwise we DL in network wide mode
|
||||
|
@ -846,14 +845,14 @@ bool p3Channels::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, con
|
|||
if(chanPrivate)
|
||||
{
|
||||
localpath = mChannelsDir;
|
||||
flags = RS_FILE_HINTS_BACKGROUND | RS_FILE_HINTS_EXTRA;
|
||||
flags = RS_FILE_REQ_BACKGROUND | RS_FILE_REQ_EXTRA;
|
||||
|
||||
srcIds.push_back(id);
|
||||
}
|
||||
else
|
||||
{
|
||||
localpath = ""; // forces dl to default directory
|
||||
flags = RS_FILE_HINTS_BACKGROUND | RS_FILE_HINTS_NETWORK_WIDE;
|
||||
flags = RS_FILE_REQ_BACKGROUND | RS_FILE_REQ_ANONYMOUS_ROUTING;
|
||||
}
|
||||
|
||||
/* download it ... and flag for ExtraList
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue