mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-29 01:08:50 -04:00
Use safer rstime_t instead of time_t
Avoid problems to serialization on different platforms, without breaking nested STL containers serialization. The conversion have been made with sed, and checked with grep, plus kdiff3 visual ispection, plus rutime tests, so it should be fine.
This commit is contained in:
parent
41aa675a9b
commit
329050a9c2
223 changed files with 930 additions and 911 deletions
|
@ -171,7 +171,7 @@ int p3FileDatabase::tick()
|
|||
tickRecv() ;
|
||||
tickSend() ;
|
||||
|
||||
time_t now = time(NULL) ;
|
||||
rstime_t now = time(NULL) ;
|
||||
|
||||
// cleanup
|
||||
// - remove/delete shared file lists for people who are not friend anymore
|
||||
|
@ -183,7 +183,7 @@ int p3FileDatabase::tick()
|
|||
mLastCleanupTime = now ;
|
||||
}
|
||||
|
||||
static time_t last_print_time = 0;
|
||||
static rstime_t last_print_time = 0;
|
||||
|
||||
if(last_print_time + 20 < now)
|
||||
{
|
||||
|
@ -604,15 +604,15 @@ void p3FileDatabase::cleanup()
|
|||
for(std::list<RsPeerId>::const_iterator it(friend_lst.begin());it!=friend_lst.end();++it)
|
||||
friend_set.insert(*it) ;
|
||||
}
|
||||
time_t now = time(NULL);
|
||||
rstime_t now = time(NULL);
|
||||
|
||||
for(uint32_t i=0;i<mRemoteDirectories.size();++i)
|
||||
if(mRemoteDirectories[i] != NULL)
|
||||
{
|
||||
time_t recurs_mod_time ;
|
||||
rstime_t recurs_mod_time ;
|
||||
mRemoteDirectories[i]->getDirectoryRecursModTime(0,recurs_mod_time) ;
|
||||
|
||||
time_t last_contact = 0 ;
|
||||
rstime_t last_contact = 0 ;
|
||||
RsPeerDetails pd ;
|
||||
if(rsPeers->getPeerDetails(mRemoteDirectories[i]->peerId(),pd))
|
||||
last_contact = pd.lastConnect ;
|
||||
|
@ -976,7 +976,7 @@ void p3FileDatabase::getExtraFilesDirDetails(void *ref,DirectoryStorage::EntryIn
|
|||
{
|
||||
// update the cache of extra files if last requested too long ago
|
||||
|
||||
time_t now = time(NULL);
|
||||
rstime_t now = time(NULL);
|
||||
|
||||
if(mLastExtraFilesCacheUpdate + DELAY_BETWEEN_EXTRA_FILES_CACHE_UPDATES <= now)
|
||||
{
|
||||
|
@ -1627,7 +1627,7 @@ void p3FileDatabase::handleDirSyncRequest(RsFileListsSyncRequestItem *item)
|
|||
}
|
||||
else
|
||||
{
|
||||
time_t local_recurs_max_time ;
|
||||
rstime_t local_recurs_max_time ;
|
||||
mLocalSharedDirs->getDirectoryRecursModTime(entry_index,local_recurs_max_time) ;
|
||||
|
||||
if(item->last_known_recurs_modf_TS != local_recurs_max_time) // normally, should be "<", but since we provided the TS it should be equal, so != is more robust.
|
||||
|
@ -1792,7 +1792,7 @@ void p3FileDatabase::handleDirSyncResponse(RsFileListsSyncResponseItem*& sitem)
|
|||
sitem = item ;
|
||||
}
|
||||
|
||||
time_t now = time(NULL);
|
||||
rstime_t now = time(NULL);
|
||||
|
||||
// check the hash. If anything goes wrong (in the chunking for instance) the hash will not match
|
||||
|
||||
|
@ -1899,7 +1899,7 @@ void p3FileDatabase::handleDirSyncResponse(RsFileListsSyncResponseItem*& sitem)
|
|||
|
||||
void p3FileDatabase::locked_recursSweepRemoteDirectory(RemoteDirectoryStorage *rds,DirectoryStorage::EntryIndex e,int depth)
|
||||
{
|
||||
time_t now = time(NULL) ;
|
||||
rstime_t now = time(NULL) ;
|
||||
|
||||
//std::string indent(2*depth,' ') ;
|
||||
|
||||
|
@ -1912,7 +1912,7 @@ void p3FileDatabase::locked_recursSweepRemoteDirectory(RemoteDirectoryStorage *r
|
|||
P3FILELISTS_DEBUG() << "currently at entry index " << e << std::endl;
|
||||
#endif
|
||||
|
||||
time_t local_update_TS;
|
||||
rstime_t local_update_TS;
|
||||
|
||||
if(!rds->getDirectoryUpdateTime(e,local_update_TS))
|
||||
{
|
||||
|
@ -1959,9 +1959,9 @@ p3FileDatabase::DirSyncRequestId p3FileDatabase::makeDirSyncReqId(const RsPeerId
|
|||
bool p3FileDatabase::locked_generateAndSendSyncRequest(RemoteDirectoryStorage *rds,const DirectoryStorage::EntryIndex& e)
|
||||
{
|
||||
RsFileHash entry_hash ;
|
||||
time_t now = time(NULL) ;
|
||||
rstime_t now = time(NULL) ;
|
||||
|
||||
time_t max_known_recurs_modf_time ;
|
||||
rstime_t max_known_recurs_modf_time ;
|
||||
|
||||
if(!rds->getDirectoryRecursModTime(e,max_known_recurs_modf_time))
|
||||
{
|
||||
|
@ -2118,7 +2118,7 @@ void p3FileDatabase::checkSendBannedFilesInfo()
|
|||
P3FILELISTS_DEBUG() << " Checking banned files information: " << std::endl;
|
||||
#endif
|
||||
|
||||
time_t now = time(NULL);
|
||||
rstime_t now = time(NULL);
|
||||
std::list<RsPeerId> online_friends ;
|
||||
rsPeers->getOnlineList(online_friends);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue