Skip to content

Update corkscrew.c#14

Open
Surmoka wants to merge 1 commit intobryanpkc:masterfrom
Surmoka:patch-1
Open

Update corkscrew.c#14
Surmoka wants to merge 1 commit intobryanpkc:masterfrom
Surmoka:patch-1

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