Skip to content

Commit

Permalink
rgw: fetch remote obj uses high def clock for if-[un]modified-since
Browse files Browse the repository at this point in the history
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
  • Loading branch information
yehudasa committed Mar 15, 2016
1 parent 715a815 commit 2e821bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/rgw/rgw_common.cc
Expand Up @@ -471,12 +471,14 @@ int parse_key_value(string& in_str, string& key, string& val)
int parse_time(const char *time_str, real_time *time)
{
struct tm tm;
uint32_t ns = 0;

if (!parse_rfc2616(time_str, &tm))
if (!parse_rfc2616(time_str, &tm) && !parse_iso8601(time_str, &tm, &ns)) {
return -EINVAL;
}

time_t sec = timegm(&tm);
*time = utime_t(sec, 0).to_real_time();
*time = utime_t(sec, ns).to_real_time();

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/rgw_rest_conn.cc
Expand Up @@ -102,7 +102,7 @@ static void set_date_header(const real_time *t, map<string, string>& headers, co
}
stringstream s;
utime_t tm = utime_t(*t);
tm.asctime(s);
tm.gmtime(s);
headers[header_name] = s.str();
}

Expand Down

0 comments on commit 2e821bc

Please sign in to comment.