]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Redirector helpers related changes
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 20 Jun 2013 19:21:02 +0000 (22:21 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 20 Jun 2013 19:21:02 +0000 (22:21 +0300)
- The redirectStateData handlers requires the HelperReply::Okay helper reply
  result code else will drop the helper reply, but we are always pass to them
  the HelperReply::Unknown reply result code

- The NotePairs are not support "=" operator. This patch replaces a such command
  using the NotePairs::append member, and also adds unimplemented private
  = operator and copy constructor to prevent developers from using it.

src/Notes.h
src/redirect.cc

index 2f67cbd93c90be2209860f2db4f4295dbe7675af..ce9b47fbce26cf6a465ca9df1922be1cbc1c2c12 100644 (file)
@@ -122,6 +122,7 @@ public:
         MEMPROXY_CLASS(Entry);
     };
 
+    NotePairs(){}
     ~NotePairs();
 
     /**
@@ -171,6 +172,10 @@ public:
     bool empty() const {return entries.empty();}
 
     Vector<NotePairs::Entry *> entries;          ///< The key/value pair entries
+
+private:
+    NotePairs &operator = (NotePairs const &); // Not implemented
+    NotePairs(NotePairs const &); // Not implemented
 };
 
 MEMPROXY_CLASS_INLINE(NotePairs::Entry);
index cc86dcbf5957f0c0dcc4643be1c5fbdb58756713..ec7cd58f6084bd7081025254af16432bdfc8d6bd 100644 (file)
@@ -116,8 +116,12 @@ redirectHandleReply(void *data, const HelperReply &reply)
                 const Http::StatusCode status = static_cast<Http::StatusCode>(atoi(result));
 
                 HelperReply newReply;
-                newReply.result = reply.result;
-                newReply.notes = reply.notes;
+                // BACKWARD COMPATIBILITY 2012-06-15:
+                // We got HelperReply::Unknown reply result but new
+                // redirectStateData handlers require HelperReply::Okay,
+                // else will drop the helper reply 
+                newReply.result = HelperReply::Okay;
+                newReply.notes.append(&reply.notes);
 
                 if (status == Http::scMovedPermanently
                         || status == Http::scMovedTemporarily