]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix error handling in RGWPostObj_ObjStore::read_with_boundary.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 4 Nov 2016 12:45:44 +0000 (13:45 +0100)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Mon, 24 Apr 2017 15:32:16 +0000 (17:32 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_rest.cc

index 666cac2f963fbe848f481359de0749bc617ff0e5..572b58aa9b9eca6b8be5d5a4eb650de67a3bdfb5 100644 (file)
@@ -1362,6 +1362,9 @@ int RGWPostObj_ObjStore::read_with_boundary(ceph::bufferlist& bl,
     bufferptr bp(need_to_read);
 
     const auto read_len = recv_body(s, bp.c_str(), need_to_read);
+    if (read_len < 0) {
+      return read_len;
+    }
     in_data.append(bp, 0, read_len);
   }
 
@@ -1390,7 +1393,10 @@ int RGWPostObj_ObjStore::read_with_boundary(ceph::bufferlist& bl,
     if (left < skip + 2) {
       int need = skip + 2 - left;
       bufferptr boundary_bp(need);
-      recv_body(s, boundary_bp.c_str(), need);
+      const int r = recv_body(s, boundary_bp.c_str(), need);
+      if (r < 0) {
+        return r;
+      }
       in_data.append(boundary_bp);
     }
     max += skip; // skip boundary for next time