Skip to content

Commit

Permalink
TCP select bug when SSL negotiation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdavidgraham committed May 27, 2019
1 parent bcaba9a commit 37be762
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tcp.c
Expand Up @@ -82,6 +82,11 @@ tcp_can_receive(int sck, int millis)
struct timeval time;
int sel_count;

if (sck <= 0 || FD_SETSIZE <= sck) {
STATUS(0, "SELECT FAILURE %d\n", sck);
RESULT("UNKNOWN - connection terminated\n");
exit(1);
}
time.tv_sec = millis / 1000;
time.tv_usec = (millis * 1000) % 1000000;
FD_ZERO(&wfds);
Expand Down

0 comments on commit 37be762

Please sign in to comment.