From af74a9e2d55d6a9532eb3fbb9b96c65b7ddc1e4d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 30 Apr 2019 12:32:54 +0200 Subject: apt-pkg: URI: Add 'explicit' to single argument constructor This needs a fair amount of changes elsewhere in the code, hence this is separate from the previous commits. --- methods/basehttp.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'methods/basehttp.cc') diff --git a/methods/basehttp.cc b/methods/basehttp.cc index f8dd7c020..04c194ad9 100644 --- a/methods/basehttp.cc +++ b/methods/basehttp.cc @@ -313,7 +313,7 @@ BaseHttpMethod::DealWithHeaders(FetchResult &Res, RequestState &Req) ; else if (Req.Location[0] == '/' && Queue->Uri.empty() == false) { - URI Uri = Queue->Uri; + URI Uri(Queue->Uri); if (Uri.Host.empty() == false) NextURI = URI::SiteOnly(Uri); else @@ -332,7 +332,7 @@ BaseHttpMethod::DealWithHeaders(FetchResult &Res, RequestState &Req) else { NextURI = DeQuoteString(Req.Location); - URI tmpURI = NextURI; + URI tmpURI(NextURI); if (tmpURI.Access.find('+') != std::string::npos) { _error->Error("Server tried to trick us into using a specific implementation: %s", tmpURI.Access.c_str()); @@ -340,7 +340,7 @@ BaseHttpMethod::DealWithHeaders(FetchResult &Res, RequestState &Req) return ERROR_WITH_CONTENT_PAGE; return ERROR_UNRECOVERABLE; } - URI Uri = Queue->Uri; + URI Uri(Queue->Uri); if (Binary.find('+') != std::string::npos) { auto base = Binary.substr(0, Binary.find('+')); @@ -493,7 +493,7 @@ bool BaseHttpMethod::Fetch(FetchItem *) do { // Make sure we stick with the same server - if (Server->Comp(QueueBack->Uri) == false) + if (Server->Comp(URI(QueueBack->Uri)) == false) break; bool const UsableHashes = QueueBack->ExpectedHashes.usable(); @@ -578,14 +578,14 @@ int BaseHttpMethod::Loop() continue; // Connect to the server - if (Server == 0 || Server->Comp(Queue->Uri) == false) + if (Server == 0 || Server->Comp(URI(Queue->Uri)) == false) { if (!Queue->Proxy().empty()) { - URI uri = Queue->Uri; + URI uri(Queue->Uri); _config->Set("Acquire::" + uri.Access + "::proxy::" + uri.Host, Queue->Proxy()); } - Server = CreateServerState(Queue->Uri); + Server = CreateServerState(URI(Queue->Uri)); setPostfixForMethodNames(::URI(Queue->Uri).Host.c_str()); AllowRedirect = ConfigFindB("AllowRedirect", true); PipelineDepth = ConfigFindI("Pipeline-Depth", 10); -- cgit v1.2.3