mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-15 09:27:09 -05:00
Merge pull request #1045 from csoler/v0.6-FT
adding pending transfers 100 at a time instead of 1 at a time when lo…
This commit is contained in:
commit
58ccf0bef4
@ -826,14 +826,15 @@ bool ftController::isActiveAndNoPending()
|
||||
|
||||
bool ftController::handleAPendingRequest()
|
||||
{
|
||||
uint32_t nb_requests_handled = 0 ;
|
||||
static const uint32_t MAX_SIMULTANEOUS_PENDING_REQUESTS = 100 ;
|
||||
|
||||
while(!mPendingRequests.empty() && nb_requests_handled++ < MAX_SIMULTANEOUS_PENDING_REQUESTS)
|
||||
{
|
||||
ftPendingRequest req;
|
||||
{
|
||||
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
|
||||
|
||||
if (mPendingRequests.size() < 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
req = mPendingRequests.front();
|
||||
mPendingRequests.pop_front();
|
||||
}
|
||||
@ -880,8 +881,8 @@ bool ftController::handleAPendingRequest()
|
||||
std::cerr << "No pending chunkmap for hash " << req.mHash << std::endl ;
|
||||
#endif
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
return !mPendingRequests.empty();
|
||||
}
|
||||
|
||||
bool ftController::alreadyHaveFile(const RsFileHash& hash, FileInfo &info)
|
||||
|
Loading…
Reference in New Issue
Block a user