mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-19 11:54:22 -04:00
commit
34dd68d7bf
1 changed files with 5 additions and 0 deletions
|
@ -1539,6 +1539,8 @@ bool ftServer::checkUploadLimit(const RsPeerId& pid,const RsFileHash& hash)
|
||||||
|
|
||||||
uint32_t max_ups = mFtController->getMaxUploadsPerFriend() ;
|
uint32_t max_ups = mFtController->getMaxUploadsPerFriend() ;
|
||||||
|
|
||||||
|
RS_STACK_MUTEX(srvMutex) ;
|
||||||
|
|
||||||
if(max_ups == 0)
|
if(max_ups == 0)
|
||||||
{
|
{
|
||||||
#ifdef SERVER_DEBUG
|
#ifdef SERVER_DEBUG
|
||||||
|
@ -1580,7 +1582,10 @@ bool ftServer::checkUploadLimit(const RsPeerId& pid,const RsFileHash& hash)
|
||||||
for(it = tmap.begin();it!=tmap.end() && cleaned<2;)
|
for(it = tmap.begin();it!=tmap.end() && cleaned<2;)
|
||||||
if(it->second + FILE_TRANSFER_MAX_DELAY_BEFORE_DROP_USAGE_RECORD < now)
|
if(it->second + FILE_TRANSFER_MAX_DELAY_BEFORE_DROP_USAGE_RECORD < now)
|
||||||
{
|
{
|
||||||
|
std::map<RsFileHash,time_t>::iterator tmp(it) ;
|
||||||
|
++tmp;
|
||||||
tmap.erase(it) ;
|
tmap.erase(it) ;
|
||||||
|
it = tmp;
|
||||||
++cleaned ;
|
++cleaned ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue