mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 07:29:33 -05:00
avoid corrupting file cache on 64bits architectures that store time_t as 32 bits
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6619 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
299678b9c8
commit
a98642dab5
@ -199,7 +199,7 @@ bool HashCache::find(const std::string& full_path,uint64_t size,time_t time_stam
|
||||
time_t now = time(NULL) ;
|
||||
std::map<std::string,HashCacheInfo>::iterator it(_files.find(full_path)) ;
|
||||
|
||||
if(it != _files.end() && time_stamp == it->second.modf_stamp && size == it->second.size)
|
||||
if(it != _files.end() && (uint64_t)time_stamp == it->second.modf_stamp && size == it->second.size)
|
||||
{
|
||||
hash = it->second.hash ;
|
||||
it->second.time_stamp = now ;
|
||||
@ -244,7 +244,7 @@ void HashCache::clean()
|
||||
#endif
|
||||
|
||||
for(std::map<std::string,HashCacheInfo>::iterator it(_files.begin());it!=_files.end();)
|
||||
if(it->second.time_stamp + duration < now)
|
||||
if(it->second.time_stamp + duration < (uint64_t)now)
|
||||
{
|
||||
#ifdef FIM_DEBUG
|
||||
std::cerr << " Entry too old: " << it->first << ", ts=" << it->second.time_stamp << std::endl ;
|
||||
|
@ -84,8 +84,8 @@ class HashCache
|
||||
typedef struct
|
||||
{
|
||||
uint64_t size ;
|
||||
time_t time_stamp ;
|
||||
time_t modf_stamp ;
|
||||
uint64_t time_stamp ;
|
||||
uint64_t modf_stamp ;
|
||||
std::string hash ;
|
||||
} HashCacheInfo ;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user