From dda7233c5d3879f2580543ead0ad7cd76196a160 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 18 Aug 2009 20:15:13 +0200 Subject: 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) --- methods/http.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'methods') 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")); } -- cgit v1.2.3 From ebf2e25b204195892b6c4866b1517755efb590b4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 8 Sep 2009 23:11:11 +0200 Subject: add text at the top without failing in rred (Closes: #545694) Patch from Bernhard R. Link, thanks! --- methods/rred.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/rred.cc b/methods/rred.cc index 6fa57f3a6..27d95bdde 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -174,7 +174,7 @@ int RredMethod::ed_file(FILE *ed_cmds, FILE *in_file, FILE *out_file, hash); /* read the rest from infile */ - if (result > 0) { + if (result >= 0) { while (fgets(buffer, BUF_SIZE, in_file) != NULL) { written = fwrite(buffer, 1, strlen(buffer), out_file); hash->Add((unsigned char*)buffer, written); -- cgit v1.2.3