corkscrew icon indicating copy to clipboard operation
corkscrew copied to clipboard

Update corkscrew.c

Open Surmoka opened this issue 4 years ago • 1 comments

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 avatar Feb 03 '21 19:02 Surmoka

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

akhiljalagam avatar Jan 08 '24 19:01 akhiljalagam