From 9654af34ed0645cf2eecc11719838beff65995e9 Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P Date: Fri, 20 Feb 2009 16:27:54 +0100 Subject: [PATCH] merge poeml suggested changes, make sure we have the right aria version --- zypp/media/MediaAria2c.cc | 11 ++++++++++- zypp/media/MediaAria2c.h | 5 ----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/zypp/media/MediaAria2c.cc b/zypp/media/MediaAria2c.cc index 5f34f2c..8490a83 100644 --- a/zypp/media/MediaAria2c.cc +++ b/zypp/media/MediaAria2c.cc @@ -22,6 +22,7 @@ #include "zypp/base/Gettext.h" #include "zypp/ZYppCallbacks.h" +#include "zypp/Edition.h" #include "zypp/Target.h" #include "zypp/ZYppFactory.h" @@ -156,6 +157,7 @@ void fillSettingsSystemProxy( const Url&url, TransferSettings &s ) * and it is filled. */ void fillAriaCmdLine( const Pathname &ariapath, + const string &ariaver, const TransferSettings &s, const Url &url, const Pathname &destination, @@ -167,6 +169,13 @@ void fillAriaCmdLine( const Pathname &ariapath, args.push_back("--follow-metalink=mem"); args.push_back("--check-integrity=true"); + // only present in recent aria + if ( Edition(ariaver) >= Edition("1.20") ) + args.push_back( "--use-head=false"); + + // TODO make this one configurable + args.push_back( "--max-concurrent-downloads=2"); + // add the anonymous id. for ( TransferSettings::Headers::const_iterator it = s.headersBegin(); it != s.headersEnd(); @@ -484,7 +493,7 @@ void MediaAria2c::getFileCopy( const Pathname & filename , const Pathname & targ ExternalProgram::Arguments args; - fillAriaCmdLine(_aria2cPath, _settings, fileurl, target.dirname(), args); + fillAriaCmdLine(_aria2cPath, _aria2cVersion, _settings, fileurl, target.dirname(), args); do { diff --git a/zypp/media/MediaAria2c.h b/zypp/media/MediaAria2c.h index 1020ea5..9d58909 100644 --- a/zypp/media/MediaAria2c.h +++ b/zypp/media/MediaAria2c.h @@ -95,13 +95,8 @@ class MediaAria2c : public MediaHandler { bool authenticate(const std::string & availAuthTypes, bool firstTry) const; - mutable std::string _userpwd; - std::string _proxy; - std::string _proxyuserpwd; std::string _currentCookieFile; std::string _ca_path; - long _xfer_timeout; - static Pathname _cookieFile; /** Aria2c path */ -- 2.7.4