]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: correct "If-Modified-Since" handle. 2725/head
authorVRan Liu <gliuwr@gmail.com>
Wed, 15 Oct 2014 08:29:50 +0000 (16:29 +0800)
committerVRan Liu <gliuwr@gmail.com>
Wed, 15 Oct 2014 08:35:38 +0000 (16:35 +0800)
Normally client will use `Last-Modified` of server returned, as the
value of `If-Modified-Since`. So the `ctime` is exactly equal to
`*mod_ptr`, and rgw should return `Not Modified`, otherwise the cache
will never worked.

Signed-off-by: VRan Liu <gliuwr@gmail.com>
src/rgw/rgw_rados.cc

index 1d05509d6c8bfe8565acd20d7111cec8ceb4c13a..ee774f69f7b60918d75e68ab939b73c3edfbb100 100644 (file)
@@ -4295,7 +4295,7 @@ int RGWRados::prepare_get_obj(void *ctx, rgw_obj& obj,
 
     if (mod_ptr) {
       ldout(cct, 10) << "If-Modified-Since: " << *mod_ptr << " Last-Modified: " << ctime << dendl;
-      if (ctime < *mod_ptr) {
+      if (ctime <= *mod_ptr) {
         r = -ERR_NOT_MODIFIED;
         goto done_err;
       }