jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r507105 - in /jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav: client/methods/PollMethod.java header/TimeoutHeader.java
Date Tue, 13 Feb 2007 17:11:38 GMT
Author: mreutegg
Date: Tue Feb 13 09:11:36 2007
New Revision: 507105

URL: http://svn.apache.org/viewvc?view=rev&rev=507105
Log:
Timeout value is not set properly

Modified:
    jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PollMethod.java
    jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/header/TimeoutHeader.java

Modified: jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PollMethod.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PollMethod.java?view=diff&rev=507105&r1=507104&r2=507105
==============================================================================
--- jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PollMethod.java
(original)
+++ jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods/PollMethod.java
Tue Feb 13 09:11:36 2007
@@ -20,6 +20,7 @@
 import org.apache.jackrabbit.webdav.DavMethods;
 import org.apache.jackrabbit.webdav.DavServletResponse;
 import org.apache.jackrabbit.webdav.DavException;
+import org.apache.jackrabbit.webdav.header.PollTimeoutHeader;
 import org.apache.jackrabbit.webdav.xml.DomUtil;
 import org.apache.jackrabbit.webdav.xml.ElementIterator;
 import org.apache.jackrabbit.webdav.observation.ObservationConstants;
@@ -50,8 +51,7 @@
         super(uri);
         setRequestHeader(ObservationConstants.HEADER_SUBSCRIPTIONID, subscriptionId);
         if (timeout > 0) {
-            setRequestHeader(ObservationConstants.HEADER_POLL_TIMEOUT,
-                    String.valueOf(timeout));
+            setRequestHeader(new PollTimeoutHeader(timeout));
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/header/TimeoutHeader.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/header/TimeoutHeader.java?view=diff&rev=507105&r1=507104&r2=507105
==============================================================================
--- jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/header/TimeoutHeader.java
(original)
+++ jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/header/TimeoutHeader.java
Tue Feb 13 09:11:36 2007
@@ -40,7 +40,11 @@
     }
 
     public String getHeaderValue() {
-        return String.valueOf(timeout);
+        if (timeout == INFINITE_TIMEOUT) {
+            return TIMEOUT_INFINITE;
+        } else {
+            return "Second-" + (timeout / 1000);
+        }
     }
 
     public long getTimeout() {
@@ -67,7 +71,7 @@
      * into a long indicating the number of milliseconds until expiration time
      * is reached.<br>
      * NOTE: If the timeout String equals to {@link #TIMEOUT_INFINITE 'infinite'}
-     * {@link Long#MAX_VALUE} is returned. If the Sting is invalid or is in an
+     * {@link Integer#MAX_VALUE} is returned. If the Sting is invalid or is in an
      * invalid format that cannot be parsed, the default value is returned.
      *
      * @param timeoutStr



Mime
View raw message