mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-29 17:28:41 -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
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue