{
struct tm tm;
memset(&tm, 0, sizeof(struct tm));
- if (!strptime(time_str, "%a, %d %b %Y %H:%M:%S GMT", &tm))
+ if (!strptime(time_str, "%a, %d %b %Y %H:%M:%S %Z", &tm))
return -EINVAL;
*time = mktime(&tm);
uint64_t size;
bufferlist etag;
time_t mtime;
+ time_t ctime;
map<string, bufferlist>::iterator iter;
goto done_err;
}
+ /* Convert all times go GMT to make them compatible */
+ ctime = mktime(gmtime(&mtime));
r = -ECANCELED;
if (mod_ptr) {
- if (mtime < *mod_ptr) {
+ cout << "mod_ptr: " << *mod_ptr << " ctime: " << ctime << endl;
+ if (ctime < *mod_ptr) {
err->num = "304";
err->code = "NotModified";
goto done_err;
}
if (unmod_ptr) {
- if (mtime >= *mod_ptr) {
+ if (ctime > *mod_ptr) {
err->num = "412";
err->code = "PreconditionFailed";
goto done_err;