From: Yehuda Sadeh Date: Thu, 24 Mar 2016 22:06:44 +0000 (-0700) Subject: rgw: parse mtime only when header exists and not error X-Git-Tag: v10.1.1~86^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=103f4b8706b9cc852180c990525adc447e905f3e;p=ceph-ci.git rgw: parse mtime only when header exists and not error No need to try parsing mtime otherwise. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rest_client.cc b/src/rgw/rgw_rest_client.cc index 718dffb8ed2..94821e1c613 100644 --- a/src/rgw/rgw_rest_client.cc +++ b/src/rgw/rgw_rest_client.cc @@ -672,12 +672,16 @@ int RGWRESTStreamRWRequest::get_resource(RGWAccessKey& key, map& int RGWRESTStreamRWRequest::complete(string& etag, real_time *mtime, map& attrs) { set_str_from_headers(out_headers, "ETAG", etag); - if (mtime) { + if (status > 0 && mtime) { string mtime_str; set_str_from_headers(out_headers, "RGWX_MTIME", mtime_str); - int ret = parse_rgwx_mtime(cct, mtime_str, mtime); - if (ret < 0) { - return ret; + if (!mtime_str.empty()) { + int ret = parse_rgwx_mtime(cct, mtime_str, mtime); + if (ret < 0) { + return ret; + } + } else { + *mtime = real_time(); } }