]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: cr rest splice, reorder checks
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 7 Nov 2017 00:16:34 +0000 (16:16 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 10 Apr 2018 15:05:39 +0000 (08:05 -0700)
First finish output init, then check if there's no data. Could be an empty
object.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_cr_rest.cc

index cfb1241ffebb43b2938e88489ab777c1d3ded4b7..efdab6e820d697dcd86df5f8f2802094e66c2b63 100644 (file)
@@ -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 {