Bug 1100486
Summary: | Web Socket close does not close underlying connection | ||
---|---|---|---|
Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Stuart Douglas <sdouglas> |
Component: | Web | Assignee: | Rémy Maucherat <rmaucher> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Radim Hatlapatka <rhatlapa> |
Severity: | urgent | Docs Contact: | Russell Dickenson <rdickens> |
Priority: | unspecified | ||
Version: | 6.3.0 | CC: | dosoudil |
Target Milestone: | ER6 | ||
Target Release: | EAP 6.3.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-06-28 15:27:54 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Stuart Douglas
2014-05-22 21:58:30 UTC
There's a discrepancy with Tomcat's handling, so I'll try to resolve it. Tried to align the behavior in r2415. The current code still does not work. I think that when an update is present the keepAlive field in org.apache.coyote.http11.Http11AbstractProcessor must be set to false. I did up a quick patch that set this to false if the upgrade header is present, and it appears to work. Not 100% sure if this is the best solution though. Index: src/main/java/org/apache/coyote/http11/Http11NioProcessor.java =================================================================== --- src/main/java/org/apache/coyote/http11/Http11NioProcessor.java (revision 2415) +++ src/main/java/org/apache/coyote/http11/Http11NioProcessor.java (working copy) @@ -1228,6 +1228,10 @@ keepAlive = false; } + if(headers.getHeader("Upgrade") != null) { + keepAlive = false; + } + // If we know that the request is bad this early, add the // Connection: close header. keepAlive = keepAlive && !statusDropsConnection(statusCode); This doesn't look very good to me. I want to do a clean close, if it doesn't work, well ... From what I can see the code you added does not do a clean close, it simply starts the next request processing, which does not really make sense, you should not be trying to parse a HTTP request on an upgraded connection. As far as I can tell setting keepAlive to false tells the server to not start processing the next request, but cleanly close the connection instead, which is exactly the behaviour that is expected. Yes, there needs to be some code to avoid doing a keepalive after upgrade. This is all Servlet 3.1 but not really tested obviously. The processing of the close now seems more appropriate, but need to make sure this does not go into keepalive (as with the diff above basically): r2416 The last commit fixes the issue. Ok, so it will be in the next web build. Included with https://bugzilla.redhat.com/show_bug.cgi?id=1100799 Verified in EAP 6.3.0.ER7 |