You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2014/01/14 18:58:45 UTC

svn commit: r1558129 - /tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java

Author: markt
Date: Tue Jan 14 17:58:45 2014
New Revision: 1558129

URL: http://svn.apache.org/r1558129
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55996
Ensure Async requests timeout correctly.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java?rev=1558129&r1=1558128&r2=1558129&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java Tue Jan 14 17:58:45 2014
@@ -85,7 +85,15 @@ public class SocketWrapper<E> {
     public boolean isSecure() { return secure; }
     public void setSecure(boolean secure) { this.secure = secure; }
     public long getLastAccess() { return lastAccess; }
-    public void access() { access(System.currentTimeMillis()); }
+    public void access() {
+        // Async timeouts are based on the time between the call to startAsync()
+        // and complete() / dispatch() so don't update the last access time
+        // (that drives the timeout) on every read and write when using async
+        // processing.
+        if (!isAsync()) {
+            access(System.currentTimeMillis());
+        }
+    }
     public void access(long access) { lastAccess = access; }
     public void setTimeout(long timeout) {this.timeout = timeout;}
     public long getTimeout() {return this.timeout;}



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org