From 408f04ff4aa99079558284fabaabe93bc4892786 Mon Sep 17 00:00:00 2001 From: Zhang Shaowen Date: Wed, 25 Jul 2018 12:36:40 +0800 Subject: [PATCH] rgw: move check_date place Signed-off-by: Zhang Shaowen --- src/rgw/rgw_lc_s3.cc | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/rgw/rgw_lc_s3.cc b/src/rgw/rgw_lc_s3.cc index 0b9ed0da95b..c78851a359f 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; -} + -- 2.47.3