From 5faf2a9f5346332d5e12e68b69cf536e4ec13bee Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 7 Sep 2010 01:24:11 +0000 Subject: [PATCH] 324601 Check session expiry on access git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2252 7e9141cc-0065-0410-87d8-b60c137991c4 --- VERSION.txt | 1 + .../session/AbstractSessionManager.java | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index faf785c38ef..5c6c6de28a9 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -27,6 +27,7 @@ jetty-7.2-SNAPSHOT + 324377 Allow dispatch of ServletRequest and ServletResponse + 324379 Change content type after getWriter + 324501 Fire RequestListener.requestDestroyed in last-to-first order. + + 324601 Check session expiry on access + JETTY-912 added per exchange timeout api + JETTY-1245 Do not use direct buffers with NIO SSL + JETTY-1249 Apply max idle time to all connectors diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java index e25dd0f1cd6..8ed2df9b1e0 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java @@ -992,10 +992,21 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement { synchronized(this) { - _newSession=false; - _lastAccessed=_accessed; - _accessed=time; - _requests++; + if (!_invalid) + { + if (_lastAccessed + _maxIdleMs < time) + { + invalidate(); + } + else + { + _newSession=false; + _lastAccessed=_accessed; + _accessed=time; + _requests++; + } + } + } }