summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-method.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2020-08-11 12:26:51 +0000
committerJulian Andres Klode <jak@debian.org>2020-08-11 12:26:51 +0000
commit1e2d586703e8c0227ddb7b3705205c85e3b8507e (patch)
tree65dc9e4082948980820923e60565d9ff98fb488a /apt-pkg/acquire-method.cc
parent23447e9b57a00482a5b26a7cb901f7bf4f28fa73 (diff)
parent8b35e2a3dd7b863639a8909fa2361ed4fd217bc3 (diff)
Merge branch 'pu/http-debug' into 'master'
Add better acquire debugging support See merge request apt-team/apt!130
Diffstat (limited to 'apt-pkg/acquire-method.cc')
-rw-r--r--apt-pkg/acquire-method.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc
index 9656caf14..486098c77 100644
--- a/apt-pkg/acquire-method.cc
+++ b/apt-pkg/acquire-method.cc
@@ -139,27 +139,30 @@ void pkgAcqMethod::SendMessage(std::string const &header, std::unordered_map<std
/* */
void pkgAcqMethod::Fail(bool Transient)
{
- string Err = "Undetermined Error";
- if (_error->empty() == false)
+
+ Fail("", Transient);
+}
+ /*}}}*/
+// AcqMethod::Fail - A fetch has failed /*{{{*/
+void pkgAcqMethod::Fail(string Err, bool Transient)
+{
+
+ if (not _error->empty())
{
- Err.clear();
- while (_error->empty() == false)
+ while (not _error->empty())
{
std::string msg;
if (_error->PopMessage(msg))
{
- if (Err.empty() == false)
+ if (not Err.empty())
Err.append("\n");
Err.append(msg);
}
}
}
- Fail(Err, Transient);
-}
- /*}}}*/
-// AcqMethod::Fail - A fetch has failed /*{{{*/
-void pkgAcqMethod::Fail(string Err,bool Transient)
-{
+ if (Err.empty())
+ Err = "Undetermined Error";
+
// Strip out junk from the error messages
std::transform(Err.begin(), Err.end(), Err.begin(), [](char const c) {
if (c == '\r' || c == '\n')