summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-06-30 11:02:54 +0200
committerJulian Andres Klode <jak@debian.org>2017-06-30 11:05:48 +0200
commitd3a70c3e5ae68a0e5a3d4667dd1d0fc0887e6263 (patch)
treeef16f279979c5835bfd3650f421061778b924c07 /methods
parentaf56ad0bc2e28854b682f66b72793a84abe6f6d9 (diff)
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.
Diffstat (limited to 'methods')
-rw-r--r--methods/connect.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/methods/connect.cc b/methods/connect.cc
index 47e9e15d4..fd37d19f7 100644
--- a/methods/connect.cc
+++ b/methods/connect.cc
@@ -179,7 +179,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;
}
/*}}}*/