mirror of
https://github.com/uroni/urbackup_backend.git
synced 2025-10-26 11:36:50 +00:00
The client may not be trusted => Setting to force the server to read and calculate the respective file hashes instead of trusting the client
39 lines
703 B
C++
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;
|
|
}; |