mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-28 00:45:34 -04:00
basic infrastructure for banning unwanted file content
This commit is contained in:
parent
7bdc61e3e3
commit
50e03a539c
9 changed files with 146 additions and 25 deletions
|
@ -1825,10 +1825,24 @@ int ftServer::handleIncoming()
|
|||
bool ftServer::addConfiguration(p3ConfigMgr *cfgmgr)
|
||||
{
|
||||
/* add all the subbits to config mgr */
|
||||
cfgmgr->addConfiguration("ft_database.cfg", mFileDatabase);
|
||||
cfgmgr->addConfiguration("ft_extra.cfg", mFtExtra);
|
||||
cfgmgr->addConfiguration("ft_database.cfg" , mFileDatabase);
|
||||
cfgmgr->addConfiguration("ft_extra.cfg" , mFtExtra );
|
||||
cfgmgr->addConfiguration("ft_transfers.cfg", mFtController);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Offensive content file filtering
|
||||
|
||||
int ftServer::banFile(const RsFileHash& real_file_hash, const std::string& filename, uint64_t file_size)
|
||||
{
|
||||
return mFileDatabase->banFile(real_file_hash,filename,file_size) ;
|
||||
}
|
||||
int ftServer::unbanFile(const RsFileHash& real_file_hash)
|
||||
{
|
||||
return mFileDatabase->unbanFile(real_file_hash) ;
|
||||
}
|
||||
bool ftServer::getPrimaryBannedFilesList(std::map<RsFileHash,BannedFileEntry>& banned_files)
|
||||
{
|
||||
return mFileDatabase->getPrimaryBannedFilesList(banned_files) ;
|
||||
}
|
||||
|
|
|
@ -192,6 +192,10 @@ public:
|
|||
virtual int SearchBoolExp(RsRegularExpression::Expression * exp, std::list<DirDetails> &results,FileSearchFlags flags,const RsPeerId& peer_id);
|
||||
virtual int getSharedDirStatistics(const RsPeerId& pid, SharedDirStats& stats) ;
|
||||
|
||||
virtual int banFile(const RsFileHash& real_file_hash, const std::string& filename, uint64_t file_size) ;
|
||||
virtual int unbanFile(const RsFileHash& real_file_hash);
|
||||
virtual bool getPrimaryBannedFilesList(std::map<RsFileHash,BannedFileEntry>& banned_files) ;
|
||||
|
||||
/***
|
||||
* Utility Functions
|
||||
***/
|
||||
|
@ -237,6 +241,8 @@ public:
|
|||
virtual bool ignoreDuplicates() ;
|
||||
virtual void setIgnoreDuplicates(bool ignore) ;
|
||||
|
||||
static bool encryptHash(const RsFileHash& hash, RsFileHash& hash_of_hash);
|
||||
|
||||
/***************************************************************/
|
||||
/*************** Data Transfer Interface ***********************/
|
||||
/***************************************************************/
|
||||
|
@ -282,7 +288,6 @@ protected:
|
|||
// fnds out what is the real hash of encrypted hash hash
|
||||
bool findRealHash(const RsFileHash& hash, RsFileHash& real_hash);
|
||||
bool findEncryptedHash(const RsPeerId& virtual_peer_id, RsFileHash& encrypted_hash);
|
||||
bool encryptHash(const RsFileHash& hash, RsFileHash& hash_of_hash);
|
||||
|
||||
bool checkUploadLimit(const RsPeerId& pid,const RsFileHash& hash);
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue