corkscrew
corkscrew copied to clipboard
Update corkscrew.c
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 thanks a lot. for saving my CPU cycles. 🙂