Skip to content

Commit 097fde7

Browse files
saghulbnoordhuis
authored andcommitted
deps: update libuv to 1.3.0
PR-URL: #644 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 6ad236c commit 097fde7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+589
-322
lines changed

deps/uv/AUTHORS

+2
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,5 @@ Kenneth Perry <[email protected]>
178178
John Marino <[email protected]>
179179
Alexey Melnichuk <[email protected]>
180180
Johan Bergström <[email protected]>
181+
182+
Luis Martinez de Bartolome <[email protected]>

deps/uv/ChangeLog

+48
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
1+
2015.01.29, Version 1.3.0 (Stable), 165685b2a9a42cf96501d79cd6d48a18aaa16e3b
2+
3+
Changes since version 1.2.1:
4+
5+
* unix, windows: set non-block mode in uv_poll_init (Saúl Ibarra Corretgé)
6+
7+
* doc: clarify which flags are supported in uv_fs_event_start (Saúl Ibarra
8+
Corretgé)
9+
10+
* win,unix: move loop functions which have identical implementations (Andrius
11+
Bentkus)
12+
13+
* doc: explain how the threadpool is allocated (Alex Mo)
14+
15+
* doc: clarify uv_default_loop (Saúl Ibarra Corretgé)
16+
17+
* unix: fix implicit declaration compiler warning (Ben Noordhuis)
18+
19+
* unix: fix long line introduced in commit 94e628fa (Ben Noordhuis)
20+
21+
* unix, win: add synchronous uv_get{addr,name}info (Saúl Ibarra Corretgé)
22+
23+
* linux: fix epoll_pwait() regression with < 2.6.19 (Ben Noordhuis)
24+
25+
* build: compile -D_GNU_SOURCE on linux (Ben Noordhuis)
26+
27+
* build: use -fvisibility=hidden in autotools build (Ben Noordhuis)
28+
29+
* fs, pipe: no trailing terminator in exact sized buffers (Andrius Bentkus)
30+
31+
* style: rename buf to buffer and len to size for consistency (Andrius Bentkus)
32+
33+
* test: fix test-spawn on MinGW32 (Luis Martinez de Bartolome)
34+
35+
* win, pipe: fix assertion when destroying timer (Andrius Bentkus)
36+
37+
* win, unix: add pipe_peername implementation (Andrius Bentkus)
38+
39+
40+
2015.01.29, Version 0.10.33 (Stable), 7a2253d33ad8215a26c1b34f1952aee7242dd687
41+
42+
Changes since version 0.10.32:
43+
44+
* linux: fix epoll_pwait() regression with < 2.6.19 (Ben Noordhuis)
45+
46+
* test: back-port uv_loop_configure() test (Ben Noordhuis)
47+
48+
149
2015.01.15, Version 1.2.1 (Stable), 4ca78e989062a1099dc4b9ad182a98e8374134b1
250

351
Changes since version 1.2.0:

deps/uv/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ endif
303303

304304
if LINUX
305305
include_HEADERS += include/uv-linux.h
306+
libuv_la_CFLAGS += -D_GNU_SOURCE
306307
libuv_la_SOURCES += src/unix/linux-core.c \
307308
src/unix/linux-inotify.c \
308309
src/unix/linux-syscalls.c \

deps/uv/configure.ac

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1414

1515
AC_PREREQ(2.57)
16-
AC_INIT([libuv], [1.2.1], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.3.0], [https://github.com/libuv/libuv/issues])
1717
AC_CONFIG_MACRO_DIR([m4])
1818
m4_include([m4/libuv-extra-automake-flags.m4])
1919
m4_include([m4/as_case.m4])
@@ -24,6 +24,7 @@ AC_ENABLE_SHARED
2424
AC_ENABLE_STATIC
2525
AC_PROG_CC
2626
AM_PROG_CC_C_O
27+
CC_CHECK_CFLAGS_APPEND([-fvisibility=hidden])
2728
CC_CHECK_CFLAGS_APPEND([-g])
2829
CC_CHECK_CFLAGS_APPEND([-std=gnu89])
2930
CC_CHECK_CFLAGS_APPEND([-pedantic])

deps/uv/docs/src/dns.rst

+13
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ Public members
3939
Loop that started this getaddrinfo request and where completion will be
4040
reported. Readonly.
4141

42+
.. c:member:: struct addrinfo* uv_getaddrinfo_t.addrinfo
43+
44+
Pointer to a `struct addrinfo` containing the result. Must be freed by the user
45+
with :c:func:`uv_freeaddrinfo`.
46+
47+
.. versionchanged:: 1.3.0 the field is declared as public.
48+
4249
.. c:member:: uv_loop_t* uv_getnameinfo_t.loop
4350
4451
Loop that started this getnameinfo request and where completion will be
@@ -68,6 +75,9 @@ API
6875
6976
Call :c:func:`uv_freeaddrinfo` to free the addrinfo structure.
7077
78+
.. versionchanged:: 1.3.0 the callback parameter is now allowed to be NULL,
79+
in which case the request will run **synchronously**.
80+
7181
.. c:function:: void uv_freeaddrinfo(struct addrinfo* ai)
7282
7383
Free the struct addrinfo. Passing NULL is allowed and is a no-op.
@@ -80,4 +90,7 @@ API
8090
callback will get called sometime in the future with the lookup result.
8191
Consult `man -s 3 getnameinfo` for more details.
8292
93+
.. versionchanged:: 1.3.0 the callback parameter is now allowed to be NULL,
94+
in which case the request will run **synchronously**.
95+
8396
.. seealso:: The :c:type:`uv_req_t` API functions also apply.

deps/uv/docs/src/fs_event.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,22 @@ API
8787
Start the handle with the given callback, which will watch the specified
8888
`path` for changes. `flags` can be an ORed mask of :c:type:`uv_fs_event_flags`.
8989
90+
.. note:: Currently the only supported flag is ``UV_FS_EVENT_RECURSIVE`` and
91+
only on OSX.
92+
9093
.. c:function:: int uv_fs_event_stop(uv_fs_event_t* handle)
9194
9295
Stop the handle, the callback will no longer be called.
9396
94-
.. c:function:: int uv_fs_event_getpath(uv_fs_event_t* handle, char* buf, size_t* len)
97+
.. c:function:: int uv_fs_event_getpath(uv_fs_event_t* handle, char* buffer, size_t* size)
9598
9699
Get the path being monitored by the handle. The buffer must be preallocated
97100
by the user. Returns 0 on success or an error code < 0 in case of failure.
98-
On success, `buf` will contain the path and `len` its length. If the buffer
101+
On success, `buffer` will contain the path and `size` its length. If the buffer
99102
is not big enough UV_ENOBUFS will be returned and len will be set to the
100103
required size.
101104
105+
.. versionchanged:: 1.3.0 the returned length no longer includes the terminating null byte,
106+
and the buffer is not null terminated.
107+
102108
.. seealso:: The :c:type:`uv_handle_t` API functions also apply.

deps/uv/docs/src/fs_poll.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@ API
5858
5959
Stop the handle, the callback will no longer be called.
6060
61-
.. c:function:: int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buf, size_t* len)
61+
.. c:function:: int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buffer, size_t* size)
6262
6363
Get the path being monitored by the handle. The buffer must be preallocated
6464
by the user. Returns 0 on success or an error code < 0 in case of failure.
65-
On success, `buf` will contain the path and `len` its length. If the buffer
65+
On success, `buffer` will contain the path and `size` its length. If the buffer
6666
is not big enough UV_ENOBUFS will be returned and len will be set to the
6767
required size.
6868
69+
.. versionchanged:: 1.3.0 the returned length no longer includes the terminating null byte,
70+
and the buffer is not null terminated.
71+
6972
.. seealso:: The :c:type:`uv_handle_t` API functions also apply.

deps/uv/docs/src/loop.rst

+6
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ API
8080
Returns the initialized default loop. It may return NULL in case of
8181
allocation failure.
8282
83+
This function is just a convenient way for having a global loop throughout
84+
an application, the default loop is in no way different than the ones
85+
initialized with :c:func:`uv_loop_init`. As such, the default loop can (and
86+
should) be closed with :c:func:`uv_loop_close` so the resources associated
87+
with it are freed.
88+
8389
.. c:function:: int uv_run(uv_loop_t* loop, uv_run_mode mode)
8490
8591
This function runs the event loop. It will act differently depending on the

deps/uv/docs/src/pipe.rst

+17-2
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,30 @@ API
5656
Paths on Unix get truncated to ``sizeof(sockaddr_un.sun_path)`` bytes, typically between
5757
92 and 108 bytes.
5858
59-
.. c:function:: int uv_pipe_getsockname(const uv_pipe_t* handle, char* buf, size_t* len)
59+
.. c:function:: int uv_pipe_getsockname(const uv_pipe_t* handle, char* buffer, size_t* size)
6060
6161
Get the name of the Unix domain socket or the named pipe.
6262
63-
A preallocated buffer must be provided. The len parameter holds the length
63+
A preallocated buffer must be provided. The size parameter holds the length
6464
of the buffer and it's set to the number of bytes written to the buffer on
6565
output. If the buffer is not big enough ``UV_ENOBUFS`` will be returned and
6666
len will contain the required size.
6767
68+
.. versionchanged:: 1.3.0 the returned length no longer includes the terminating null byte,
69+
and the buffer is not null terminated.
70+
71+
.. c:function:: int uv_pipe_getpeername(const uv_pipe_t* handle, char* buffer, size_t* size)
72+
73+
Get the name of the Unix domain socket or the named pipe to which the handle
74+
is connected.
75+
76+
A preallocated buffer must be provided. The size parameter holds the length
77+
of the buffer and it's set to the number of bytes written to the buffer on
78+
output. If the buffer is not big enough ``UV_ENOBUFS`` will be returned and
79+
len will contain the required size.
80+
81+
.. versionadded:: 1.3.0
82+
6883
.. c:function:: void uv_pipe_pending_instances(uv_pipe_t* handle, int count)
6984
7085
Set the number of pending pipe instance handles when the pipe server is

deps/uv/docs/src/poll.rst

+4
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,15 @@ API
7070
7171
Initialize the handle using a file descriptor.
7272
73+
.. versionchanged:: 1.2.2 the file descriptor is set to non-blocking mode.
74+
7375
.. c:function:: int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle, uv_os_sock_t socket)
7476
7577
Initialize the handle using a socket descriptor. On Unix this is identical
7678
to :c:func:`uv_poll_init`. On windows it takes a SOCKET handle.
7779
80+
.. versionchanged:: 1.2.2 the socket is set to non-blocking mode.
81+
7882
.. c:function:: int uv_poll_start(uv_poll_t* handle, int events, uv_poll_cb cb)
7983
8084
Starts polling the file descriptor. `events` is a bitmask consisting made up

deps/uv/docs/src/threadpool.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ Its default size is 4, but it can be changed at startup time by setting the
1212
``UV_THREADPOOL_SIZE`` environment variable to any value (the absolute maximum
1313
is 128).
1414

15-
The threadpool is global and shared across all event loops.
15+
The threadpool is global and shared across all event loops. When a particular
16+
function makes use of the threadpool (i.e. when using :c:func:`uv_queue_work`)
17+
libuv preallocates and initializes the maximum number of threads allowed by
18+
``UV_THREADPOOL_SIZE``. This causes a relatively minor memory overhead
19+
(~1MB for 128 threads) but increases the performance of threading at runtime.
1620

1721

1822
Data types

deps/uv/include/uv-unix.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ typedef struct {
326326
struct addrinfo* hints; \
327327
char* hostname; \
328328
char* service; \
329-
struct addrinfo* res; \
329+
struct addrinfo* addrinfo; \
330330
int retcode;
331331

332332
#define UV_GETNAMEINFO_PRIVATE_FIELDS \

deps/uv/include/uv-version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
*/
3232

3333
#define UV_VERSION_MAJOR 1
34-
#define UV_VERSION_MINOR 2
35-
#define UV_VERSION_PATCH 1
34+
#define UV_VERSION_MINOR 3
35+
#define UV_VERSION_PATCH 0
3636
#define UV_VERSION_IS_RELEASE 1
3737
#define UV_VERSION_SUFFIX ""
3838

deps/uv/include/uv-win.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,11 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
565565
void* alloc; \
566566
WCHAR* node; \
567567
WCHAR* service; \
568-
struct addrinfoW* hints; \
569-
struct addrinfoW* res; \
568+
/* The addrinfoW field is used to store a pointer to the hints, and */ \
569+
/* later on to store the result of GetAddrInfoW. The final result will */ \
570+
/* be converted to struct addrinfo* and stored in the addrinfo field. */ \
571+
struct addrinfoW* addrinfow; \
572+
struct addrinfo* addrinfo; \
570573
int retcode;
571574

572575
#define UV_GETNAMEINFO_PRIVATE_FIELDS \

deps/uv/include/uv.h

+11-5
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,11 @@ UV_EXTERN void uv_pipe_connect(uv_connect_t* req,
675675
const char* name,
676676
uv_connect_cb cb);
677677
UV_EXTERN int uv_pipe_getsockname(const uv_pipe_t* handle,
678-
char* buf,
679-
size_t* len);
678+
char* buffer,
679+
size_t* size);
680+
UV_EXTERN int uv_pipe_getpeername(const uv_pipe_t* handle,
681+
char* buffer,
682+
size_t* size);
680683
UV_EXTERN void uv_pipe_pending_instances(uv_pipe_t* handle, int count);
681684
UV_EXTERN int uv_pipe_pending_count(uv_pipe_t* handle);
682685
UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle);
@@ -772,6 +775,7 @@ struct uv_getaddrinfo_s {
772775
UV_REQ_FIELDS
773776
/* read-only */
774777
uv_loop_t* loop;
778+
/* struct addrinfo* addrinfo is marked as private, but it really isn't. */
775779
UV_GETADDRINFO_PRIVATE_FIELDS
776780
};
777781

@@ -1260,7 +1264,9 @@ UV_EXTERN int uv_fs_poll_start(uv_fs_poll_t* handle,
12601264
const char* path,
12611265
unsigned int interval);
12621266
UV_EXTERN int uv_fs_poll_stop(uv_fs_poll_t* handle);
1263-
UV_EXTERN int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buf, size_t* len);
1267+
UV_EXTERN int uv_fs_poll_getpath(uv_fs_poll_t* handle,
1268+
char* buffer,
1269+
size_t* size);
12641270

12651271

12661272
struct uv_signal_s {
@@ -1317,8 +1323,8 @@ UV_EXTERN int uv_fs_event_start(uv_fs_event_t* handle,
13171323
unsigned int flags);
13181324
UV_EXTERN int uv_fs_event_stop(uv_fs_event_t* handle);
13191325
UV_EXTERN int uv_fs_event_getpath(uv_fs_event_t* handle,
1320-
char* buf,
1321-
size_t* len);
1326+
char* buffer,
1327+
size_t* size);
13221328

13231329
UV_EXTERN int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr);
13241330
UV_EXTERN int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr);

deps/uv/src/fs-poll.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -125,26 +125,26 @@ int uv_fs_poll_stop(uv_fs_poll_t* handle) {
125125
}
126126

127127

128-
int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buf, size_t* len) {
128+
int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buffer, size_t* size) {
129129
struct poll_ctx* ctx;
130130
size_t required_len;
131131

132132
if (!uv__is_active(handle)) {
133-
*len = 0;
133+
*size = 0;
134134
return UV_EINVAL;
135135
}
136136

137137
ctx = handle->poll_ctx;
138138
assert(ctx != NULL);
139139

140-
required_len = strlen(ctx->path) + 1;
141-
if (required_len > *len) {
142-
*len = required_len;
140+
required_len = strlen(ctx->path);
141+
if (required_len > *size) {
142+
*size = required_len;
143143
return UV_ENOBUFS;
144144
}
145145

146-
memcpy(buf, ctx->path, required_len);
147-
*len = required_len;
146+
memcpy(buffer, ctx->path, required_len);
147+
*size = required_len;
148148

149149
return 0;
150150
}

deps/uv/src/unix/aix.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#define RDWR_BUF_SIZE 4096
6262
#define EQ(a,b) (strcmp(a,b) == 0)
6363

64-
int uv__platform_loop_init(uv_loop_t* loop, int default_loop) {
64+
int uv__platform_loop_init(uv_loop_t* loop) {
6565
loop->fs_fd = -1;
6666

6767
/* Passing maxfd of -1 should mean the limit is determined

deps/uv/src/unix/darwin-proctitle.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <dlfcn.h>
2222
#include <errno.h>
2323
#include <stdlib.h>
24+
#include <string.h>
2425

2526
#include <TargetConditionals.h>
2627

@@ -36,7 +37,9 @@ static int uv__pthread_setname_np(const char* name) {
3637
int err;
3738

3839
/* pthread_setname_np() first appeared in OS X 10.6 and iOS 3.2. */
39-
*(void **)(&dynamic_pthread_setname_np) = dlsym(RTLD_DEFAULT, "pthread_setname_np");
40+
*(void **)(&dynamic_pthread_setname_np) =
41+
dlsym(RTLD_DEFAULT, "pthread_setname_np");
42+
4043
if (dynamic_pthread_setname_np == NULL)
4144
return -ENOSYS;
4245

deps/uv/src/unix/darwin.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include <unistd.h> /* sysconf */
3838

3939

40-
int uv__platform_loop_init(uv_loop_t* loop, int default_loop) {
40+
int uv__platform_loop_init(uv_loop_t* loop) {
4141
loop->cf_state = NULL;
4242

4343
if (uv__kqueue_init(loop))

deps/uv/src/unix/freebsd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
static char *process_title;
5959

6060

61-
int uv__platform_loop_init(uv_loop_t* loop, int default_loop) {
61+
int uv__platform_loop_init(uv_loop_t* loop) {
6262
return uv__kqueue_init(loop);
6363
}
6464

0 commit comments

Comments
 (0)