summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-06-27 20:47:47 +0200
committerJulian Andres Klode <jak@debian.org>2017-06-28 15:52:38 +0200
commitb4afd84a59578965120f175b410ea325d60bcb58 (patch)
treefad26361de88d15f46509bf1a7f903c50fd8a73e
parent3cb78eef6fd8dcfa964c4ebb83db71efc8cabd64 (diff)
methods: connect: Change PkgAcqMethod to aptMethod
This will allow us to access ConfigFind() and stuff which makes it possible for us to implement TLS support. Gbp-Dch: ignore
-rw-r--r--methods/connect.cc15
-rw-r--r--methods/connect.h7
-rw-r--r--methods/ftp.cc2
-rw-r--r--methods/ftp.h2
4 files changed, 14 insertions, 12 deletions
diff --git a/methods/connect.cc b/methods/connect.cc
index f6fb14769..d5e40fbab 100644
--- a/methods/connect.cc
+++ b/methods/connect.cc
@@ -34,6 +34,7 @@
#include <arpa/inet.h>
#include <netdb.h>
+#include "aptmethod.h"
#include "connect.h"
#include "rfc2553emu.h"
#include <apti18n.h>
@@ -79,8 +80,8 @@ static bool ConnectionAllowed(char const * const Service, std::string const &Hos
// DoConnect - Attempt a connect operation /*{{{*/
// ---------------------------------------------------------------------
/* This helper function attempts a connection to a single address. */
-static bool DoConnect(struct addrinfo *Addr,std::string const &Host,
- unsigned long TimeOut,int &Fd,pkgAcqMethod *Owner)
+static bool DoConnect(struct addrinfo *Addr, std::string const &Host,
+ unsigned long TimeOut, int &Fd, aptMethod *Owner)
{
// Show a status indicator
char Name[NI_MAXHOST];
@@ -150,8 +151,8 @@ static bool DoConnect(struct addrinfo *Addr,std::string const &Host,
/*}}}*/
// Connect to a given Hostname /*{{{*/
static bool ConnectToHostname(std::string const &Host, int const Port,
- const char * const Service, int DefPort, int &Fd,
- unsigned long const TimeOut, pkgAcqMethod * const Owner)
+ const char *const Service, int DefPort, int &Fd,
+ unsigned long const TimeOut, aptMethod *const Owner)
{
if (ConnectionAllowed(Service, Host) == false)
return false;
@@ -286,9 +287,9 @@ static bool ConnectToHostname(std::string const &Host, int const Port,
// Connect - Connect to a server /*{{{*/
// ---------------------------------------------------------------------
/* Performs a connection to the server (including SRV record lookup) */
-bool Connect(std::string Host,int Port,const char *Service,
- int DefPort,int &Fd,
- unsigned long TimeOut,pkgAcqMethod *Owner)
+bool Connect(std::string Host, int Port, const char *Service,
+ int DefPort, int &Fd,
+ unsigned long TimeOut, aptMethod *Owner)
{
if (_error->PendingError() == true)
return false;
diff --git a/methods/connect.h b/methods/connect.h
index bbe1bb35d..44473a07c 100644
--- a/methods/connect.h
+++ b/methods/connect.h
@@ -12,10 +12,11 @@
#include <string>
-class pkgAcqMethod;
+class aptMethod;
+
+bool Connect(std::string To, int Port, const char *Service, int DefPort,
+ int &Fd, unsigned long TimeOut, aptMethod *Owner);
-bool Connect(std::string To,int Port,const char *Service,int DefPort,
- int &Fd,unsigned long TimeOut,pkgAcqMethod *Owner);
void RotateDNS();
#endif
diff --git a/methods/ftp.cc b/methods/ftp.cc
index d789637a8..5b30b5486 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -112,7 +112,7 @@ void FTPConn::Close()
// ---------------------------------------------------------------------
/* Connect to the server using a non-blocking connection and perform a
login. */
-bool FTPConn::Open(pkgAcqMethod *Owner)
+bool FTPConn::Open(aptMethod *Owner)
{
// Use the already open connection if possible.
if (ServerFd != -1)
diff --git a/methods/ftp.h b/methods/ftp.h
index 6a12475a0..3a482fa42 100644
--- a/methods/ftp.h
+++ b/methods/ftp.h
@@ -55,7 +55,7 @@ class FTPConn
bool WriteMsg(unsigned int &Ret,std::string &Text,const char *Fmt,...);
// Connection control
- bool Open(pkgAcqMethod *Owner);
+ bool Open(aptMethod *Owner);
void Close();
bool GoPasv();
bool ExtGoPasv();