From 741ae31f8692fbdbda90469cb0dbe56449b9f8c3 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 6 Nov 2017 16:16:34 -0800 Subject: [PATCH] rgw: cr rest splice, reorder checks First finish output init, then check if there's no data. Could be an empty object. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_cr_rest.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_cr_rest.cc b/src/rgw/rgw_cr_rest.cc index cfb1241ffebb4..efdab6e820d69 100644 --- a/src/rgw/rgw_cr_rest.cc +++ b/src/rgw/rgw_cr_rest.cc @@ -300,10 +300,6 @@ int RGWStreamSpliceCR::operate() { continue; } - if (bl.length() == 0 && in_crf->is_done()) { - break; - } - if (!sent_attrs) { int ret = out_crf->init(); if (ret < 0) { @@ -317,6 +313,10 @@ int RGWStreamSpliceCR::operate() { sent_attrs = true; } + if (bl.length() == 0 && in_crf->is_done()) { + break; + } + total_read += bl.length(); do { -- 2.39.5