You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2018/12/28 03:43:36 UTC

[Bug 57974] getOpenSessions() bug

https://bz.apache.org/bugzilla/show_bug.cgi?id=57974

Zhang Zhongyi <oh...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #8 from Zhang Zhongyi <oh...@gmail.com> ---
Now getOpenSessions can only return the current session.
The problem is that Endpoint is used as the key of the HashMap but its hashCode
and equals method are not overridden. They are directly inherited from Object. 

Each time a new connection comes in a new Endpoint instance is created. Because
it uses the hashCode and equals from Object, it will never match any instances
created before even if the request is to the same URL.

My suggestion is to use the URI from session.getRequestURI() as the key of the
map instead of the Endpoint.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org