Skip to content

Commit

Permalink
uv: Upgrade to v0.10.28
Browse files Browse the repository at this point in the history
  • Loading branch information
tjfontaine committed Jul 31, 2014
1 parent 530af9c commit 7169879
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 10 deletions.
16 changes: 15 additions & 1 deletion deps/uv/ChangeLog
@@ -1,4 +1,18 @@
2014.05.02, Version 0.10.27 (Stable)
2014.07.32, Version 0.10.28 (Stable)

Changes since version 0.10.27:

* windows: fix handling closed socket while poll handle is closing (Saúl Ibarra
Corretgé)

* unix: return system error on EAI_SYSTEM (Saúl Ibarra Corretgé)

* unix: fix bogus structure field name (Saúl Ibarra Corretgé)

* darwin: invoke `mach_timebase_info` only once (Fedor Indutny)


2014.05.02, Version 0.10.27 (Stable), 6e24ce23b1e7576059f85a608eca13b766458a01

Changes since version 0.10.26:

Expand Down
1 change: 1 addition & 0 deletions deps/uv/build.mk
Expand Up @@ -102,6 +102,7 @@ TESTS= \
test/test-platform-output.o \
test/test-poll.o \
test/test-poll-close.o \
test/test-poll-closesocket.o \
test/test-process-title.o \
test/test-ref.o \
test/test-run-nowait.o \
Expand Down
10 changes: 6 additions & 4 deletions deps/uv/src/unix/darwin.c
Expand Up @@ -179,12 +179,14 @@ void uv__cf_loop_signal(uv_loop_t* loop, cf_loop_signal_cb cb, void* arg) {


uint64_t uv__hrtime(void) {
mach_timebase_info_data_t info;
static mach_timebase_info_data_t info;

if (mach_timebase_info(&info) != KERN_SUCCESS)
abort();
if ((ACCESS_ONCE(uint32_t, info.numer) == 0 ||
ACCESS_ONCE(uint32_t, info.denom) == 0) &&
mach_timebase_info(&info) != KERN_SUCCESS)
abort();

return mach_absolute_time() * info.numer / info.denom;
return mach_absolute_time() * info.numer / info.denom;
}


Expand Down
7 changes: 6 additions & 1 deletion deps/uv/src/unix/getaddrinfo.c
Expand Up @@ -34,6 +34,8 @@ static void uv__getaddrinfo_work(struct uv__work* w) {
req->service,
req->hints,
&req->res);
if (req->retcode == EAI_SYSTEM)
req->retcode = -errno;
}


Expand Down Expand Up @@ -67,7 +69,10 @@ static void uv__getaddrinfo_done(struct uv__work* w, int status) {
req->service = NULL;
req->hostname = NULL;

if (req->retcode == 0) {
if (req->retcode < 0) {
/* EAI_SYSTEM error */
uv__set_sys_error(req->loop, -req->retcode);
} else if (req->retcode == 0) {
/* OK */
#if defined(EAI_NODATA) /* FreeBSD deprecated EAI_NODATA */
} else if (req->retcode == EAI_NONAME || req->retcode == EAI_NODATA) {
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/src/version.c
Expand Up @@ -34,7 +34,7 @@

#define UV_VERSION_MAJOR 0
#define UV_VERSION_MINOR 10
#define UV_VERSION_PATCH 27
#define UV_VERSION_PATCH 28
#define UV_VERSION_IS_RELEASE 1


Expand Down
3 changes: 2 additions & 1 deletion deps/uv/src/win/poll.c
Expand Up @@ -187,7 +187,8 @@ static void uv__fast_poll_process_poll_req(uv_loop_t* loop, uv_poll_t* handle,
if (afd_poll_info->Handles[0].Events & AFD_POLL_LOCAL_CLOSE) {
/* Stop polling. */
handle->events = 0;
uv__handle_stop(handle);
if (uv__is_active(handle))
uv__handle_stop(handle);
}

if (events != 0) {
Expand Down
2 changes: 2 additions & 0 deletions deps/uv/test/test-list.h
Expand Up @@ -215,6 +215,7 @@ TEST_DECLARE (poll_duplex)
TEST_DECLARE (poll_unidirectional)
TEST_DECLARE (poll_close)
#ifdef _WIN32
TEST_DECLARE (poll_closesocket)
TEST_DECLARE (spawn_detect_pipe_name_collisions_on_windows)
TEST_DECLARE (argument_escaping)
TEST_DECLARE (environment_creation)
Expand Down Expand Up @@ -449,6 +450,7 @@ TASK_LIST_START
TEST_ENTRY (kill)

#ifdef _WIN32
TEST_ENTRY (poll_closesocket)
TEST_ENTRY (spawn_detect_pipe_name_collisions_on_windows)
TEST_ENTRY (argument_escaping)
TEST_ENTRY (environment_creation)
Expand Down
89 changes: 89 additions & 0 deletions deps/uv/test/test-poll-closesocket.c
@@ -0,0 +1,89 @@
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/

#ifdef _WIN32

#include <errno.h>

#include "uv.h"
#include "task.h"

uv_os_sock_t sock;
uv_poll_t handle;

static int close_cb_called = 0;


static void close_cb(uv_handle_t* h) {
close_cb_called++;
}


static void poll_cb(uv_poll_t* h, int status, int events) {
int r;

ASSERT(status == 0);
ASSERT(h == &handle);

r = uv_poll_start(&handle, UV_READABLE, poll_cb);
ASSERT(r == 0);

closesocket(sock);
uv_close((uv_handle_t*) &handle, close_cb);

}


TEST_IMPL(poll_closesocket) {
struct WSAData wsa_data;
int r;
unsigned long on;
struct sockaddr_in addr;

r = WSAStartup(MAKEWORD(2, 2), &wsa_data);
ASSERT(r == 0);

sock = socket(AF_INET, SOCK_STREAM, 0);
ASSERT(sock != INVALID_SOCKET);
on = 1;
r = ioctlsocket(sock, FIONBIO, &on);
ASSERT(r == 0);

r = uv_ip4_addr("127.0.0.1", TEST_PORT, &addr);
ASSERT(r == 0);

r = connect(sock, (const struct sockaddr*) &addr, sizeof addr);
ASSERT(r != 0);
ASSERT(WSAGetLastError() == WSAEWOULDBLOCK);

r = uv_poll_init_socket(uv_default_loop(), &handle, sock);
ASSERT(r == 0);
r = uv_poll_start(&handle, UV_WRITABLE, poll_cb);
ASSERT(r == 0);

uv_run(uv_default_loop(), UV_RUN_DEFAULT);

ASSERT(close_cb_called == 1);

MAKE_VALGRIND_HAPPY();
return 0;
}
#endif
4 changes: 2 additions & 2 deletions deps/uv/test/test-spawn.c
Expand Up @@ -681,9 +681,9 @@ TEST_IMPL(spawn_closed_process_io) {
uv_write_t write_req;
uv_buf_t buf;
uv_stdio_container_t stdio[2];
static char buffer[] = "hello-from-spawn_stdin";
static char buffer[] = "hello-from-spawn_stdin\n";

init_process_options("spawn_helper1", exit_cb);
init_process_options("spawn_helper3", exit_cb);

uv_pipe_init(uv_default_loop(), &in, 0);
options.stdio = stdio;
Expand Down
1 change: 1 addition & 0 deletions deps/uv/uv.gyp
Expand Up @@ -322,6 +322,7 @@
'test/test-platform-output.c',
'test/test-poll.c',
'test/test-poll-close.c',
'test/test-poll-closesocket.c',
'test/test-process-title.c',
'test/test-ref.c',
'test/test-run-nowait.c',
Expand Down

0 comments on commit 7169879

Please sign in to comment.