From: Yehuda Sadeh Date: Sun, 20 Nov 2011 21:17:04 +0000 (-0800) Subject: rgw: support alternative date formatting X-Git-Tag: v0.39~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3b53b722b34b5284e6b8a5571a08d4b7ec276241;p=ceph.git rgw: support alternative date formatting being used by s3cmd --- diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index e024d0dc045..851abdc9a8d 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -157,9 +157,14 @@ static bool parse_rfc1123(const char *s, struct tm *t) return check_str_end(strptime(s, "%a, %d %b %Y %H:%M:%S GMT", t)); } +static bool parse_rfc1123_alt(const char *s, struct tm *t) +{ + return check_str_end(strptime(s, "%a, %d %b %Y %H:%M:%S %z", t)); +} + bool parse_rfc2616(const char *s, struct tm *t) { - return parse_rfc850(s, t) || parse_asctime(s, t) || parse_rfc1123(s, t); + return parse_rfc850(s, t) || parse_asctime(s, t) || parse_rfc1123(s, t) || parse_rfc1123_alt(s,t); } int parse_time(const char *time_str, time_t *time)