diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-23 18:56:03 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-23 18:56:03 +0200 |
commit | ea479d9490c9bab63b13ace7a7cca4e0a4a6611d (patch) | |
tree | 890973d4e2c0104ed58fb9d31b2e7194b76c6568 /methods | |
parent | 9349f80796a4b0be3ce2e732029ddd4a6558f80a (diff) | |
parent | f213b6ea7397f2ba5b770e1a30e57dc8438bf61e (diff) |
merged from lp:~donkult/apt/sid
Diffstat (limited to 'methods')
-rw-r--r-- | methods/bzip2.cc | 3 | ||||
-rw-r--r-- | methods/gpgv.cc | 2 | ||||
-rw-r--r-- | methods/http.cc | 10 |
3 files changed, 10 insertions, 5 deletions
diff --git a/methods/bzip2.cc b/methods/bzip2.cc index 19e49828e..241f21c66 100644 --- a/methods/bzip2.cc +++ b/methods/bzip2.cc @@ -102,9 +102,8 @@ bool Bzip2Method::Fetch(FetchItem *Itm) while (1) { unsigned char Buffer[4*1024]; - unsigned long Count; - Count = read(GzOut[0],Buffer,sizeof(Buffer)); + ssize_t Count = read(GzOut[0],Buffer,sizeof(Buffer)); if (Count < 0 && errno == EINTR) continue; diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 018e4f622..efe1f73f7 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -69,7 +69,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, { // TRANSLATOR: %s is the trusted keyring parts directory ioprintf(ret, _("No keyring installed in %s."), - _config->FindDir("Dir::Etc::TrustedParts", "/etc/apt/trusted.gpg.d").c_str()); + _config->FindDir("Dir::Etc::TrustedParts").c_str()); return ret.str(); } exit(111); diff --git a/methods/http.cc b/methods/http.cc index 9fa74bffa..25e31de9a 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -553,8 +553,14 @@ bool ServerState::HeaderLine(string Line) // Evil servers return no version if (Line[4] == '/') { - if (sscanf(Line.c_str(),"HTTP/%u.%u %u%[^\n]",&Major,&Minor, - &Result,Code) != 4) + int const elements = sscanf(Line.c_str(),"HTTP/%u.%u %u%[^\n]",&Major,&Minor,&Result,Code); + if (elements == 3) + { + Code[0] = '\0'; + if (Debug == true) + clog << "HTTP server doesn't give Reason-Phrase for " << Result << std::endl; + } + else if (elements != 4) return _error->Error(_("The HTTP server sent an invalid reply header")); } else |