Skip to content

Commit 7169879

Browse files
committed
uv: Upgrade to v0.10.28
1 parent 530af9c commit 7169879

10 files changed

Lines changed: 125 additions & 10 deletions

File tree

deps/uv/ChangeLog

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
2014.05.02, Version 0.10.27 (Stable)
1+
2014.07.32, Version 0.10.28 (Stable)
2+
3+
Changes since version 0.10.27:
4+
5+
* windows: fix handling closed socket while poll handle is closing (Saúl Ibarra
6+
Corretgé)
7+
8+
* unix: return system error on EAI_SYSTEM (Saúl Ibarra Corretgé)
9+
10+
* unix: fix bogus structure field name (Saúl Ibarra Corretgé)
11+
12+
* darwin: invoke `mach_timebase_info` only once (Fedor Indutny)
13+
14+
15+
2014.05.02, Version 0.10.27 (Stable), 6e24ce23b1e7576059f85a608eca13b766458a01
216

317
Changes since version 0.10.26:
418

deps/uv/build.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ TESTS= \
102102
test/test-platform-output.o \
103103
test/test-poll.o \
104104
test/test-poll-close.o \
105+
test/test-poll-closesocket.o \
105106
test/test-process-title.o \
106107
test/test-ref.o \
107108
test/test-run-nowait.o \

deps/uv/src/unix/darwin.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,14 @@ void uv__cf_loop_signal(uv_loop_t* loop, cf_loop_signal_cb cb, void* arg) {
179179

180180

181181
uint64_t uv__hrtime(void) {
182-
mach_timebase_info_data_t info;
182+
static mach_timebase_info_data_t info;
183183

184-
if (mach_timebase_info(&info) != KERN_SUCCESS)
185-
abort();
184+
if ((ACCESS_ONCE(uint32_t, info.numer) == 0 ||
185+
ACCESS_ONCE(uint32_t, info.denom) == 0) &&
186+
mach_timebase_info(&info) != KERN_SUCCESS)
187+
abort();
186188

187-
return mach_absolute_time() * info.numer / info.denom;
189+
return mach_absolute_time() * info.numer / info.denom;
188190
}
189191

190192

deps/uv/src/unix/getaddrinfo.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ static void uv__getaddrinfo_work(struct uv__work* w) {
3434
req->service,
3535
req->hints,
3636
&req->res);
37+
if (req->retcode == EAI_SYSTEM)
38+
req->retcode = -errno;
3739
}
3840

3941

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

70-
if (req->retcode == 0) {
72+
if (req->retcode < 0) {
73+
/* EAI_SYSTEM error */
74+
uv__set_sys_error(req->loop, -req->retcode);
75+
} else if (req->retcode == 0) {
7176
/* OK */
7277
#if defined(EAI_NODATA) /* FreeBSD deprecated EAI_NODATA */
7378
} else if (req->retcode == EAI_NONAME || req->retcode == EAI_NODATA) {

deps/uv/src/version.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#define UV_VERSION_MAJOR 0
3636
#define UV_VERSION_MINOR 10
37-
#define UV_VERSION_PATCH 27
37+
#define UV_VERSION_PATCH 28
3838
#define UV_VERSION_IS_RELEASE 1
3939

4040

deps/uv/src/win/poll.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ static void uv__fast_poll_process_poll_req(uv_loop_t* loop, uv_poll_t* handle,
187187
if (afd_poll_info->Handles[0].Events & AFD_POLL_LOCAL_CLOSE) {
188188
/* Stop polling. */
189189
handle->events = 0;
190-
uv__handle_stop(handle);
190+
if (uv__is_active(handle))
191+
uv__handle_stop(handle);
191192
}
192193

193194
if (events != 0) {

deps/uv/test/test-list.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ TEST_DECLARE (poll_duplex)
215215
TEST_DECLARE (poll_unidirectional)
216216
TEST_DECLARE (poll_close)
217217
#ifdef _WIN32
218+
TEST_DECLARE (poll_closesocket)
218219
TEST_DECLARE (spawn_detect_pipe_name_collisions_on_windows)
219220
TEST_DECLARE (argument_escaping)
220221
TEST_DECLARE (environment_creation)
@@ -449,6 +450,7 @@ TASK_LIST_START
449450
TEST_ENTRY (kill)
450451

451452
#ifdef _WIN32
453+
TEST_ENTRY (poll_closesocket)
452454
TEST_ENTRY (spawn_detect_pipe_name_collisions_on_windows)
453455
TEST_ENTRY (argument_escaping)
454456
TEST_ENTRY (environment_creation)
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2+
*
3+
* Permission is hereby granted, free of charge, to any person obtaining a copy
4+
* of this software and associated documentation files (the "Software"), to
5+
* deal in the Software without restriction, including without limitation the
6+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7+
* sell copies of the Software, and to permit persons to whom the Software is
8+
* furnished to do so, subject to the following conditions:
9+
*
10+
* The above copyright notice and this permission notice shall be included in
11+
* all copies or substantial portions of the Software.
12+
*
13+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19+
* IN THE SOFTWARE.
20+
*/
21+
22+
#ifdef _WIN32
23+
24+
#include <errno.h>
25+
26+
#include "uv.h"
27+
#include "task.h"
28+
29+
uv_os_sock_t sock;
30+
uv_poll_t handle;
31+
32+
static int close_cb_called = 0;
33+
34+
35+
static void close_cb(uv_handle_t* h) {
36+
close_cb_called++;
37+
}
38+
39+
40+
static void poll_cb(uv_poll_t* h, int status, int events) {
41+
int r;
42+
43+
ASSERT(status == 0);
44+
ASSERT(h == &handle);
45+
46+
r = uv_poll_start(&handle, UV_READABLE, poll_cb);
47+
ASSERT(r == 0);
48+
49+
closesocket(sock);
50+
uv_close((uv_handle_t*) &handle, close_cb);
51+
52+
}
53+
54+
55+
TEST_IMPL(poll_closesocket) {
56+
struct WSAData wsa_data;
57+
int r;
58+
unsigned long on;
59+
struct sockaddr_in addr;
60+
61+
r = WSAStartup(MAKEWORD(2, 2), &wsa_data);
62+
ASSERT(r == 0);
63+
64+
sock = socket(AF_INET, SOCK_STREAM, 0);
65+
ASSERT(sock != INVALID_SOCKET);
66+
on = 1;
67+
r = ioctlsocket(sock, FIONBIO, &on);
68+
ASSERT(r == 0);
69+
70+
r = uv_ip4_addr("127.0.0.1", TEST_PORT, &addr);
71+
ASSERT(r == 0);
72+
73+
r = connect(sock, (const struct sockaddr*) &addr, sizeof addr);
74+
ASSERT(r != 0);
75+
ASSERT(WSAGetLastError() == WSAEWOULDBLOCK);
76+
77+
r = uv_poll_init_socket(uv_default_loop(), &handle, sock);
78+
ASSERT(r == 0);
79+
r = uv_poll_start(&handle, UV_WRITABLE, poll_cb);
80+
ASSERT(r == 0);
81+
82+
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
83+
84+
ASSERT(close_cb_called == 1);
85+
86+
MAKE_VALGRIND_HAPPY();
87+
return 0;
88+
}
89+
#endif

deps/uv/test/test-spawn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,9 @@ TEST_IMPL(spawn_closed_process_io) {
681681
uv_write_t write_req;
682682
uv_buf_t buf;
683683
uv_stdio_container_t stdio[2];
684-
static char buffer[] = "hello-from-spawn_stdin";
684+
static char buffer[] = "hello-from-spawn_stdin\n";
685685

686-
init_process_options("spawn_helper1", exit_cb);
686+
init_process_options("spawn_helper3", exit_cb);
687687

688688
uv_pipe_init(uv_default_loop(), &in, 0);
689689
options.stdio = stdio;

deps/uv/uv.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@
322322
'test/test-platform-output.c',
323323
'test/test-poll.c',
324324
'test/test-poll-close.c',
325+
'test/test-poll-closesocket.c',
325326
'test/test-process-title.c',
326327
'test/test-ref.c',
327328
'test/test-run-nowait.c',

0 commit comments

Comments
 (0)