abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r429521 - in /incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol: cache/CachedResponseBase.java client/ResponseBase.java
Date Tue, 08 Aug 2006 00:25:19 GMT
Author: rooneg
Date: Mon Aug  7 17:25:18 2006
New Revision: 429521

URL: http://svn.apache.org/viewvc?rev=429521&view=rev
Log:
Revert r429514, and fix it in a more http-spec friendly way.

Suggested by: jmsnell

[ in client/src/main/java/org/apache/abdera/protocol ]

* cache/CachedResponseBase.java
  (getCachedTime): Revert previous change.

* client/ResponseBase.java
  (now): New member, initialized to creation time for the response.
  (getServerDate): Default to creation time for the response if the
   server didn't send us a Date header.

Modified:
    incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CachedResponseBase.java
    incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/ResponseBase.java

Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CachedResponseBase.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CachedResponseBase.java?rev=429521&r1=429520&r2=429521&view=diff
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CachedResponseBase.java
(original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/cache/CachedResponseBase.java
Mon Aug  7 17:25:18 2006
@@ -68,11 +68,7 @@
   }
 
   public long getCachedTime() {
-    Date serverDate = getServerDate();
-    if (serverDate != null)
-      return serverDate.getTime();
-    else
-      return 0;
+    return getServerDate().getTime();
   }
   
   public long getResidentAge() {

Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/ResponseBase.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/ResponseBase.java?rev=429521&r1=429520&r2=429521&view=diff
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/ResponseBase.java
(original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/ResponseBase.java
Mon Aug  7 17:25:18 2006
@@ -41,6 +41,7 @@
   protected long max_age = -1;
   protected InputStream in = null;
   protected Date response_date = null;
+  protected Date now = new Date();
   
   public InputStream getInputStream() throws IOException {
     return in;
@@ -90,8 +91,7 @@
   public Date getServerDate() {
     if (response_date == null) {
       Date date = getDateHeader("Date");
-      if (date != null)
-        response_date = date;
+      response_date = (date != null) ? date : now;
     }
     return response_date;
   }



Mime
View raw message