From: Radoslaw Zarzynski Date: Tue, 13 Sep 2016 15:28:12 +0000 (+0200) Subject: rgw: ignore fields placed after "file" in S3's browser uploads. X-Git-Tag: v12.0.3~99^2~25 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=de587932349dc057afc76a2d9dd1b1ab73b1fab0;p=ceph.git rgw: ignore fields placed after "file" in S3's browser uploads. Fixes: http://tracker.ceph.com/issues/17273 Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 1c9e4d751b00..1f504b7b0ef4 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -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; + } } }