From 048a2cf59737f761876e81a77e8d064c45c752d7 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 11 Oct 2007 16:58:24 +0000 Subject: 2007-10-12 Tatsuhiro Tsujikawa Implemented BitTorrent/http/ftp integrated download. I've rewritten lots of files and now some headers have forward class declarations to reduce compile time. The implementation is extremely alpha stage, I recommend to use this for testing purpose only. --- src/FillRequestGroupCommand.cc | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/FillRequestGroupCommand.cc') diff --git a/src/FillRequestGroupCommand.cc b/src/FillRequestGroupCommand.cc index 5c4b6399..85786af8 100644 --- a/src/FillRequestGroupCommand.cc +++ b/src/FillRequestGroupCommand.cc @@ -33,11 +33,33 @@ */ /* copyright --> */ #include "FillRequestGroupCommand.h" +#include "DownloadEngine.h" +#include "RequestGroupMan.h" +#include "RequestGroup.h" +#include "DlAbortEx.h" +#include "message.h" + +FillRequestGroupCommand::FillRequestGroupCommand(int32_t cuid, + DownloadEngine* e, + int32_t interval): + Command(cuid), + _e(e), + _interval(interval) +{ + setStatusRealtime(); +} + +FillRequestGroupCommand::~FillRequestGroupCommand() {} bool FillRequestGroupCommand::execute() { - _e->_requestGroupMan->fillRequestGroupFromReserver(_e); - if(_e->_requestGroupMan->downloadFinished()) { + try { + _e->_requestGroupMan->fillRequestGroupFromReserver(_e); + } catch(DlAbortEx* ex) { + logger->error(EX_EXCEPTION_CAUGHT, ex); + delete ex; + } + if(_e->_requestGroupMan->downloadFinished() || _e->isHaltRequested()) { return true; } _e->commands.push_back(this); -- cgit