Browse Source

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.
tags/debian/1.5_alpha4
Julian Andres Klode 4 years ago
parent
commit
d3a70c3e5a
2 changed files with 4 additions and 2 deletions
  1. +3
    -1
      methods/connect.cc
  2. +1
    -1
      test/integration/test-bug-738785-switch-protocol

+ 3
- 1
methods/connect.cc View File

@@ -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;
}
/*}}}*/


+ 1
- 1
test/integration/test-bug-738785-switch-protocol View File

@@ -47,4 +47,4 @@ cd - >/dev/null
# check that downgrades from https to http are not allowed
webserverconfig 'aptwebserver::support::http' 'true'
sed -i -e "s#:${APTHTTPPORT}/redirectme#:${APTHTTPSPORT}/downgrademe#" -e 's# http:# https:#' rootdir/etc/apt/sources.list.d/*
testfailure aptget update --allow-insecure-repositories -o Acquire::https::Timeout=1
testfailure aptget update --allow-insecure-repositories -o Acquire::https::Timeout=1 -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::https=1

Loading…
Cancel
Save