perfcounter->inc(l_rgw_put_b, s->obj_size);
- if (s->aws4_auth_needs_complete) {
-
- /* complete aws4 auth */
-
- op_ret = RGW_Auth_S3::authorize_aws4_auth_complete(store, s);
- if (op_ret) {
- goto done;
- }
-
- s->aws4_auth_needs_complete = false;
-
- /* verify signature */
-
- if (s->aws4_auth->signature != s->aws4_auth->new_signature) {
- op_ret = -ERR_SIGNATURE_NO_MATCH;
- ldout(s->cct, 20) << "delayed aws4 auth failed" << dendl;
- goto done;
- }
-
- /* authorization ok */
-
- dout(10) << "v4 auth ok" << dendl;
-
+ op_ret = do_aws4_auth_completion();
+ if (op_ret < 0) {
+ goto done;
}
+
op_ret = store->check_quota(s->bucket_owner.get_id(), s->bucket,
user_quota, bucket_quota, s->obj_size);
if (op_ret < 0) {
auto data_deleter = std::unique_ptr<char, decltype(free)*>{data, free};
- if (s->aws4_auth_needs_complete) {
- int ret_auth = do_aws4_auth_completion();
- if (ret_auth < 0) {
- return ret_auth;
- }
+ r = do_aws4_auth_completion();
+ if (r < 0) {
+ return r;
}
RGWSetBucketVersioningParser parser;
auto data_deleter = std::unique_ptr<char, decltype(free)*>{data, free};
- if (s->aws4_auth_needs_complete) {
- int ret_auth = do_aws4_auth_completion();
- if (ret_auth < 0) {
- return ret_auth;
- }
+ r = do_aws4_auth_completion();
+ if (r < 0) {
+ return r;
}
RGWXMLDecoder::XMLParser parser;
auto data_deleter = std::unique_ptr<char, decltype(free)*>{data, free};
- if (s->aws4_auth_needs_complete) {
- int ret_auth = do_aws4_auth_completion();
- if (ret_auth < 0) {
- return ret_auth;
- }
+ const int auth_ret = do_aws4_auth_completion();
+ if (auth_ret < 0) {
+ return auth_ret;
}
bufferptr in_ptr(data, len);
int RGWPutObj_ObjStore_S3::get_data(bufferlist& bl)
{
int ret = RGWPutObj_ObjStore::get_data(bl);
- if (ret < 0)
- s->aws4_auth_needs_complete = false;
-
- int ret_auth;
-
- if (s->aws4_auth_streaming_mode && ret > 0) {
- ret_auth = validate_and_unwrap_available_aws4_chunked_data(bl, s->aws4_auth->bl);
+ if (ret > 0 && s->aws4_auth_streaming_mode) {
+ int ret_auth = validate_and_unwrap_available_aws4_chunked_data(bl, s->aws4_auth->bl);
if (ret_auth < 0) {
return ret_auth;
}
- }
-
- if ((ret == 0) && s->aws4_auth_needs_complete) {
- ret_auth = do_aws4_auth_completion();
+ } else if (ret == 0) {
+ int ret_auth = do_aws4_auth_completion();
if (ret_auth < 0) {
return ret_auth;
}
int RGWPutACLs_ObjStore_S3::get_params()
{
int ret = RGWPutACLs_ObjStore::get_params();
- if (ret < 0)
- s->aws4_auth_needs_complete = false;
- if (s->aws4_auth_needs_complete) {
- int ret_auth = do_aws4_auth_completion();
+ if (ret >= 0) {
+ const int ret_auth = do_aws4_auth_completion();
if (ret_auth < 0) {
return ret_auth;
}
auto data_deleter = std::unique_ptr<char, decltype(free)*>{data, free};
- if (s->aws4_auth_needs_complete) {
- r = do_aws4_auth_completion();
- if (r < 0) {
- return r;
- }
+ r = do_aws4_auth_completion();
+ if (r < 0) {
+ return r;
}
if (!parser.init()) {
return ret;
}
- if (s->aws4_auth_needs_complete) {
- int ret_auth = do_aws4_auth_completion();
- if (ret_auth < 0) {
- return ret_auth;
- }
- }
- return 0;
+ return do_aws4_auth_completion();
}
void RGWCompleteMultipart_ObjStore_S3::send_response()
return ret;
}
- if (s->aws4_auth_needs_complete) {
- int ret_auth = do_aws4_auth_completion();
- if (ret_auth < 0) {
- return ret_auth;
- }
- }
- return 0;
+ return do_aws4_auth_completion();
}
void RGWDeleteMultiObj_ObjStore_S3::send_status()