summaryrefslogtreecommitdiff
path: root/methods/connect.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-09-19 13:31:29 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-09-19 13:31:29 +0200
commit8f3ba4e8708cb72be19dacc2af4f601ee5fea292 (patch)
treef624675aa3d4add287f253e19eb28c0dce5669f1 /methods/connect.cc
parentc333ea435b67d7d7d7d10e867298ecac4da0f7b8 (diff)
do not pollute namespace in the headers with using (Closes: #500198)
Diffstat (limited to 'methods/connect.cc')
-rw-r--r--methods/connect.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/methods/connect.cc b/methods/connect.cc
index 16fb6e793..ba2264faa 100644
--- a/methods/connect.cc
+++ b/methods/connect.cc
@@ -35,13 +35,13 @@
#include <apti18n.h>
/*}}}*/
-static string LastHost;
+static std::string LastHost;
static int LastPort = 0;
static struct addrinfo *LastHostAddr = 0;
static struct addrinfo *LastUsed = 0;
// Set of IP/hostnames that we timed out before or couldn't resolve
-static std::set<string> bad_addr;
+static std::set<std::string> bad_addr;
// RotateDNS - Select a new server from a DNS rotation /*{{{*/
// ---------------------------------------------------------------------
@@ -58,7 +58,7 @@ void RotateDNS()
// DoConnect - Attempt a connect operation /*{{{*/
// ---------------------------------------------------------------------
/* This helper function attempts a connection to a single address. */
-static bool DoConnect(struct addrinfo *Addr,string Host,
+static bool DoConnect(struct addrinfo *Addr,std::string Host,
unsigned long TimeOut,int &Fd,pkgAcqMethod *Owner)
{
// Show a status indicator
@@ -73,7 +73,7 @@ static bool DoConnect(struct addrinfo *Addr,string Host,
Owner->Status(_("Connecting to %s (%s)"),Host.c_str(),Name);
// if that addr did timeout before, we do not try it again
- if(bad_addr.find(string(Name)) != bad_addr.end())
+ if(bad_addr.find(std::string(Name)) != bad_addr.end())
return false;
/* If this is an IP rotation store the IP we are using.. If something goes
@@ -100,7 +100,7 @@ static bool DoConnect(struct addrinfo *Addr,string Host,
/* This implements a timeout for connect by opening the connection
nonblocking */
if (WaitFd(Fd,true,TimeOut) == false) {
- bad_addr.insert(bad_addr.begin(), string(Name));
+ bad_addr.insert(bad_addr.begin(), std::string(Name));
Owner->SetFailReason("Timeout");
return _error->Error(_("Could not connect to %s:%s (%s), "
"connection timed out"),Host.c_str(),Service,Name);
@@ -119,7 +119,7 @@ static bool DoConnect(struct addrinfo *Addr,string Host,
Owner->SetFailReason("ConnectionRefused");
else if (errno == ETIMEDOUT)
Owner->SetFailReason("ConnectionTimedOut");
- bad_addr.insert(bad_addr.begin(), string(Name));
+ bad_addr.insert(bad_addr.begin(), std::string(Name));
return _error->Errno("connect",_("Could not connect to %s:%s (%s)."),Host.c_str(),
Service,Name);
}
@@ -130,7 +130,7 @@ static bool DoConnect(struct addrinfo *Addr,string Host,
// Connect - Connect to a server /*{{{*/
// ---------------------------------------------------------------------
/* Performs a connection to the server */
-bool Connect(string Host,int Port,const char *Service,int DefPort,int &Fd,
+bool Connect(std::string Host,int Port,const char *Service,int DefPort,int &Fd,
unsigned long TimeOut,pkgAcqMethod *Owner)
{
if (_error->PendingError() == true)