Skip to content

Commit

Permalink
Mark client socket non-blocking
Browse files Browse the repository at this point in the history
Avoiding to do so caused splice() to block during write.

AFAIK, it does not affect bufferevent pump, but I may be wrong.
  • Loading branch information
darkk committed Apr 3, 2016
1 parent af46180 commit c6c5cb9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions redsocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,12 @@ static void redsocks_accept_client(int fd, short what, void *_arg)
goto fail;
}

error = fcntl_nonblock(client_fd);
if (error) {
log_errno(LOG_ERR, "fcntl");
goto fail;
}

if (apply_tcp_keepalive(client_fd))
goto fail;

Expand Down

0 comments on commit c6c5cb9

Please sign in to comment.