From c18e76cb10e7d0d5c4e6351d8f141b553bb1e70c Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Wed, 6 May 2015 18:17:25 +0300 Subject: [PATCH] rpc: fix out stream flushing Flush it only once per rpc call instead of once per argument. --- rpc/rpc_impl.hh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rpc/rpc_impl.hh b/rpc/rpc_impl.hh index e373f066b5..c44781db31 100644 --- a/rpc/rpc_impl.hh +++ b/rpc/rpc_impl.hh @@ -29,8 +29,8 @@ namespace rpc { template -inline std::enable_if_t> marshall(Serializer&, output_stream&, std::tuple&&) { - return make_ready_future<>(); +inline std::enable_if_t> marshall(Serializer&, output_stream& out, std::tuple&&) { + return out.flush(); } template @@ -38,8 +38,6 @@ inline std::enable_if_t> marshall(Serializer& serial using tuple_type = std::tuple; return serialize(out, std::forward::type>(std::get(args))).then([&serialize, &out, args = std::move(args)] () mutable { return marshall(serialize, out, std::move(args)); - }).then([&out] { - return out.flush(); }); }