From 3b53b722b34b5284e6b8a5571a08d4b7ec276241 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Sun, 20 Nov 2011 13:17:04 -0800 Subject: [PATCH] rgw: support alternative date formatting being used by s3cmd --- src/rgw/rgw_common.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index e024d0dc045f7..851abdc9a8df2 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) -- 2.39.5