Skip to content

Commit

Permalink
Update SSLSocketChannel2.java
Browse files Browse the repository at this point in the history
'handshakeStartTime' long variable is added and isHandShakeComplete()  function is updated for TooTallNate#896.

If wss handshake is not completed in 10s, close this channel to prevent cpu overload or unexpected channel error. See TooTallNate#896.
  • Loading branch information
sahnjeok committed Jun 17, 2022
1 parent 4b5d78f commit 92c1382
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/java_websocket/SSLSocketChannel2.java
Expand Up @@ -409,7 +409,7 @@ private boolean isHandShakeComplete() {
// 2022-06-17 If wss handshake is not completed in 10s, close this channel to prevent cpu overload or unexpected channel error. see #896.
if ( handshakeStartTime > 0 && ( System.currentTimeMillis() - handshakeStartTime ) > 10000 )
{
try{close() ;}catch(Exception ex){} ;
try{close() ;}catch(IOException ex){} ;
}
}

Expand Down

0 comments on commit 92c1382

Please sign in to comment.