summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-07-04 11:44:15 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-07-04 11:44:15 +0000
commitdb35fe355ab460528cc4bc9892e341dcaf201756 (patch)
treef16666fac2886ffffe9af75be09cd28d65a1b4fe
parent31cf446f6d078efe96fe0d5e7433cf56a224a493 (diff)
* src/main.cc:
Added ENABLE_MESSAGE_DIGEST to skip checksum checking when the message digest support is not available. * src/MetalinkEntry.cc (check): Added ENABLE_MESSAGE_DIGEST. Return true if the message digest support is not available.
-rw-r--r--ChangeLog5
-rw-r--r--README21
-rwxr-xr-xconfigure3
-rw-r--r--configure.ac3
-rw-r--r--src/MetalinkEntry.cc4
-rw-r--r--src/main.cc2
6 files changed, 32 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 9659a831..08aa08f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,10 +21,15 @@
* src/main.cc:
Added ENABLE_BITTORRENT around includes and blocks related to
BitTorrent.
+ Added ENABLE_MESSAGE_DIGEST to skip checksum checking when the message
+ digest support is not available.
* src/AbstractDiskWriter.h:
Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
* src/AbstractDiskWriter.cc:
Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
+ * src/MetalinkEntry.cc
+ (check): Added ENABLE_MESSAGE_DIGEST. Return true if the message digest
+ support is not available.
To add command-line options for Metalink:
diff --git a/README b/README
index e4b7dcda..e164f3c8 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-aria2 - a simple utility for downloading files.
+aria2 - The high speed download utility
1. Disclaimer
-------------
@@ -22,6 +22,7 @@ aria2 is in very early development stage. Currently it has following features:
* It can run as a daemon process.
* BitTorrent protocol support with fast extension.
* Selective download in multi-file torrent
+* Metalink version 3.0 support(http/ftp only).
3. How to build
---------------
@@ -34,10 +35,15 @@ The executable is aria2c in src directory.
-------------
In order to enable HTTPS support, you need GNU TLS or OpenSSL.
In order to enable BitTorrent support, you need GNU TLS+libgcrypt or OpenSSL.
+In order to enable Metalink support, you need libxml2. Optionally GNU TLS+
+libgcrypt or OpenSSL are required for checksum checking support(MD5, SHA1).
GNU TLS has precedence over OpenSSL if both libraries are installed.
If you prefer OpenSSL, run configure with "--without-gnutls".
+You can disable BitTorrent, Metalink support by providing --disable-bittorrent,
+--disable-metalink respectively to configure script.
+
5. BitTorrrent
--------------
The filename of the downloaded file is determined as follows:
@@ -72,4 +78,15 @@ Note:
* The ports aria2c uses are 6881-6999.
* The maximum number of peers is 55.
* After selective download completes, aria2 is going to download rest of the
-files. \ No newline at end of file
+files.
+
+6. Metalink
+-----------
+The current implementation only supports http/ftp downloading in Metalink.
+BitTorrent and other p2p protocols are ignored.
+
+For checksum checking, both MD5 and SHA1 are supported. If both values are
+provided, then aria2 uses SHA1. If checksum checking is failed, aria2 doesn't
+retry the download and just exits with non-zero return code.
+
+The supported user preferences are version, language and os.
diff --git a/configure b/configure
index 020ed24d..4dc01ebe 100755
--- a/configure
+++ b/configure
@@ -4672,8 +4672,7 @@ fi
fi
-if test "x$have_libxml2" = "xyes" && test "x$enable_metalink" = "xyes" && \
- test "x$enable_message_digest" = "xyes"; then
+if test "x$have_libxml2" = "xyes" && test "x$enable_metalink" = "xyes"; then
cat >>confdefs.h <<\_ACEOF
#define ENABLE_METALINK 1
diff --git a/configure.ac b/configure.ac
index 37f05285..037946a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,8 +70,7 @@ else
AM_CONDITIONAL([ENABLE_BITTORRENT], false)
fi
-if test "x$have_libxml2" = "xyes" && test "x$enable_metalink" = "xyes" && \
- test "x$enable_message_digest" = "xyes"; then
+if test "x$have_libxml2" = "xyes" && test "x$enable_metalink" = "xyes"; then
AC_DEFINE([ENABLE_METALINK], [1], [Define to 1 if Metalink support is enabled.])
AM_CONDITIONAL([ENABLE_METALINK], true)
else
diff --git a/src/MetalinkEntry.cc b/src/MetalinkEntry.cc
index 506b5999..6eb86f50 100644
--- a/src/MetalinkEntry.cc
+++ b/src/MetalinkEntry.cc
@@ -30,6 +30,7 @@ MetalinkEntry::~MetalinkEntry() {
}
bool MetalinkEntry::check(const string& filename) const {
+#ifdef ENABLE_MESSAGE_DIGEST
unsigned char buf[20];
int digestLength;
const string* digestPtr;
@@ -47,6 +48,9 @@ bool MetalinkEntry::check(const string& filename) const {
}
Util::fileChecksum(filename, buf, algo);
return *digestPtr == Util::toHex(buf, digestLength);
+#else
+ return true;
+#endif //ENABLE_MESSAGE_DIGEST
}
class PrefOrder {
diff --git a/src/main.cc b/src/main.cc
index 154dbe07..718e2c9a 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -790,12 +790,14 @@ int main(int argc, char* argv[]) {
requests.clear();
if(success) {
+#ifdef ENABLE_MESSAGE_DIGEST
if(entry->check(downloadedFilename)) {
printf("checksum OK.\n");
} else {
printf("checksum ERROR.\n");
exit(EXIT_FAILURE);
}
+#endif // ENABLE_MESSAGE_DIGEST
}
delete metalinker;