summaryrefslogtreecommitdiff
path: root/src/DownloadEngineFactory.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-08-07 16:05:00 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-08-07 16:05:00 +0000
commit58dbaafc8502c9537972904aa5f4e42a73b9f066 (patch)
treeaf13c906fe21f5748431814d8af985700abfa43d /src/DownloadEngineFactory.h
parent9251b47f6cccc7cd5175ab6858c3330eb0752061 (diff)
2006-08-08 Tatsuhiro Tsujikawa <tujikawa@rednoah.com>
* src/FtpNegotiateCommand.cc (recvGreeting): Call disableWriteCheckSocket just after socket->setBlockingMode(). This avoids unnecessary CPU-hog loop. 2006-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/PeerChokeCommand.h (PeerChokeCommand): Rearranged the arguments. * src/PeerChokeCommand.cc (PeerChokeCommand): Rearranged the arguments. * src/MetalinkEntry.h (Checksum.h): Included. (md5): Removed. (sha1): Removed. (checksum): New variable. (operator=): Updated. (check): Removed. * src/prefs.h (PREF_LOWEST_SPEED_LIMIT): New definition. (PREF_FOLLOW_TORRENT): New definition. (PREF_SELECT_FILE): New definition. (PREF_FOLLOW_METALINK): New definition. * src/MetalinkResource.h (TYPE_HTTPS): Added to enum TYPE. * src/TorrentMan.cc (~TorrentMan): Rewritten. * src/MultiDiskWriter.cc (MultiDiskAdaptor): Updated according to the changes in MessageDigestContext. (~MultiDiskAdaptor): Updated according to the changes in MessageDigestContext. (hashUpdate): Updated according to the changes in MessageDigestContext. (sha1Sum): Updated according to the changes in MessageDigestContext. * src/Util.h (fileChecksum): Updated according to the changes in MessageDigestContext. * src/Util.cc (sha1Sum): Updated according to the changes in MessageDigestContext. (fileChecksum): Updated according to the changes in MessageDigestContext. * src/messageDigest.h: Rewritten. * src/MetalinkEntry.cc (check): Removed. (Supported): Updated. (dropUnsupportedResource): Fixed a memory leak. * src/ShaVisitor.cc (ShaVisitor): Updated according to the changes in MessageDigestContext. (~ShaVisitor): Updated according to the changes in MessageDigestContext. (visit): Updated according to the changes in MessageDigestContext. * src/main.cc (main): Rewritten the portion of download loop. --lowest-speed-limit command-line option added. * src/DownloadEngine.h (SocketEntry): New class. (SocketEntries): New definition. (PairFind): Removed. (SockCmdMap): Removed. * src/DownloadEngine.cc (DownloadEngine): Rewritten. (~DownloadEngine): Rewritten. (run): Renamed activeCommandUuids as activeUuids. (SetDescriptor): Rewritten. (AccumulateActiveCommandUuid): Removed. (AccumulateActiveUuid): New function object. (waitData): Rewritten. (updateFdSet): Rewritten. (addSocket): Rewritten. (deleteSocket): Rewritten. (addSocketForReadCheck): Rewritten. (deleteSocketForReadCheck): Rewritten. (addSocketForWriteCheck): Rewritten. (deleteSocketForWriteCheck): Rewritten. * src/Xml2MetalinkProcessor.cc (getEntry): Rewritten the portion of MetalinkEntry creation. * src/DownloadCommand.cc (executeInternal): Added the check routine for lowest speed limit. * src/AbstractDiskWriter.cc (AbstractDiskWriter): Updated according to the changes in MessageDigestContext. (~AbstractDiskWriter): Updated according to the changes in MessageDigestContext. (sha1Sum): Updated according to the changes in MessageDigestContext. * src/RequestInfo.h: New class. * src/UrlRequestInfo.h: New class. * src/UrlRequestInfo.cc: New class. * src/TorrentRequestInfo.h: New class. * src/TorrentRequestInfo.cc: New class. * src/MetalinkRequestInfo.h: New class. * src/MetalinkRequestInfo.cc: New class. * src/Checksum.h: New class. * src/DownloadEngineFactory.h: New class. * src/DownloadEngineFactory.cc: New class.
Diffstat (limited to 'src/DownloadEngineFactory.h')
-rw-r--r--src/DownloadEngineFactory.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/DownloadEngineFactory.h b/src/DownloadEngineFactory.h
new file mode 100644
index 00000000..10108fbc
--- /dev/null
+++ b/src/DownloadEngineFactory.h
@@ -0,0 +1,46 @@
+/* <!-- copyright */
+/*
+ * aria2 - a simple utility for downloading files faster
+ *
+ * Copyright (C) 2006 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+/* copyright --> */
+#ifndef _D_DOWNLOAD_ENGINE_FACTORY_H_
+#define _D_DOWNLOAD_ENGINE_FACTORY_H_
+
+#include "common.h"
+#include "ConsoleDownloadEngine.h"
+#ifdef ENABLE_BITTORRENT
+# include "TorrentConsoleDownloadEngine.h"
+#endif // ENABLE_BITTORRENT
+
+class DownloadEngineFactory {
+public:
+ static ConsoleDownloadEngine*
+ newConsoleEngine(const Option* option,
+ const Requests& requests,
+ const Requests& reserved);
+
+#ifdef ENABLE_BITTORRENT
+ static TorrentConsoleDownloadEngine*
+ newTorrentConsoleEngine(const Option* option,
+ const string& torrentFile,
+ const Strings& targetFiles);
+#endif // ENABLE_BITTORRENT
+};
+
+#endif // _D_DOWNLOAD_ENGINE_FACTORY_H_