summaryrefslogtreecommitdiff
path: root/methods/connect.h
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2017-10-26 00:57:26 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2017-12-13 23:56:29 +0100
commit47c0bdc310c8cd62374ca6e6bb456dd183bdfc07 (patch)
treeb951a0221dd6015ffef42ebea9dfc709f6053404 /methods/connect.h
parent2f6aed72f656494d668918aa8ce4052d7c81e993 (diff)
report transient errors as transient errors
The Fail method for acquire methods has a boolean parameter indicating the transient-nature of a reported error. The problem with this is that Fail is called very late at a point where it is no longer easily identifiable if an error is indeed transient or not, so some calls were and some weren't and the acquire system would later mostly ignore the transient flag and guess by using the FailReason instead. Introducing a tri-state enum we can pass the information about fatal or transient errors through the callstack to generate the correct fails.
Diffstat (limited to 'methods/connect.h')
-rw-r--r--methods/connect.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/methods/connect.h b/methods/connect.h
index 817ebf765..63a94400e 100644
--- a/methods/connect.h
+++ b/methods/connect.h
@@ -14,7 +14,7 @@
#include <string>
#include <stddef.h>
-class aptMethod;
+#include "aptmethod.h"
/**
* \brief Small representation of a file descriptor for network traffic.
@@ -39,11 +39,11 @@ struct MethodFd
virtual bool HasPending();
};
-bool Connect(std::string To, int Port, const char *Service, int DefPort,
- std::unique_ptr<MethodFd> &Fd, unsigned long TimeOut, aptMethod *Owner);
+ResultState Connect(std::string To, int Port, const char *Service, int DefPort,
+ std::unique_ptr<MethodFd> &Fd, unsigned long TimeOut, aptMethod *Owner);
-bool UnwrapSocks(std::string To, int Port, URI Proxy, std::unique_ptr<MethodFd> &Fd, unsigned long Timeout, aptMethod *Owner);
-bool UnwrapTLS(std::string To, std::unique_ptr<MethodFd> &Fd, unsigned long Timeout, aptMethod *Owner);
+ResultState UnwrapSocks(std::string To, int Port, URI Proxy, std::unique_ptr<MethodFd> &Fd, unsigned long Timeout, aptMethod *Owner);
+ResultState UnwrapTLS(std::string To, std::unique_ptr<MethodFd> &Fd, unsigned long Timeout, aptMethod *Owner);
void RotateDNS();