lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r634072 - in /lucene/solr/trunk: CHANGES.txt src/java/org/apache/solr/core/SolrConfig.java src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
Date Wed, 05 Mar 2008 22:48:56 GMT
Author: hossman
Date: Wed Mar  5 14:48:54 2008
New Revision: 634072

URL: http://svn.apache.org/viewvc?rev=634072&view=rev
Log:
SOLR-496 - use Long for Cache-Control max-age

Modified:
    lucene/solr/trunk/CHANGES.txt
    lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java
    lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java

Modified: lucene/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=634072&r1=634071&r2=634072&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Wed Mar  5 14:48:54 2008
@@ -289,6 +289,9 @@
 
 18. SOLR-324: Add proper support for Long and Doubles in sorting, etc. (gsingers) 
 
+19. SOLR-496: Cache-Control max-age changed to Long so Expires
+    calculation won't cause overflow.  (Thomas Peuss via hossman)
+
 Other Changes
  1. SOLR-135: Moved common classes to org.apache.solr.common and altered the
     build scripts to make two jars: apache-solr-1.3.jar and 

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java?rev=634072&r1=634071&r2=634072&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/SolrConfig.java Wed Mar  5 14:48:54 2008
@@ -226,7 +226,7 @@
     private final boolean never304;
     private final String etagSeed;
     private final String cacheControlHeader;
-    private final Integer maxAge;
+    private final Long maxAge;
     private final LastModFrom lastModFrom;
     
     private HttpCachingConfig(SolrConfig conf) {
@@ -241,13 +241,13 @@
       
       cacheControlHeader = conf.get(CACHE_PRE+"cacheControl",null);
 
-      Integer tmp = null; // maxAge
+      Long tmp = null; // maxAge
       if (null != cacheControlHeader) {
         try { 
           final Matcher ttlMatcher = MAX_AGE.matcher(cacheControlHeader);
           final String ttlStr = ttlMatcher.find() ? ttlMatcher.group(1) : null;
           tmp = (null != ttlStr && !"".equals(ttlStr))
-            ? Integer.valueOf(ttlStr)
+            ? Long.valueOf(ttlStr)
             : null;
         } catch (Exception e) {
           log.log(Level.WARNING,
@@ -265,7 +265,7 @@
     /** null if no Cache-Control header */
     public String getCacheControlHeader() { return cacheControlHeader; }
     /** null if no max age limitation */
-    public Integer getMaxAge() { return maxAge; }
+    public Long getMaxAge() { return maxAge; }
     public LastModFrom getLastModFrom() { return lastModFrom; }
   }
 }

Modified: lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java?rev=634072&r1=634071&r2=634072&view=diff
==============================================================================
--- lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
(original)
+++ lucene/solr/trunk/src/webapp/src/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
Wed Mar  5 14:48:54 2008
@@ -175,10 +175,10 @@
     if (null != cc) {
       resp.setHeader("Cache-Control", cc);
     }
-    Integer maxAge = conf.getHttpCachingConfig().getMaxAge();
+    Long maxAge = conf.getHttpCachingConfig().getMaxAge();
     if (null != maxAge) {
       resp.setDateHeader("Expires", System.currentTimeMillis()
-                         + (maxAge * 1000));
+                         + (maxAge * 1000L));
     }
 
     return;



Mime
View raw message