diff --git a/libretroshare/src/dbase/findex.h b/libretroshare/src/dbase/findex.h index 75c658be1..401c7c0a2 100644 --- a/libretroshare/src/dbase/findex.h +++ b/libretroshare/src/dbase/findex.h @@ -80,7 +80,7 @@ class FileEntry { public: FileEntry() - :parent(NULL), row(0) ,size(0),modtime(0),pop(0),updtime(0) + : size(0), modtime(0), pop(0), updtime(0), parent(NULL), row(0) { return; } virtual ~FileEntry() { return; } diff --git a/libretroshare/src/dbase/fistore.cc b/libretroshare/src/dbase/fistore.cc index da8725a6a..07edf2a5f 100644 --- a/libretroshare/src/dbase/fistore.cc +++ b/libretroshare/src/dbase/fistore.cc @@ -190,11 +190,12 @@ int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, uint32_t f lockData(); - if(ref != NULL && !FileIndex::isValid(ref)) - { - unlockData() ; - return false ; - } +// checked by FileIndex::extractData +// if(ref != NULL && !FileIndex::isValid(ref)) +// { +// unlockData() ; +// return false ; +// } /* so cast *ref to a DirEntry */ /* root case */ diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index fbbb04ab1..a3ba2833d 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -1544,7 +1544,7 @@ std::string ftController::getPartialsDirectory() return mPartialsPath; } -bool ftController::FileDetails(std::string hash, FileInfo &info) +bool ftController::FileDetails(const std::string &hash, FileInfo &info) { RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ diff --git a/libretroshare/src/ft/ftcontroller.h b/libretroshare/src/ft/ftcontroller.h index 9d6698a8f..96f629e0f 100644 --- a/libretroshare/src/ft/ftcontroller.h +++ b/libretroshare/src/ft/ftcontroller.h @@ -173,7 +173,7 @@ class ftController: public CacheTransfer, public RsThread, public pqiMonitor, pu bool setPartialsDirectory(std::string path); std::string getDownloadDirectory(); std::string getPartialsDirectory(); - bool FileDetails(std::string hash, FileInfo &info); + bool FileDetails(const std::string &hash, FileInfo &info); bool moveFile(const std::string& source,const std::string& dest) ; bool copyFile(const std::string& source,const std::string& dest) ; diff --git a/libretroshare/src/ft/ftdatamultiplex.cc b/libretroshare/src/ft/ftdatamultiplex.cc index f8d4c144a..29c2eba9b 100644 --- a/libretroshare/src/ft/ftdatamultiplex.cc +++ b/libretroshare/src/ft/ftdatamultiplex.cc @@ -121,7 +121,7 @@ bool ftDataMultiplex::FileDownloads(std::list &hashs) } -bool ftDataMultiplex::FileDetails(std::string hash, uint32_t hintsflag, FileInfo &info) +bool ftDataMultiplex::FileDetails(const std::string &hash, uint32_t hintsflag, FileInfo &info) { #ifdef MPLEX_DEBUG std::cerr << "ftDataMultiplex::FileDetails("; diff --git a/libretroshare/src/ft/ftdatamultiplex.h b/libretroshare/src/ft/ftdatamultiplex.h index 7a5436618..021ef4914 100644 --- a/libretroshare/src/ft/ftdatamultiplex.h +++ b/libretroshare/src/ft/ftdatamultiplex.h @@ -94,7 +94,7 @@ class ftDataMultiplex: public ftDataRecv, public RsQueueThread /* get Details of File Transfers */ bool FileUploads(std::list &hashs); bool FileDownloads(std::list &hashs); - bool FileDetails(std::string hash, uint32_t hintsflag, FileInfo &info); + bool FileDetails(const std::string &hash, uint32_t hintsflag, FileInfo &info); void deleteUnusedServers() ; diff --git a/libretroshare/src/ft/ftdbase.cc b/libretroshare/src/ft/ftdbase.cc index 34bc80485..543e14dc3 100644 --- a/libretroshare/src/ft/ftdbase.cc +++ b/libretroshare/src/ft/ftdbase.cc @@ -37,7 +37,7 @@ ftFiStore::ftFiStore(CacheStrapper *cs, CacheTransfer *cft, NotifyBase *cb_in,p3 return; } -bool ftFiStore::search(std::string hash, uint32_t hintflags, FileInfo &info) const +bool ftFiStore::search(const std::string &hash, uint32_t 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. @@ -125,7 +125,7 @@ ftFiMonitor::ftFiMonitor(CacheStrapper *cs,NotifyBase *cb_in, std::string cached return; } -bool ftFiMonitor::search(std::string hash, uint32_t hintflags, FileInfo &info) const +bool ftFiMonitor::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const { uint64_t fsize; std::string path; @@ -271,7 +271,7 @@ ftCacheStrapper::ftCacheStrapper(p3ConnectMgr *cm) } /* overloaded search function */ -bool ftCacheStrapper::search(std::string hash, uint32_t hintflags, FileInfo &info) const +bool ftCacheStrapper::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const { #ifdef DB_DEBUG std::cerr << "ftCacheStrapper::search(" << hash << "," << hintflags; diff --git a/libretroshare/src/ft/ftdbase.h b/libretroshare/src/ft/ftdbase.h index 251f3431a..552c3c774 100644 --- a/libretroshare/src/ft/ftdbase.h +++ b/libretroshare/src/ft/ftdbase.h @@ -51,7 +51,7 @@ class ftFiStore: public FileIndexStore, public ftSearch RsPeerId ownid, std::string cachedir); /* overloaded search function */ -virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const; +virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const; }; class ftFiMonitor: public FileIndexMonitor, public ftSearch, public p3Config @@ -60,7 +60,7 @@ class ftFiMonitor: public FileIndexMonitor, public ftSearch, public p3Config ftFiMonitor(CacheStrapper *cs,NotifyBase *cb_in, std::string cachedir, std::string pid); /* overloaded search function */ - virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const; + virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const; /* overloaded set dirs enables config indication */ virtual void setSharedDirectories(const std::list& dirList); @@ -84,7 +84,7 @@ class ftCacheStrapper: public CacheStrapper, public ftSearch ftCacheStrapper(p3ConnectMgr *cm); /* overloaded search function */ -virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const; +virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const; }; diff --git a/libretroshare/src/ft/ftextralist.cc b/libretroshare/src/ft/ftextralist.cc index c8e5c3e8e..bdf2da6d6 100644 --- a/libretroshare/src/ft/ftextralist.cc +++ b/libretroshare/src/ft/ftextralist.cc @@ -329,7 +329,7 @@ bool ftExtraList::hashExtraFileDone(std::string path, FileInfo &info) * Search Function - used by File Transfer * **/ -bool ftExtraList::search(std::string hash, uint32_t hintflags, FileInfo &info) const +bool ftExtraList::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const { #ifdef DEBUG_ELIST diff --git a/libretroshare/src/ft/ftextralist.h b/libretroshare/src/ft/ftextralist.h index c9c73abd7..c7f54693f 100644 --- a/libretroshare/src/ft/ftextralist.h +++ b/libretroshare/src/ft/ftextralist.h @@ -138,7 +138,7 @@ bool hashExtraFileDone(std::string path, FileInfo &info); * implementation of ftSearch. * **/ -virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const; +virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const; /*** * Thread Main Loop diff --git a/libretroshare/src/ft/ftfilesearch.cc b/libretroshare/src/ft/ftfilesearch.cc index 8dadd5e85..966b88f48 100644 --- a/libretroshare/src/ft/ftfilesearch.cc +++ b/libretroshare/src/ft/ftfilesearch.cc @@ -75,7 +75,7 @@ bool ftFileSearch::addSearchMode(ftSearch *search, uint32_t hintflags) return false; } -bool ftFileSearch::search(std::string hash, uint32_t hintflags, FileInfo &info) const +bool ftFileSearch::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const { uint32_t hints, i; diff --git a/libretroshare/src/ft/ftfilesearch.h b/libretroshare/src/ft/ftfilesearch.h index 5b7340c06..eaf5db2cd 100644 --- a/libretroshare/src/ft/ftfilesearch.h +++ b/libretroshare/src/ft/ftfilesearch.h @@ -45,7 +45,7 @@ class ftFileSearch: public ftSearch ftFileSearch(); bool addSearchMode(ftSearch *search, uint32_t hintflags); -virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const; +virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const; private: diff --git a/libretroshare/src/ft/ftsearch.h b/libretroshare/src/ft/ftsearch.h index c7581370c..670d78630 100644 --- a/libretroshare/src/ft/ftsearch.h +++ b/libretroshare/src/ft/ftsearch.h @@ -43,7 +43,7 @@ class ftSearch ftSearch() { return; } virtual ~ftSearch() { return; } -virtual bool search(std::string hash, uint32_t hintflags, FileInfo &info) const = 0; +virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const = 0; }; diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index 0f9d0a534..727561056 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -429,7 +429,7 @@ bool ftServer::FileUploads(std::list &hashs) return mFtDataplex->FileUploads(hashs); } -bool ftServer::FileDetails(std::string hash, uint32_t hintflags, FileInfo &info) +bool ftServer::FileDetails(const std::string &hash, uint32_t hintflags, FileInfo &info) { if (hintflags & RS_FILE_HINTS_DOWNLOAD) if(mFtController->FileDetails(hash, info)) diff --git a/libretroshare/src/ft/ftserver.h b/libretroshare/src/ft/ftserver.h index 4f20fb5df..8fa49c093 100644 --- a/libretroshare/src/ft/ftserver.h +++ b/libretroshare/src/ft/ftserver.h @@ -148,7 +148,7 @@ virtual bool clearDownload(const std::string hash); ***/ virtual bool FileDownloads(std::list &hashs); virtual bool FileUploads(std::list &hashs); -virtual bool FileDetails(std::string hash, uint32_t hintflags, FileInfo &info); +virtual bool FileDetails(const std::string &hash, uint32_t 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) ; diff --git a/libretroshare/src/retroshare/rsfiles.h b/libretroshare/src/retroshare/rsfiles.h index 90fc2263f..8db3ef7db 100644 --- a/libretroshare/src/retroshare/rsfiles.h +++ b/libretroshare/src/retroshare/rsfiles.h @@ -133,7 +133,7 @@ class RsFiles ***/ virtual bool FileDownloads(std::list &hashs) = 0; virtual bool FileUploads(std::list &hashs) = 0; - virtual bool FileDetails(std::string hash, uint32_t hintflags, FileInfo &info) = 0; + virtual bool FileDetails(const std::string &hash, uint32_t hintflags, FileInfo &info) = 0; /// Gives chunk details about the downloaded file with given hash. virtual bool FileDownloadChunksDetails(const std::string& hash,FileChunksInfo& info) = 0 ;