summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-09-04 13:53:10 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-09-04 13:53:10 +0200
commitad2d0cef574ff0143ee27cdbd058cba179368dbd (patch)
treec97a2f993eb141cfae880d90dc0f4ea57c4be2db /methods
parentf352743312edeebf666e1c8304cdc4baf457469f (diff)
parent056c36565706cad136df288db777c01555f4ecd9 (diff)
merged from lp:~donkult/apt/debian-experimental
Diffstat (limited to 'methods')
-rw-r--r--methods/http.cc11
-rw-r--r--methods/https.cc2
-rw-r--r--methods/mirror.cc2
-rw-r--r--methods/rred.cc1
4 files changed, 9 insertions, 7 deletions
diff --git a/methods/http.cc b/methods/http.cc
index c62ca71d3..acf25a42a 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;
@@ -602,7 +602,7 @@ bool ServerState::HeaderLine(string Line)
return true;
Size = strtoull(Val.c_str(), NULL, 10);
- if (Size == ULLONG_MAX)
+ if (Size >= std::numeric_limits<unsigned long long>::max())
return _error->Errno("HeaderLine", _("The HTTP server sent an invalid Content-Length header"));
return true;
}
@@ -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;
@@ -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 */
}
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",
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<std::string>::const_iterator I = vec.begin();
I != vec.end(); ++I)
if (I == vec.begin())
- fetch += "?arch" + (*I);
+ fetch += "?arch=" + (*I);
else
fetch += "&arch=" + (*I);
diff --git a/methods/rred.cc b/methods/rred.cc
index 78d1595d4..7c65f8f92 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -15,7 +15,6 @@
#include <utime.h>
#include <stdio.h>
#include <errno.h>
-#include <zlib.h>
#include <apti18n.h>
/*}}}*/
/** \brief RredMethod - ed-style incremential patch method {{{