mirror of https://github.com/aria2/aria2
* 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.pull/1/head
parent
31cf446f6d
commit
db35fe355a
|
@ -21,10 +21,15 @@
|
||||||
* src/main.cc:
|
* src/main.cc:
|
||||||
Added ENABLE_BITTORRENT around includes and blocks related to
|
Added ENABLE_BITTORRENT around includes and blocks related to
|
||||||
BitTorrent.
|
BitTorrent.
|
||||||
|
Added ENABLE_MESSAGE_DIGEST to skip checksum checking when the message
|
||||||
|
digest support is not available.
|
||||||
* src/AbstractDiskWriter.h:
|
* src/AbstractDiskWriter.h:
|
||||||
Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
|
Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
|
||||||
* src/AbstractDiskWriter.cc:
|
* src/AbstractDiskWriter.cc:
|
||||||
Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
|
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:
|
To add command-line options for Metalink:
|
||||||
|
|
||||||
|
|
19
README
19
README
|
@ -1,4 +1,4 @@
|
||||||
aria2 - a simple utility for downloading files.
|
aria2 - The high speed download utility
|
||||||
|
|
||||||
1. Disclaimer
|
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.
|
* It can run as a daemon process.
|
||||||
* BitTorrent protocol support with fast extension.
|
* BitTorrent protocol support with fast extension.
|
||||||
* Selective download in multi-file torrent
|
* Selective download in multi-file torrent
|
||||||
|
* Metalink version 3.0 support(http/ftp only).
|
||||||
|
|
||||||
3. How to build
|
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 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 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.
|
GNU TLS has precedence over OpenSSL if both libraries are installed.
|
||||||
If you prefer OpenSSL, run configure with "--without-gnutls".
|
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
|
5. BitTorrrent
|
||||||
--------------
|
--------------
|
||||||
The filename of the downloaded file is determined as follows:
|
The filename of the downloaded file is determined as follows:
|
||||||
|
@ -73,3 +79,14 @@ Note:
|
||||||
* The maximum number of peers is 55.
|
* The maximum number of peers is 55.
|
||||||
* After selective download completes, aria2 is going to download rest of the
|
* After selective download completes, aria2 is going to download rest of the
|
||||||
files.
|
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.
|
||||||
|
|
|
@ -4672,8 +4672,7 @@ fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$have_libxml2" = "xyes" && test "x$enable_metalink" = "xyes" && \
|
if test "x$have_libxml2" = "xyes" && test "x$enable_metalink" = "xyes"; then
|
||||||
test "x$enable_message_digest" = "xyes"; then
|
|
||||||
|
|
||||||
cat >>confdefs.h <<\_ACEOF
|
cat >>confdefs.h <<\_ACEOF
|
||||||
#define ENABLE_METALINK 1
|
#define ENABLE_METALINK 1
|
||||||
|
|
|
@ -70,8 +70,7 @@ else
|
||||||
AM_CONDITIONAL([ENABLE_BITTORRENT], false)
|
AM_CONDITIONAL([ENABLE_BITTORRENT], false)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$have_libxml2" = "xyes" && test "x$enable_metalink" = "xyes" && \
|
if test "x$have_libxml2" = "xyes" && test "x$enable_metalink" = "xyes"; then
|
||||||
test "x$enable_message_digest" = "xyes"; then
|
|
||||||
AC_DEFINE([ENABLE_METALINK], [1], [Define to 1 if Metalink support is enabled.])
|
AC_DEFINE([ENABLE_METALINK], [1], [Define to 1 if Metalink support is enabled.])
|
||||||
AM_CONDITIONAL([ENABLE_METALINK], true)
|
AM_CONDITIONAL([ENABLE_METALINK], true)
|
||||||
else
|
else
|
||||||
|
|
|
@ -30,6 +30,7 @@ MetalinkEntry::~MetalinkEntry() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MetalinkEntry::check(const string& filename) const {
|
bool MetalinkEntry::check(const string& filename) const {
|
||||||
|
#ifdef ENABLE_MESSAGE_DIGEST
|
||||||
unsigned char buf[20];
|
unsigned char buf[20];
|
||||||
int digestLength;
|
int digestLength;
|
||||||
const string* digestPtr;
|
const string* digestPtr;
|
||||||
|
@ -47,6 +48,9 @@ bool MetalinkEntry::check(const string& filename) const {
|
||||||
}
|
}
|
||||||
Util::fileChecksum(filename, buf, algo);
|
Util::fileChecksum(filename, buf, algo);
|
||||||
return *digestPtr == Util::toHex(buf, digestLength);
|
return *digestPtr == Util::toHex(buf, digestLength);
|
||||||
|
#else
|
||||||
|
return true;
|
||||||
|
#endif //ENABLE_MESSAGE_DIGEST
|
||||||
}
|
}
|
||||||
|
|
||||||
class PrefOrder {
|
class PrefOrder {
|
||||||
|
|
|
@ -790,12 +790,14 @@ int main(int argc, char* argv[]) {
|
||||||
requests.clear();
|
requests.clear();
|
||||||
|
|
||||||
if(success) {
|
if(success) {
|
||||||
|
#ifdef ENABLE_MESSAGE_DIGEST
|
||||||
if(entry->check(downloadedFilename)) {
|
if(entry->check(downloadedFilename)) {
|
||||||
printf("checksum OK.\n");
|
printf("checksum OK.\n");
|
||||||
} else {
|
} else {
|
||||||
printf("checksum ERROR.\n");
|
printf("checksum ERROR.\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_MESSAGE_DIGEST
|
||||||
}
|
}
|
||||||
|
|
||||||
delete metalinker;
|
delete metalinker;
|
||||||
|
|
Loading…
Reference in New Issue