summaryrefslogtreecommitdiff
path: root/methods/http.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-08-24 16:34:12 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-08-24 16:34:12 +0200
commit7c122f33c4bf8caec1cf8b250d512b65c3c574ca (patch)
tree81786b34b546c76a27027df3a671bf35ef1aa15e /methods/http.cc
parent99016ee630714bf906b1f58f6a898226bce0bb03 (diff)
parent662603c40b8b38e487f76e7aceb773c935203cea (diff)
merged from debian-experimental-ma0.8.0
Diffstat (limited to 'methods/http.cc')
-rw-r--r--methods/http.cc10
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