Author: markt Date: Wed Sep 3 12:22:08 2014 New Revision: 1622236 URL: http://svn.apache.org/r1622236 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56907 Ensure that client IO threads are stopped if a secure WebSocket client connection fails.
Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1622233 Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java?rev=1622236&r1=1622235&r2=1622236&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java Wed Sep 3 12:22:08 2014 @@ -284,6 +284,7 @@ public class WsWebSocketContainer ByteBuffer response; String subProtocol; + boolean success = false; try { fConnect.get(timeout, TimeUnit.MILLISECONDS); @@ -321,6 +322,7 @@ public class WsWebSocketContainer throw new DeploymentException( sm.getString("Sec-WebSocket-Protocol")); } + success = true; } catch (ExecutionException e) { throw new DeploymentException( sm.getString("wsWebSocketContainer.httpRequestFailed"), e); @@ -336,6 +338,10 @@ public class WsWebSocketContainer } catch (TimeoutException e) { throw new DeploymentException( sm.getString("wsWebSocketContainer.httpRequestFailed"), e); + } finally { + if (!success) { + channel.close(); + } } // Switch to WebSocket Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1622236&r1=1622235&r2=1622236&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Sep 3 12:22:08 2014 @@ -164,6 +164,10 @@ amongst other things, the JNDI resources associated with the web application. (markt) </fix> + <fix> + <bug>56907</bug>: Ensure that client IO threads are stopped if a secure + WebSocket client connection fails. (markt) + </fix> </changelog> </subsection> <subsection name="Web applications"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org