summaryrefslogtreecommitdiff
path: root/src/Xml2MetalinkProcessor.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-08-14 13:48:31 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-08-14 13:48:31 +0000
commit2f14fec78dfc96b88a905621d35f1d726df0791d (patch)
tree8eb4dc9cf94f021ccbdf77dca88924c2c9bf4cea /src/Xml2MetalinkProcessor.cc
parent43dae4fd916bb35bf7fd8554fc86ce34c3e7a31b (diff)
parent7ca1b43eddd1aba1c71a38dfb46b5ac5685b43d0 (diff)
Tagging 0.7.0 release of aria2release-0.7.0
Diffstat (limited to 'src/Xml2MetalinkProcessor.cc')
-rw-r--r--src/Xml2MetalinkProcessor.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Xml2MetalinkProcessor.cc b/src/Xml2MetalinkProcessor.cc
index bb3281a9..f68f2da2 100644
--- a/src/Xml2MetalinkProcessor.cc
+++ b/src/Xml2MetalinkProcessor.cc
@@ -88,8 +88,20 @@ MetalinkEntry* Xml2MetalinkProcessor::getEntry(const string& xpath) {
entry->version = Util::trim(xpathContent(xpath+"/m:version"));
entry->language = Util::trim(xpathContent(xpath+"/m:language"));
entry->os = Util::trim(xpathContent(xpath+"/m:os"));
- entry->md5 = Util::toLower(Util::trim(xpathContent(xpath+"/m:verification/m:hash[@type=\"md5\"]")));
- entry->sha1 = Util::toLower(Util::trim(xpathContent(xpath+"/m:verification/m:hash[@type=\"sha1\"]")));
+#ifdef ENABLE_MESSAGE_DIGEST
+ string md;
+ md = Util::toLower(Util::trim(xpathContent(xpath+"/m:verification/m:hash[@type=\"sha1\"]")));
+ if(md.size() > 0) {
+ entry->checksum.setMessageDigest(md);
+ entry->checksum.setDigestAlgo(DIGEST_ALGO_SHA1);
+ } else {
+ md = Util::toLower(Util::trim(xpathContent(xpath+"/m:verification/m:hash[@type=\"md5\"]")));
+ if(md.size() > 0) {
+ entry->checksum.setMessageDigest(md);
+ entry->checksum.setDigestAlgo(DIGEST_ALGO_MD5);
+ }
+ }
+#endif // ENABLE_MESSAGE_DIGEST
for(int index = 1; 1; index++) {
MetalinkResource* resource =
getResource(xpath+"/m:resources/m:url["+Util::itos(index)+"]");
@@ -121,6 +133,8 @@ MetalinkResource* Xml2MetalinkProcessor::getResource(const string& xpath) {
resource->type = MetalinkResource::TYPE_FTP;
} else if(type == "http") {
resource->type = MetalinkResource::TYPE_HTTP;
+ } else if(type == "https") {
+ resource->type = MetalinkResource::TYPE_HTTPS;
} else if(type == "bittorrent") {
resource->type = MetalinkResource::TYPE_BITTORRENT;
} else {