urbackup_backend/urbackupserver/server_hash_existing.h
Martin cc05a512e1 Add file entries every min_file_incr times for each file.
The client may not be trusted => Setting to force the server to read and calculate the respective file hashes instead of trusting the client
2014-05-14 22:57:59 +02:00

39 lines
703 B
C++

#pragma once
#include "../Interface/Mutex.h"
#include "../Interface/Condition.h"
#include "server_get.h"
#include <deque>
class ServerHashExisting : public IThread
{
public:
ServerHashExisting(int clientid, BackupServerGet* server_get);
~ServerHashExisting();
void queueStop(bool front);
void queueFile(const std::wstring& fullpath, const std::wstring& hashpath);
void operator()();
private:
struct SHashItem
{
SHashItem()
: do_stop(false)
{}
std::wstring fullpath;
std::wstring hashpath;
bool do_stop;
};
IMutex* mutex;
ICondition* cond;
std::deque<SHashItem> queue;
bool has_error;
int clientid;
BackupServerGet* server_get;
};