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 corkscrew.c #14

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

Update corkscrew.c #14

wants to merge 1 commit into from

Conversation

Surmoka
Copy link

@Surmoka Surmoka commented Feb 3, 2021

Always setting stdin (fd 0) into &rfd causes select() to return immediately during the connecting phase as incoming data from stdin is not read until setup completes. This causes corkscrew to iterate at 100% CPU in the for(;;) loop until connection succeeds. Only allowing stdin into select() when we're already connected is done by checking for the setup variable.
Also, curly brace was mistakenly closed immediately at connect error check.

Always setting stdin (fd 0) into &rfd causes select() to return immediately during the connecting phase as incoming data from stdin is not read until setup completes. This causes corkscrew to iterate at 100% CPU in the for(;;) loop until connection succeeds. Only allowing stdin into select() when we're already connected is done by checking for the setup variable.
Also, curly brace was mistakenly closed immediately at connect error check.
@Surmoka Surmoka closed this Feb 3, 2021
@Surmoka Surmoka reopened this Feb 3, 2021
@akhiljalagam
Copy link

@Surmoka thanks a lot. for saving my CPU cycles. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants