From 95c0dbfc9042a76ba64157be4741fe9cc54e57f4 Mon Sep 17 00:00:00 2001 From: Christos Tsantilas Date: Thu, 20 Jun 2013 22:21:02 +0300 Subject: [PATCH] Redirector helpers related changes - 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 | 5 +++++ src/redirect.cc | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Notes.h b/src/Notes.h index 2f67cbd93c..ce9b47fbce 100644 --- a/src/Notes.h +++ b/src/Notes.h @@ -122,6 +122,7 @@ public: MEMPROXY_CLASS(Entry); }; + NotePairs(){} ~NotePairs(); /** @@ -171,6 +172,10 @@ public: bool empty() const {return entries.empty();} Vector entries; ///< The key/value pair entries + +private: + NotePairs &operator = (NotePairs const &); // Not implemented + NotePairs(NotePairs const &); // Not implemented }; MEMPROXY_CLASS_INLINE(NotePairs::Entry); diff --git a/src/redirect.cc b/src/redirect.cc index cc86dcbf59..ec7cd58f60 100644 --- a/src/redirect.cc +++ b/src/redirect.cc @@ -116,8 +116,12 @@ redirectHandleReply(void *data, const HelperReply &reply) const Http::StatusCode status = static_cast(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 -- 2.47.3