]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix bogus 'invalid response' message on URL rewriter interface
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 20 Mar 2013 04:48:17 +0000 (22:48 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 20 Mar 2013 04:48:17 +0000 (22:48 -0600)
The empty-line response from rewriter and redirector should be converted
to ERR reply code in the new API. It was being left as Unknown.

While this reply used to only be valid on URL helper interface, and it
woudl be more appropriate to map other helpers to BH the ERR response
seems to be safe for use on any of the helper interfaces for an empty
line response. At worst it will prevent the lookup being re-tried on
other possibly better working helper instance.

src/HelperReply.cc

index 379cf2b8c03038b0ef2dd95a5ef1bb6102a8bbc6..7f2aaa9df21e61af25eaeada9076e224f97e71cc 100644 (file)
@@ -23,6 +23,8 @@ HelperReply::parse(char *buf, size_t len)
     debugs(84, 3, "Parsing helper buffer");
     // check we have something to parse
     if (!buf || len < 1) {
+        // empty line response was the old URL-rewriter interface ERR response.
+        result = HelperReply::Error;
         // for now ensure that legacy handlers are not presented with NULL strings.
         debugs(84, 3, "Reply length is smaller than 1 or none at all ");
         other_.init(1,1);