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/http.cc | |
parent | 9349f80796a4b0be3ce2e732029ddd4a6558f80a (diff) | |
parent | f213b6ea7397f2ba5b770e1a30e57dc8438bf61e (diff) |
merged from lp:~donkult/apt/sid
Diffstat (limited to 'methods/http.cc')
-rw-r--r-- | methods/http.cc | 10 |
1 files changed, 8 insertions, 2 deletions
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 |