diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2011-07-21 02:13:02 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2011-07-21 02:13:02 +0200 |
commit | 66f936bfd766b349e374c02a3b7ce5d798edab0f (patch) | |
tree | e45444d5ce283a93b8f99d8d0227d92ca0aee550 | |
parent | 332bbecd19725ca4aeb66a9ab0efc4b1d9863d70 (diff) | |
download | libuv-66f936bfd766b349e374c02a3b7ce5d798edab0f.tar.gz libuv-66f936bfd766b349e374c02a3b7ce5d798edab0f.zip |
uv-unix: call uv__accept() instead of accept()
uv__accept() puts the socket in non-blocking close-on-exec mode,
accept() by itself does not.
Solves the case of the mysteriously hanging HTTP benchmarks.
-rw-r--r-- | src/uv-unix.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/uv-unix.c b/src/uv-unix.c index a2b9d377..d583c378 100644 --- a/src/uv-unix.c +++ b/src/uv-unix.c @@ -405,7 +405,6 @@ static int uv__stream_open(uv_stream_t* stream, int fd) { void uv__server_io(EV_P_ ev_io* watcher, int revents) { int fd; struct sockaddr_storage addr; - socklen_t addrlen = sizeof(struct sockaddr_storage); uv_stream_t* stream = watcher->data; assert(watcher == &stream->read_watcher || @@ -421,7 +420,7 @@ void uv__server_io(EV_P_ ev_io* watcher, int revents) { while (1) { assert(stream->accepted_fd < 0); - fd = accept(stream->fd, (struct sockaddr*)&addr, &addrlen); + fd = uv__accept(stream->fd, (struct sockaddr*)&addr, sizeof addr); if (fd < 0) { if (errno == EAGAIN) { |