From: imtzw Date: Tue, 27 Jun 2023 01:18:09 +0000 (+0800) Subject: rgw: remove useless op ret assign X-Git-Tag: v19.0.0~536^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ec9da5b9fa2f2d873f29242b1a4da390a748758a;p=ceph.git rgw: remove useless op ret assign in op rgwsetbucketwebsite_objstore_s3 and rgwputcors_objstore_s3 get_param trys to assign op_ret which will be overwritten by return value. use this to be assigned value as the return value will result in a same http response because in rgw_common rgw_http_s3_errors will translate them into the same. Signed-off-by: imtzw --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index d777b52d7f2d..468d5ce51b8c 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -2270,11 +2270,10 @@ int RGWSetBucketWebsite_ObjStore_S3::get_params(optional_yield y) << max_num << " rules, request website routing rules num: " << routing_rules_num << dendl; - op_ret = -ERR_INVALID_WEBSITE_ROUTING_RULES_ERROR; s->err.message = std::to_string(routing_rules_num) +" routing rules provided, the number of routing rules in a website configuration is limited to " + std::to_string(max_num) + "."; - return -ERR_INVALID_REQUEST; + return -ERR_INVALID_WEBSITE_ROUTING_RULES_ERROR; } return 0; @@ -3716,10 +3715,9 @@ int RGWPutCORS_ObjStore_S3::get_params(optional_yield y) << max_num << " rules, request cors rules num: " << cors_rules_num << dendl; - op_ret = -ERR_INVALID_CORS_RULES_ERROR; s->err.message = "The number of CORS rules should not exceed allowed limit of " + std::to_string(max_num) + " rules."; - return -ERR_INVALID_REQUEST; + return -ERR_INVALID_CORS_RULES_ERROR; } // forward bucket cors requests to meta master zone