2010-02-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Fixed the bug that aria2 doesn't handle return value if error
	occurred before download begins.
	* src/MultiUrlRequestInfo.cc
	* src/main.cc
pull/1/head
Tatsuhiro Tsujikawa 2010-02-12 13:53:52 +00:00
parent 1a04d2913e
commit 2097b5e29a
3 changed files with 82 additions and 72 deletions

View File

@ -1,3 +1,10 @@
2010-02-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that aria2 doesn't handle return value if error
occurred before download begins.
* src/MultiUrlRequestInfo.cc
* src/main.cc
2010-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed SegmentManFactory class.

View File

@ -190,6 +190,9 @@ downloadresultcode::RESULT MultiUrlRequestInfo::execute()
}
}
} catch(RecoverableException& e) {
if(returnValue == downloadresultcode::FINISHED) {
returnValue = downloadresultcode::UNKNOWN_ERROR;
}
_logger->error(EX_EXCEPTION_CAUGHT, e);
}
#ifdef SIGHUP

View File

@ -195,7 +195,7 @@ downloadresultcode::RESULT main(int argc, char* argv[])
SocketCore::useSelect();
}
downloadresultcode::RESULT exitStatus = downloadresultcode::FINISHED;
try {
Logger* logger = LogFactory::getInstance();
logger->info("<<--- --- --- ---");
logger->info(" --- --- --- ---");
@ -280,20 +280,20 @@ downloadresultcode::RESULT main(int argc, char* argv[])
exitStatus = MultiUrlRequestInfo(requestGroups, op, getStatCalc(op),
getSummaryOut(op)).execute();
}
} catch(Exception& ex) {
std::cerr << EX_EXCEPTION_CAUGHT << "\n" << ex.stackTrace() << std::endl;
exitStatus = downloadresultcode::UNKNOWN_ERROR;
}
LogFactory::release();
return exitStatus;
}
} // namespace aria2
int main(int argc, char* argv[]) {
int main(int argc, char* argv[])
{
aria2::downloadresultcode::RESULT r;
try {
aria2::Platform platform;
aria2::downloadresultcode::RESULT r = aria2::main(argc, argv);
r = aria2::main(argc, argv);
} catch(aria2::Exception& ex) {
std::cerr << EX_EXCEPTION_CAUGHT << "\n" << ex.stackTrace() << std::endl;
r = aria2::downloadresultcode::UNKNOWN_ERROR;
}
return r;
}