From d4d1a8c021c712e855483ef83518f66a24c13b2c Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 9 Mar 2011 11:58:22 -0800 Subject: [PATCH] rgw: get acl explicitly return success also don't crash if op didn't explicitly set the http return code --- src/rgw/rgw_log.cc | 7 +++++-- src/rgw/rgw_rest_s3.cc | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_log.cc b/src/rgw/rgw_log.cc index bc457b32e0f9e..a016121c5c19d 100644 --- a/src/rgw/rgw_log.cc +++ b/src/rgw/rgw_log.cc @@ -18,7 +18,6 @@ int rgw_log_op(struct req_state *s) RGW_LOG(0) << "nothing to log for operation" << std::endl; return -EINVAL; } - entry.bucket = s->bucket; if (s->object) @@ -38,7 +37,11 @@ int rgw_log_op(struct req_state *s) entry.time = s->time; entry.total_time = g_clock.now() - s->time; entry.bytes_sent = s->bytes_sent; - entry.http_status = s->status; + if (s->status) + entry.http_status = s->status; + else + entry.http_status = "200"; // default + if (s->err_exist) entry.error_code = s->err.code; else diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 164d344b4ac2d..1bc116e877a32 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -204,7 +204,7 @@ void RGWCopyObj_REST_S3::send_response() void RGWGetACLs_REST_S3::send_response() { - if (ret) dump_errno(s, ret); + dump_errno(s, ret); end_header(s, "application/xml"); dump_start(s); FCGX_PutStr(acls.c_str(), acls.size(), s->fcgx->out); -- 2.39.5