]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: get current utc epoch differently
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 29 Jul 2011 21:37:07 +0000 (14:37 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 29 Jul 2011 21:37:07 +0000 (14:37 -0700)
beforehand tm.tm_isdst was returning random results which happened
to work correctly most of the time since we're currently in dst

src/rgw/rgw_rest_s3.cc

index 27a29eea9217303b096f2cdcaddac541e0323990..4621e281353d758be1cdda9289fcfd8eddfb9269 100644 (file)
@@ -613,7 +613,7 @@ static bool get_auth_header(struct req_state *s, string& dest, bool qsr)
       RGW_LOG(0) << "bad date (predates epoch): " << req_date << dendl;
       return false;
     }
-    s->header_time = utime_t(mktime(&t) + t.tm_gmtoff, 0);
+    s->header_time = utime_t(timegm(&t), 0);
   }
 
   if (date.size())