This is an automated email from the ASF dual-hosted git repository.
kfujino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new 0f1e263 Use the correct method to calculate session idle time in
PersistentValve
0f1e263 is described below
commit 0f1e263073d97e562972e7a0a4f72d9c1698dbd4
Author: KeiichiFujino <[email protected]>
AuthorDate: Tue Sep 1 21:24:20 2020 +0900
Use the correct method to calculate session idle time in PersistentValve
---
java/org/apache/catalina/valves/PersistentValve.java | 3 +--
webapps/docs/changelog.xml | 4 ++++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/catalina/valves/PersistentValve.java
b/java/org/apache/catalina/valves/PersistentValve.java
index ac1df10..d3db2cd 100644
--- a/java/org/apache/catalina/valves/PersistentValve.java
+++ b/java/org/apache/catalina/valves/PersistentValve.java
@@ -215,8 +215,7 @@ public class PersistentValve extends ValveBase {
if (session != null) {
int maxInactiveInterval = session.getMaxInactiveInterval();
if (maxInactiveInterval >= 0) {
- int timeIdle = // Truncate, do not round up
- (int) ((timeNow - session.getThisAccessedTime()) / 1000L);
+ int timeIdle = (int) (session.getIdleTimeInternal() / 1000L);
if (timeIdle >= maxInactiveInterval) {
return true;
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a3daa60..dae52f6 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -97,6 +97,10 @@
Added filtering expression for requests that are not supposed to use
session in <code>PersistentValve</code>. (kfujino)
</add>
+ <fix>
+ Use the correct method to calculate session idle time in
+ <code>PersistentValve</code>. (kfujino)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]