added deterministic but unredictable hash generation for dir hashes, which should be preserved accross reboots. Should fix the msg from friends sending requests for the "wrong" dir hashes.

This commit is contained in:
csoler 2016-10-12 23:20:38 +02:00
parent 3c5e12ae84
commit bd9a464d11
8 changed files with 63 additions and 19 deletions

View file

@ -41,6 +41,9 @@ public:
void forceUpdate();
bool inDirectoryCheck() const ;
void setHashSalt(const RsFileHash& hash) { mHashSalt = hash; }
const RsFileHash& hashSalt() const { return mHashSalt; }
void setFileWatchPeriod(int seconds) ;
uint32_t fileWatchPeriod() const ;
@ -60,6 +63,8 @@ private:
HashStorage *mHashCache ;
LocalDirectoryStorage *mSharedDirectories ;
RsFileHash mHashSalt ;
time_t mLastSweepTime;
time_t mLastTSUpdateTime;