basic infrastructure for banning unwanted file content

This commit is contained in:
csoler 2018-08-16 18:49:36 +02:00
parent 7bdc61e3e3
commit 50e03a539c
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
9 changed files with 146 additions and 25 deletions

View file

@ -162,6 +162,13 @@ public:
uint64_t mTotalSize ;
};
struct BannedFileEntry
{
uint64_t size ;
std::string filename ;
time_t ban_time_stamp;
};
class RsFiles
{
public:
@ -261,6 +268,10 @@ public:
virtual int SearchBoolExp(RsRegularExpression::Expression * exp, std::list<DirDetails> &results,FileSearchFlags flags,const RsPeerId& peer_id) = 0;
virtual int getSharedDirStatistics(const RsPeerId& pid, SharedDirStats& stats) =0;
virtual int banFile(const RsFileHash& real_file_hash, const std::string& filename, uint64_t file_size) =0;
virtual int unbanFile(const RsFileHash& real_file_hash)=0;
virtual bool getPrimaryBannedFilesList(std::map<RsFileHash,BannedFileEntry>& banned_files) =0;
/***
* Utility Functions.
***/