Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SSLSocketChannel2.java #1253

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sahnjeok
Copy link

@sahnjeok sahnjeok commented Jun 17, 2022

Description

'handshakeStartTime' global long variable is added and isHandShakeComplete() function is updated.
In isHandShakeComplete function, if wss handshake is not completed in 10s, close this channel to prevent cpu overload or unexpected channel error.

Related Issue

Fixes #896

Motivation and Context

When WSS port is opened, if new client is connected and no ssl packet is received from client, high cpu load happens.

How Has This Been Tested?

  1. open wss port
  2. telnet to wss port and wait
  3. high cpu load happens

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

'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.
@marci4 marci4 added the wss label Jul 4, 2022
bergice added a commit to bergice/Java-WebSocket that referenced this pull request Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

High cpu load
2 participants