]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_rest.cc
update source to 12.2.11
[ceph.git] / ceph / src / rgw / rgw_rest.cc
index 80a886ec5d118ba6cf2271a80a632d14f3000828..67de9bb9b068cb7ecb3cced61e43615bb99ead25 100644 (file)
@@ -1659,8 +1659,9 @@ int RGWListMultipart_ObjStore::get_params()
   }
   
   string str = s->info.args.get("max-parts");
-  if (!str.empty())
-    max_parts = atoi(str.c_str());
+  op_ret = parse_value_and_bound(str, max_parts, 0,
+                                 g_conf->get_val<uint64_t>("rgw_max_listing_results"),
+                                 max_parts);
 
   return op_ret;
 }
@@ -1670,10 +1671,12 @@ int RGWListBucketMultiparts_ObjStore::get_params()
   delimiter = s->info.args.get("delimiter");
   prefix = s->info.args.get("prefix");
   string str = s->info.args.get("max-uploads");
-  if (!str.empty())
-    max_uploads = atoi(str.c_str());
-  else
-    max_uploads = default_max;
+  op_ret = parse_value_and_bound(str, max_uploads, 0,
+                       g_conf->get_val<uint64_t>("rgw_max_listing_results"),
+                       default_max);
+  if (op_ret < 0) {
+    return op_ret;
+  }
 
   string key_marker = s->info.args.get("key-marker");
   string upload_id_marker = s->info.args.get("upload-id-marker");