From e0cb0f4847a0abd65b5f10523838695b1495602f Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 8 May 2017 23:04:04 +0200 Subject: [PATCH] fixed previous commit --- libretroshare/src/ft/ftserver.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index a10d1ce02..a7bfe49f0 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -1539,6 +1539,8 @@ bool ftServer::checkUploadLimit(const RsPeerId& pid,const RsFileHash& hash) uint32_t max_ups = mFtController->getMaxUploadsPerFriend() ; + RS_STACK_MUTEX(srvMutex) ; + if(max_ups == 0) { #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;) if(it->second + FILE_TRANSFER_MAX_DELAY_BEFORE_DROP_USAGE_RECORD < now) { + std::map::iterator tmp(it) ; + ++tmp; tmap.erase(it) ; + it = tmp; ++cleaned ; } else