summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2009-08-18 20:15:13 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2009-08-18 20:15:13 +0200
commitdda7233c5d3879f2580543ead0ad7cd76196a160 (patch)
tree1c83a18fa96f7e9dd520008d7224a2d1633d3002
parent90c2436367d7c136467296d7726e6934bd65fe66 (diff)
Allow empty Reason-Phase in the Status-Lines, which is allowed by rtf
http://www.w3.org/Protocols/rfc2616/rfc2616.html . Fixed by removing a space which will now be visibly in the errormessages, but as this errors should never happen anyway and an extra space doesn't harm we don't removed it. * methods/http.cc: - allow empty Reason-Phase in Status-Line to please squid, thanks Modestas Vainius for noticing! (Closes: #531157, LP: #411435)
-rw-r--r--debian/changelog3
-rw-r--r--methods/http.cc4
2 files changed, 5 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 597ca91ff..4923f913f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,9 @@ apt (0.7.22.3) unstable; urgency=low
* doc/apt-get.8.xml:
- update the source description to reflect what it actually does
and how it can be used. (Closes: #413021)
+ * methods/http.cc:
+ - allow empty Reason-Phase in Status-Line to please squid,
+ thanks Modestas Vainius for noticing! (Closes: #531157, LP: #411435)
[ George Danchev ]
* cmdline/apt-cache.cc:
diff --git a/methods/http.cc b/methods/http.cc
index 006e89394..df62034e3 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -547,7 +547,7 @@ 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,
+ if (sscanf(Line.c_str(),"HTTP/%u.%u %u%[^\n]",&Major,&Minor,
&Result,Code) != 4)
return _error->Error(_("The HTTP server sent an invalid reply header"));
}
@@ -555,7 +555,7 @@ bool ServerState::HeaderLine(string Line)
{
Major = 0;
Minor = 9;
- if (sscanf(Line.c_str(),"HTTP %u %[^\n]",&Result,Code) != 2)
+ if (sscanf(Line.c_str(),"HTTP %u%[^\n]",&Result,Code) != 2)
return _error->Error(_("The HTTP server sent an invalid reply header"));
}