From e07ee38ed15a61e6e6810b76e92e4fd6adb87181 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 12 Dec 2007 14:08:19 +0000 Subject: [PATCH] 2007-12-12 Tatsuhiro Tsujikawa Disabled -s option in metalink download. * src/Metalink2RequestGroup.cc --- ChangeLog | 11 ++++++++--- src/Metalink2RequestGroup.cc | 20 +++++--------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index b6be63f6..b72cc91b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,13 @@ 2007-12-12 Tatsuhiro Tsujikawa - If several protocols are available for a mirror, aria2 now use one of - them. --metalink-preferred-protocol option was added to specify the - preference of protocol. + Disabled -s option in metalink download. + * src/Metalink2RequestGroup.cc + +2007-12-12 Tatsuhiro Tsujikawa + + If several protocols are available for a mirror in metalink file, + aria2 now use one of them. --metalink-preferred-protocol option was + added to specify the preference of protocol. * src/AbstractCommand.cc * src/OptionHandlerFactory.cc * src/ServerHost.{h, cc} diff --git a/src/Metalink2RequestGroup.cc b/src/Metalink2RequestGroup.cc index dda5efb9..997bca40 100644 --- a/src/Metalink2RequestGroup.cc +++ b/src/Metalink2RequestGroup.cc @@ -55,27 +55,17 @@ Metalink2RequestGroup::~Metalink2RequestGroup() {} class AccumulateNonP2PUrl { private: - Strings* urlsPtr; - int32_t split; + Strings& urlsPtr; public: - AccumulateNonP2PUrl(Strings* urlsPtr, int32_t split) - :urlsPtr(urlsPtr), - split(split) {} + AccumulateNonP2PUrl(Strings& urlsPtr) + :urlsPtr(urlsPtr) {} void operator()(const MetalinkResourceHandle& resource) { - int32_t maxConnections; - if(resource->maxConnections < 0) { - maxConnections = split; - } else { - maxConnections = min(resource->maxConnections, split); - } switch(resource->type) { case MetalinkResource::TYPE_HTTP: case MetalinkResource::TYPE_HTTPS: case MetalinkResource::TYPE_FTP: - for(int32_t s = 1; s <= maxConnections; s++) { - urlsPtr->push_back(resource->url); - } + urlsPtr.push_back(resource->url); break; default: break; @@ -174,7 +164,7 @@ RequestGroups Metalink2RequestGroup::createRequestGroup(MetalinkEntries entries) entry->reorderResourcesByPreference(); Strings uris; for_each(entry->resources.begin(), entry->resources.end(), - AccumulateNonP2PUrl(&uris, _option->getAsInt(PREF_SPLIT))); + AccumulateNonP2PUrl(uris)); RequestGroupHandle rg = new RequestGroup(_option, uris); // If piece hash is specified in the metalink, // make segment size equal to piece hash size.