only allocate a remote directory entry if the peer is online, or the file already exists

This commit is contained in:
csoler 2016-11-15 20:10:18 +01:00
parent 8c8cc88503
commit 99860c1eb0

View file

@ -476,8 +476,10 @@ void p3FileDatabase::cleanup()
// //
for(std::set<RsPeerId>::const_iterator it(friend_set.begin());it!=friend_set.end();++it) for(std::set<RsPeerId>::const_iterator it(friend_set.begin());it!=friend_set.end();++it)
{ {
// Check if a remote directory exists for that friend, possibly creating the index. // Check if a remote directory exists for that friend, possibly creating the index if the file does not but the friend is online.
locked_getFriendIndex(*it) ;
if(rsPeers->isOnline(*it) || RsDirUtil::fileExists(makeRemoteFileName(*it)))
locked_getFriendIndex(*it) ;
} }
// cancel existing requests for which the peer is offline // cancel existing requests for which the peer is offline