From 5674f6b3163d73260e25ce7d350aaac50071eb0e Mon Sep 17 00:00:00 2001 From: Raphael Geissert Date: Mon, 14 May 2012 18:07:01 +0200 Subject: * apt-pkg/acquire*.cc: - handle redirections in the worker with the right method instead of in the method the redirection occured in (Closes: #668111) * methods/http.cc: - forbid redirects to change protocol --- methods/http.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/http.cc b/methods/http.cc index b450b6ffc..bb02176e9 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -985,7 +985,10 @@ HttpMethod::DealWithHeaders(FetchResult &Res,ServerState *Srv) else { NextURI = DeQuoteString(Srv->Location); - return TRY_AGAIN_OR_REDIRECT; + URI tmpURI = NextURI; + // Do not allow a redirection to switch protocol + if (tmpURI.Access == "http") + return TRY_AGAIN_OR_REDIRECT; } /* else pass through for error message */ } -- cgit v1.2.3 From 046e104e1371584251ad2568a11090fe4ed9a42e Mon Sep 17 00:00:00 2001 From: Raphael Geissert Date: Mon, 14 May 2012 18:27:37 +0200 Subject: * methods/mirror.cc: - generate an equal sign also for the first arch (Closes: #669142) --- methods/mirror.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/mirror.cc b/methods/mirror.cc index eb6d97425..d6c5ba955 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -150,7 +150,7 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str) for (std::vector::const_iterator I = vec.begin(); I != vec.end(); ++I) if (I == vec.begin()) - fetch += "?arch" + (*I); + fetch += "?arch=" + (*I); else fetch += "&arch=" + (*I); -- cgit v1.2.3 From 8221431757c775ee875a061b184b5f6f2330f928 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 15 May 2012 00:12:21 +0200 Subject: * methods/http.cc: - after many years of pointless discussions disable http/1.1 pipelining by default as many webservers and proxies seem to be unable to conform to specification must's (rfc2616 section 8.1.2.2) (LP: #996151) --- methods/http.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/http.cc b/methods/http.cc index bb02176e9..c8e6f1b7b 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -61,7 +61,7 @@ using namespace std; string HttpMethod::FailFile; int HttpMethod::FailFd = -1; time_t HttpMethod::FailTime = 0; -unsigned long PipelineDepth = 10; +unsigned long PipelineDepth = 0; unsigned long TimeOut = 120; bool AllowRedirect = false; bool Debug = false; -- cgit v1.2.3 From 335e2c82afc5ddb305c9e36fac17a024d7dc9c3f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 17 May 2012 14:21:13 +0200 Subject: add spaces around PACKAGE_VERSION to fix FTBFS with -std=c++11 --- methods/http.cc | 2 +- methods/https.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'methods') diff --git a/methods/http.cc b/methods/http.cc index c8e6f1b7b..acf25a42a 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -758,7 +758,7 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out) Base64Encode(Uri.User + ":" + Uri.Password) + "\r\n"; } Req += "User-Agent: " + _config->Find("Acquire::http::User-Agent", - "Debian APT-HTTP/1.3 ("PACKAGE_VERSION")") + "\r\n\r\n"; + "Debian APT-HTTP/1.3 (" PACKAGE_VERSION ")") + "\r\n\r\n"; if (Debug == true) cerr << Req << endl; diff --git a/methods/https.cc b/methods/https.cc index fac7ba790..c1a49ba60 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -219,7 +219,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm) curl_easy_setopt(curl, CURLOPT_USERAGENT, _config->Find("Acquire::https::User-Agent", _config->Find("Acquire::http::User-Agent", - "Debian APT-CURL/1.0 ("PACKAGE_VERSION")").c_str()).c_str()); + "Debian APT-CURL/1.0 (" PACKAGE_VERSION ")").c_str()).c_str()); // set timeout int const timeout = _config->FindI("Acquire::https::Timeout", -- cgit v1.2.3