You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2010/04/14 10:57:18 UTC

svn commit: r933886 - /httpd/httpd/trunk/modules/cache/cache_util.c

Author: rpluem
Date: Wed Apr 14 08:57:18 2010
New Revision: 933886

URL: http://svn.apache.org/viewvc?rev=933886&view=rev
Log:
* According to RFC2616 13.2.3 1. negative results of age calculations should
  be replaced by zero.

Reported by: Ryujiro Shibuya <rshibuya gmail.com>

Modified:
    httpd/httpd/trunk/modules/cache/cache_util.c

Modified: httpd/httpd/trunk/modules/cache/cache_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/cache_util.c?rev=933886&r1=933885&r2=933886&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_util.c (original)
+++ httpd/httpd/trunk/modules/cache/cache_util.c Wed Apr 14 08:57:18 2010
@@ -198,6 +198,10 @@ CACHE_DECLARE(apr_int64_t) ap_cache_curr
     resident_time = now - info->response_time;
     current_age = corrected_initial_age + resident_time;
 
+    if (current_age < 0) {
+        current_age = 0;
+    }
+
     return apr_time_sec(current_age);
 }