From 0c0d5c29fdc044ffe3f088f982c17d316b6a25c5 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 30 Jun 2017 11:02:54 +0200 Subject: Reset failure reason when connection was successful When APT was trying multiple addresses, any later error somewhere else would be reported with ConnectionRefused or ConnectionTimedOut as the FailReason because that was set by early connect attempts. This causes APT to handle the failures differently, leading to some weirdly breaking test cases (like the changed one). Add debugging to the previously failing test case so we can find out when something goes wrong there again. (cherry picked from commit d3a70c3e5ae68a0e5a3d4667dd1d0fc0887e6263) --- methods/connect.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/connect.cc b/methods/connect.cc index 5bb34a958..dc2aee05c 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -144,7 +144,9 @@ static bool DoConnect(struct addrinfo *Addr,std::string const &Host, return _error->Errno("connect",_("Could not connect to %s:%s (%s)."),Host.c_str(), Service,Name); } - + + Owner->SetFailReason(""); + return true; } /*}}}*/ -- cgit v1.2.3