From: Zhang Shaowen Date: Wed, 25 Jul 2018 04:36:40 +0000 (+0800) Subject: rgw: move check_date place X-Git-Tag: v14.1.0~314^2~35 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=408f04ff4aa99079558284fabaabe93bc4892786;p=ceph.git rgw: move check_date place Signed-off-by: Zhang Shaowen --- diff --git a/src/rgw/rgw_lc_s3.cc b/src/rgw/rgw_lc_s3.cc index 0b9ed0da95b5..c78851a359f5 100644 --- a/src/rgw/rgw_lc_s3.cc +++ b/src/rgw/rgw_lc_s3.cc @@ -14,6 +14,18 @@ #define dout_subsys ceph_subsys_rgw +static bool check_date(const string& _date) +{ + boost::optional date = ceph::from_iso_8601(_date); + if (boost::none == date) { + return false; + } + struct timespec time = ceph::real_clock::to_timespec(*date); + if (time.tv_sec % (24*60*60) || time.tv_nsec) { + return false; + } + return true; +} bool LCExpiration_S3::xml_end(const char * el) { LCDays_S3 *lc_days = static_cast(find_first("Days")); @@ -358,15 +370,4 @@ XMLObj *RGWLCXMLParser_S3::alloc_obj(const char *el) return obj; } -static bool check_date(const string& _date) -{ - boost::optional date = ceph::from_iso_8601(_date); - if (boost::none == date) { - return false; - } - struct timespec time = ceph::real_clock::to_timespec(*date); - if (time.tv_sec % (24*60*60) || time.tv_nsec) { - return false; - } - return true; -} +