Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
unix: fix uv_tcp_simultaneous_accepts() logic
Browse files Browse the repository at this point in the history
Inverts the meaning of the 'enable' argument.
  • Loading branch information
bnoordhuis committed Mar 12, 2013
1 parent 2f84a57 commit 609c5cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/uv.h
Expand Up @@ -660,12 +660,12 @@ UV_EXTERN int uv_tcp_keepalive(uv_tcp_t* handle,
unsigned int delay);

/*
* This setting applies to Windows only.
* Enable/disable simultaneous asynchronous accept requests that are
* queued by the operating system when listening for new tcp connections.
* This setting is used to tune a tcp server for the desired performance.
* Having simultaneous accepts can significantly improve the rate of
* accepting connections (which is why it is enabled by default).
* accepting connections (which is why it is enabled by default) but
* may lead to uneven load distribution in multi-process setups.
*/
UV_EXTERN int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable);

Expand Down
8 changes: 4 additions & 4 deletions src/unix/tcp.c
Expand Up @@ -343,11 +343,11 @@ int uv_tcp_keepalive(uv_tcp_t* handle, int on, unsigned int delay) {
}


int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int on) {
if (on)
handle->flags |= UV_TCP_SINGLE_ACCEPT;
else
int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable) {
if (enable)
handle->flags &= ~UV_TCP_SINGLE_ACCEPT;
else
handle->flags |= UV_TCP_SINGLE_ACCEPT;
return 0;
}

Expand Down

0 comments on commit 609c5cd

Please sign in to comment.