From aef3208d890c426d8dc97f1c39aeb1b960c755bc Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Tue, 19 Mar 2013 22:48:17 -0600 Subject: [PATCH] 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. --- src/HelperReply.cc | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.47.2