Summary: | Unexpected WsFilter is configured in a webapp that does not use WebSocket | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | Konstantin Kolinko <knst.kolinko> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | P2 | ||
Version: | 7.0.47 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
Konstantin Kolinko
2013-12-07 00:38:18 UTC
This is not really that different from saying that a web application that doesn't use JSPs still has a JspServlet instance or a web application that doesn't use sessions still has a session manager. As discussed on the users list we could add a attribute to the Context to specify a regular expression for SCI implementation classes that should be ignored. I'm changing this to an enhancement request to do exactly that. I have patched 8.0.x and 7.0.x so the filter is only added if a web application has active WebSocket Endpoints. I think there is still merit in disabling the SCI since that will remove the need for the annotation scan. A new option, containerSciFilter, has been added to the Context in 8.0.x and will be included in 8.0.0 onwards. The option has been back-ported to 7.0.x and will be included in 7.0.51 onwards. Historical notes: (In reply to Mark Thomas from comment #2) > I have patched 8.0.x and 7.0.x so the filter is only added if a web > application has active WebSocket Endpoints. I think there is still merit in > disabling the SCI since that will remove the need for the annotation scan. 1. The change described above was later reverted because of a regression: it broke programmatic configuration of endpoints. The regression was reported in "[VOTE] Release Apache Tomcat 8.0.0-RC9" thread. http://tomcat.markmail.org/thread/2zmfqvveg3xhegwq This is the reason why the WsFilter installation cannot be skipped in a web application that uses websockets. The change: r1551356 Reverting the change: r1552076 2. As part of review for this issue, performance of WsFilter was improved in r1552083. Change log message: "Don't do the expensive 'Is this a WebSocket upgrade request check' if no endpoints have been registered" (In reply to Mark Thomas from comment #3) > A new option, containerSciFilter, has been added to the Context in 8.0.x and > will be included in 8.0.0 onwards. 3. Note, that "containerSciFilter" option can be used to explicitly disable WebSocket support for a selected web application (or globally via the default context configuration file). http://tomcat.apache.org/tomcat-8.0-doc/config/context.html http://wiki.apache.org/tomcat/HowTo/FasterStartUp |