From: Amos Jeffries Date: Wed, 20 Mar 2013 04:48:17 +0000 (-0600) Subject: Fix bogus 'invalid response' message on URL rewriter interface X-Git-Tag: SQUID_3_4_0_1~229 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aef3208d890c426d8dc97f1c39aeb1b960c755bc;p=thirdparty%2Fsquid.git Fix bogus 'invalid response' message on URL rewriter interface 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. --- diff --git a/src/HelperReply.cc b/src/HelperReply.cc index 379cf2b8c0..7f2aaa9df2 100644 --- a/src/HelperReply.cc +++ b/src/HelperReply.cc @@ -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);