]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: ignore fields placed after "file" in S3's browser uploads.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Tue, 13 Sep 2016 15:28:12 +0000 (17:28 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Mon, 24 Apr 2017 10:49:51 +0000 (12:49 +0200)
Fixes: http://tracker.ceph.com/issues/17273
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_rest_s3.cc

index 1c9e4d751b00e4e8f7990d762be1b1ae8f1b92db..1f504b7b0ef4c60067751dad6cd34172ff1135f9 100644 (file)
@@ -2040,10 +2040,11 @@ int RGWPostObj_ObjStore_S3::complete_get_params()
   do {
     struct post_form_part part;
     int r = read_form_part_header(&part, &done);
-    if (r < 0)
+    if (r < 0) {
       return r;
+    }
 
-    bufferlist part_data;
+    ceph::bufferlist part_data;
     bool boundary;
     uint64_t chunk_size = s->cct->_conf->rgw_max_chunk_size;
     r = read_data(part.data, chunk_size, &boundary, &done);
@@ -2051,7 +2052,7 @@ int RGWPostObj_ObjStore_S3::complete_get_params()
       return -EINVAL;
     }
 
-    parts[part.name] = part;
+    /* Just reading the data but not storing any results of that. */
   } while (!done);
 
   return 0;
@@ -2062,18 +2063,21 @@ int RGWPostObj_ObjStore_S3::get_data(bufferlist& bl)
   bool boundary;
   bool done;
 
-  uint64_t chunk_size = s->cct->_conf->rgw_max_chunk_size;
+  const uint64_t chunk_size = s->cct->_conf->rgw_max_chunk_size;
   int r = read_data(bl, chunk_size, &boundary, &done);
-  if (r < 0)
+  if (r < 0) {
     return r;
+  }
 
   if (boundary) {
     data_pending = false;
 
-    if (!done) {  /* reached end of data, let's drain the rest of the params */
+    if (!done) {
+      /* Reached end of data, let's drain the rest of the params */
       r = complete_get_params();
-      if (r < 0)
-       return r;
+      if (r < 0) {
+       return r;
+      }
     }
   }