diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-01-24 10:40:42 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-01-24 10:40:42 +0000 |
| commit | adf91f656b3f99ab3a624418b170b9183bfe8d8c (patch) | |
| tree | 40d14bb702aaaf1f8f253b1f2759d9a0c7ed8d89 /src/CheckIntegrityDispatcherCommand.cc | |
| parent | 5da58fe01d31fe2ab647764308dbdb5d93cd721e (diff) | |
2009-01-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made (piece) hash check sequential for each RequestGroup because
simultaneous hash check is slower than sequential execution.
* src/CheckIntegrityCommand.cc
* src/CheckIntegrityDispatcherCommand.cc
* src/CheckIntegrityDispatcherCommand.h
* src/CheckIntegrityMan.h
* src/ConsoleStatCalc.cc
* src/DownloadCommand.cc
* src/DownloadEngine.cc
* src/DownloadEngine.h
* src/DownloadEngineFactory.cc
* src/Makefile.am
* src/Makefile.in
* src/RequestGroup.cc
* src/StatCalc.h
Diffstat (limited to 'src/CheckIntegrityDispatcherCommand.cc')
| -rw-r--r-- | src/CheckIntegrityDispatcherCommand.cc | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/CheckIntegrityDispatcherCommand.cc b/src/CheckIntegrityDispatcherCommand.cc new file mode 100644 index 00000000..fff00638 --- /dev/null +++ b/src/CheckIntegrityDispatcherCommand.cc @@ -0,0 +1,62 @@ +/* <!-- copyright */ +/* + * aria2 - The high speed download utility + * + * Copyright (C) 2009 Tatsuhiro Tsujikawa + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * In addition, as a special exception, the copyright holders give + * permission to link the code of portions of this program with the + * OpenSSL library under certain conditions as described in each + * individual source file, and distribute linked combinations + * including the two. + * You must obey the GNU General Public License in all respects + * for all of the code used other than OpenSSL. If you modify + * file(s) with this exception, you may extend this exception to your + * version of the file(s), but you are not obligated to do so. If you + * do not wish to do so, delete this exception statement from your + * version. If you delete this exception statement from all source + * files in the program, then also delete it here. + */ +/* copyright --> */ +#include "CheckIntegrityDispatcherCommand.h" +#include "CheckIntegrityEntry.h" +#include "CheckIntegrityCommand.h" +#include "message.h" +#include "Logger.h" + +namespace aria2 { + +CheckIntegrityDispatcherCommand::CheckIntegrityDispatcherCommand +(int32_t cuid, + const SharedHandle<CheckIntegrityMan>& fileAllocMan, + DownloadEngine* e):SequentialDispatcherCommand<CheckIntegrityEntry> + (cuid, fileAllocMan, e) +{ + setStatusRealtime(); +} + +Command* CheckIntegrityDispatcherCommand::createCommand +(const SharedHandle<CheckIntegrityEntry>& entry) +{ + int32_t newCUID = _e->newCUID(); + logger->info("CUID#%d - Dispatching CheckIntegrityCommand CUID#%d.", + cuid, newCUID); + return new CheckIntegrityCommand + (newCUID, entry->getRequestGroup(), _e, entry); +} + +} // namespace aria2 |
