]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_op.cc: fix wrong function order
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 13 Oct 2017 17:52:33 +0000 (19:52 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 25 Oct 2017 16:14:05 +0000 (18:14 +0200)
Fix for:

[src/rgw/rgw_op.cc:3829]: (error) Uninitialized variable: calc_md5

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rgw/rgw_op.cc

index ca9a6f40f70c506878812997c889bcd8f1149790..670ff6aa86d2bcd65eae7c64c738307ec86dbecc 100644 (file)
@@ -3831,10 +3831,6 @@ void RGWPostObj::execute()
 
     s->obj_size = ofs;
 
-    if (supplied_md5_b64 && strcmp(calc_md5, supplied_md5)) {
-      op_ret = -ERR_BAD_DIGEST;
-      return;
-    }
 
     op_ret = store->check_quota(s->bucket_owner.get_id(), s->bucket,
                                 user_quota, bucket_quota, s->obj_size);
@@ -3851,6 +3847,12 @@ void RGWPostObj::execute()
     buf_to_hex(m, CEPH_CRYPTO_MD5_DIGESTSIZE, calc_md5);
 
     etag = calc_md5;
+    
+    if (supplied_md5_b64 && strcmp(calc_md5, supplied_md5)) {
+      op_ret = -ERR_BAD_DIGEST;
+      return;
+    }
+
     bl.append(etag.c_str(), etag.size() + 1);
     emplace_attr(RGW_ATTR_ETAG, std::move(bl));