improved strategy of cleaning unfinished cache transfers

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4171 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-04-25 14:20:57 +00:00
parent 61b387447f
commit 993e0d225c
4 changed files with 14 additions and 7 deletions

View file

@ -35,7 +35,9 @@ ftFileCreator::ftFileCreator(const std::string& path, uint64_t size, const std::
std::cerr << std::endl;
#endif
RsStackMutex stack(ftcMutex); /********** STACK LOCKED MTX ******/
_last_recv_time_t = time(NULL) ;
time_t now = time(NULL) ;
_last_recv_time_t = now ;
_creation_time = now ;
}
bool ftFileCreator::getFileData(const std::string& peer_id,uint64_t offset, uint32_t &chunk_size, void *data)
@ -64,6 +66,11 @@ bool ftFileCreator::getFileData(const std::string& peer_id,uint64_t offset, uint
return false ;
}
time_t ftFileCreator::creationTimeStamp()
{
RsStackMutex stack(ftcMutex); /********** STACK LOCKED MTX ******/
return _creation_time ;
}
time_t ftFileCreator::lastRecvTimeStamp()
{
RsStackMutex stack(ftcMutex); /********** STACK LOCKED MTX ******/