This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new e012b4a81d Remove unused code
e012b4a81d is described below
commit e012b4a81dd907e3ae20311f37720f3baa9288dd
Author: remm <[email protected]>
AuthorDate: Fri Jan 17 10:41:19 2025 +0100
Remove unused code
Following 1c35c6dbd5f158f62a63c428f09537c876bd3735 the session to client
map is no longer used. Remove it.
Patch submitted by Brian Matzon.
---
java/org/apache/catalina/valves/CrawlerSessionManagerValve.java | 2 --
test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java | 2 +-
webapps/docs/changelog.xml | 5 +++++
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
index 7bcb863111..f6ce1b09cf 100644
--- a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
+++ b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
@@ -46,7 +46,6 @@ public class CrawlerSessionManagerValve extends ValveBase {
private static final Log log =
LogFactory.getLog(CrawlerSessionManagerValve.class);
private final Map<String,String> clientIdSessionId = new
ConcurrentHashMap<>();
- private final Map<String,String> sessionIdClientId = new
ConcurrentHashMap<>();
private String crawlerUserAgents = ".*[bB]ot.*|.*Yahoo!
Slurp.*|.*Feedfetcher-Google.*";
private Pattern uaPattern = null;
@@ -246,7 +245,6 @@ public class CrawlerSessionManagerValve extends ValveBase {
HttpSession s = request.getSession(false);
if (s != null) {
clientIdSessionId.put(clientIdentifier, s.getId());
- sessionIdClientId.put(s.getId(), clientIdentifier);
// #valueUnbound() will be called on session expiration
s.setAttribute(this.getClass().getName(),
new
CrawlerHttpSessionBindingListener(clientIdSessionId, clientIdentifier));
diff --git
a/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java
b/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java
index 9c535ca416..1042e4287a 100644
--- a/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java
+++ b/test/org/apache/catalina/valves/TestCrawlerSessionManagerValve.java
@@ -165,7 +165,7 @@ public class TestCrawlerSessionManagerValve {
private HttpSession createSessionExpectations(CrawlerSessionManagerValve
valve, boolean isBot) {
HttpSession session = EasyMock.createMock(HttpSession.class);
if (isBot) {
- EasyMock.expect(session.getId()).andReturn("id").times(2);
+ EasyMock.expect(session.getId()).andReturn("id").times(1);
session.setAttribute(EasyMock.eq(valve.getClass().getName()),
EasyMock.anyObject(HttpSessionBindingListener.class));
EasyMock.expectLastCall();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index eaa20aefb6..ecc1c53a4b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -140,6 +140,11 @@
Improve checks for <code>WEB-INF</code> and <code>META-INF</code> in
the WebDAV servlet. Based on a patch submitted by Chenjp. (remm)
</fix>
+ <fix>
+ Remove unused session to client map from
+ <code>CrawlerSessionManagerValve</code>. Submitted by Brian Matzon.
+ (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]