From 8b03f8773bfbf9f31fac58fcc3b6beab08445b4d Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Fri, 7 Oct 2016 10:10:11 +0200 Subject: [PATCH] rgw: fix perfect forwarding of template arguments in IO filters. Signed-off-by: Radoslaw Zarzynski --- src/rgw/rgw_client_io.h | 2 +- src/rgw/rgw_client_io_decoimpl.h | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/rgw/rgw_client_io.h b/src/rgw/rgw_client_io.h index de1b09cb5cd8..5db0a9f45bfb 100644 --- a/src/rgw/rgw_client_io.h +++ b/src/rgw/rgw_client_io.h @@ -124,7 +124,7 @@ protected: public: DecoratedRestfulClient(DecorateeT&& decoratee) - : decoratee(std::move(decoratee)) { + : decoratee(std::forward(decoratee)) { } size_t send_status(const int status, diff --git a/src/rgw/rgw_client_io_decoimpl.h b/src/rgw/rgw_client_io_decoimpl.h index 3ffab616b07b..f573af8eccaf 100644 --- a/src/rgw/rgw_client_io_decoimpl.h +++ b/src/rgw/rgw_client_io_decoimpl.h @@ -24,7 +24,7 @@ class AccountingFilter : public DecoratedRestfulClient, public: template AccountingFilter(U&& decoratee) - : DecoratedRestfulClient(std::move(decoratee)), + : DecoratedRestfulClient(std::forward(decoratee)), enabled(false), total_sent(0), total_received(0) { @@ -126,7 +126,7 @@ protected: public: template BufferingFilter(U&& decoratee) - : DecoratedRestfulClient(std::move(decoratee)), + : DecoratedRestfulClient(std::forward(decoratee)), has_content_length(false), buffer_data(false) { } @@ -202,7 +202,7 @@ size_t BufferingFilter::complete_request() template static inline BufferingFilter add_buffering(T&& t) { - return BufferingFilter(std::move(t)); + return BufferingFilter(std::forward(t)); } @@ -216,7 +216,7 @@ protected: public: template ChunkingFilter(U&& decoratee) - : DecoratedRestfulClient(std::move(decoratee)), + : DecoratedRestfulClient(std::forward(decoratee)), has_content_length(false), chunking_enabled(false) { } @@ -266,7 +266,7 @@ public: template static inline ChunkingFilter add_chunking(T&& t) { - return ChunkingFilter(std::move(t)); + return ChunkingFilter(std::forward(t)); } @@ -285,7 +285,7 @@ protected: public: template ConLenControllingFilter(U&& decoratee) - : DecoratedRestfulClient(std::move(decoratee)), + : DecoratedRestfulClient(std::forward(decoratee)), action(ContentLengthAction::UNKNOWN) { } @@ -315,7 +315,7 @@ public: template static inline ConLenControllingFilter add_conlen_controlling(T&& t) { - return ConLenControllingFilter(std::move(t)); + return ConLenControllingFilter(std::forward(t)); } @@ -352,7 +352,7 @@ protected: public: template ReorderingFilter(U&& decoratee) - : DecoratedRestfulClient(std::move(decoratee)), + : DecoratedRestfulClient(std::forward(decoratee)), phase(ReorderState::RGW_EARLY_HEADERS) { } @@ -396,7 +396,7 @@ public: template static inline ReorderingFilter add_reordering(T&& t) { - return ReorderingFilter(std::move(t)); + return ReorderingFilter(std::forward(t)); } } /* namespace io */ -- 2.47.3