2010-09-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Call RequestGroupMan::fillRequestGroupFromReserver() repeatedly
	while RequestGroupMan::requestQueueCheck() is true.
	* src/FillRequestGroupCommand.cc
pull/1/head
Tatsuhiro Tsujikawa 2010-09-08 14:42:03 +00:00
parent c51815dd52
commit 420500f6bf
2 changed files with 19 additions and 11 deletions

View File

@ -1,3 +1,9 @@
2010-09-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Call RequestGroupMan::fillRequestGroupFromReserver() repeatedly
while RequestGroupMan::requestQueueCheck() is true.
* src/FillRequestGroupCommand.cc
2010-09-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use const ref

View File

@ -63,17 +63,19 @@ bool FillRequestGroupCommand::execute()
}
SharedHandle<RequestGroupMan> rgman = e_->getRequestGroupMan();
if(rgman->queueCheckRequested()) {
try {
// During adding RequestGroup,
// RequestGroupMan::requestQueueCheck() might be called, so
// first clear it here.
rgman->clearQueueCheck();
rgman->fillRequestGroupFromReserver(e_);
} catch(RecoverableException& ex) {
getLogger()->error(EX_EXCEPTION_CAUGHT, ex);
// Re-request queue check to fulfill the requests of all
// downloads, some might come after this exception.
rgman->requestQueueCheck();
while(rgman->queueCheckRequested()) {
try {
// During adding RequestGroup,
// RequestGroupMan::requestQueueCheck() might be called, so
// first clear it here.
rgman->clearQueueCheck();
rgman->fillRequestGroupFromReserver(e_);
} catch(RecoverableException& ex) {
getLogger()->error(EX_EXCEPTION_CAUGHT, ex);
// Re-request queue check to fulfill the requests of all
// downloads, some might come after this exception.
rgman->requestQueueCheck();
}
}
if(rgman->downloadFinished()) {
return true;