Skip to content

Commit

Permalink
deps: update libuv to 1.3.0
Browse files Browse the repository at this point in the history
PR-URL: #644
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
saghul authored and bnoordhuis committed Jan 28, 2015
1 parent 6ad236c commit 097fde7
Show file tree
Hide file tree
Showing 46 changed files with 589 additions and 322 deletions.
2 changes: 2 additions & 0 deletions deps/uv/AUTHORS
Expand Up @@ -178,3 +178,5 @@ Kenneth Perry <thothonegan@gmail.com>
John Marino <marino@FreeBSD.org>
Alexey Melnichuk <mimir@newmail.ru>
Johan Bergström <bugs@bergstroem.nu>
Alex Mo <almosnow@gmail.com>
Luis Martinez de Bartolome <lasote@gmail.com>
48 changes: 48 additions & 0 deletions deps/uv/ChangeLog
@@ -1,3 +1,51 @@
2015.01.29, Version 1.3.0 (Stable), 165685b2a9a42cf96501d79cd6d48a18aaa16e3b

Changes since version 1.2.1:

* unix, windows: set non-block mode in uv_poll_init (Saúl Ibarra Corretgé)

* doc: clarify which flags are supported in uv_fs_event_start (Saúl Ibarra
Corretgé)

* win,unix: move loop functions which have identical implementations (Andrius
Bentkus)

* doc: explain how the threadpool is allocated (Alex Mo)

* doc: clarify uv_default_loop (Saúl Ibarra Corretgé)

* unix: fix implicit declaration compiler warning (Ben Noordhuis)

* unix: fix long line introduced in commit 94e628fa (Ben Noordhuis)

* unix, win: add synchronous uv_get{addr,name}info (Saúl Ibarra Corretgé)

* linux: fix epoll_pwait() regression with < 2.6.19 (Ben Noordhuis)

* build: compile -D_GNU_SOURCE on linux (Ben Noordhuis)

* build: use -fvisibility=hidden in autotools build (Ben Noordhuis)

* fs, pipe: no trailing terminator in exact sized buffers (Andrius Bentkus)

* style: rename buf to buffer and len to size for consistency (Andrius Bentkus)

* test: fix test-spawn on MinGW32 (Luis Martinez de Bartolome)

* win, pipe: fix assertion when destroying timer (Andrius Bentkus)

* win, unix: add pipe_peername implementation (Andrius Bentkus)


2015.01.29, Version 0.10.33 (Stable), 7a2253d33ad8215a26c1b34f1952aee7242dd687

Changes since version 0.10.32:

* linux: fix epoll_pwait() regression with < 2.6.19 (Ben Noordhuis)

* test: back-port uv_loop_configure() test (Ben Noordhuis)


2015.01.15, Version 1.2.1 (Stable), 4ca78e989062a1099dc4b9ad182a98e8374134b1

Changes since version 1.2.0:
Expand Down
1 change: 1 addition & 0 deletions deps/uv/Makefile.am
Expand Up @@ -303,6 +303,7 @@ endif

if LINUX
include_HEADERS += include/uv-linux.h
libuv_la_CFLAGS += -D_GNU_SOURCE
libuv_la_SOURCES += src/unix/linux-core.c \
src/unix/linux-inotify.c \
src/unix/linux-syscalls.c \
Expand Down
3 changes: 2 additions & 1 deletion deps/uv/configure.ac
Expand Up @@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AC_PREREQ(2.57)
AC_INIT([libuv], [1.2.1], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.3.0], [https://github.com/libuv/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4])
Expand All @@ -24,6 +24,7 @@ AC_ENABLE_SHARED
AC_ENABLE_STATIC
AC_PROG_CC
AM_PROG_CC_C_O
CC_CHECK_CFLAGS_APPEND([-fvisibility=hidden])
CC_CHECK_CFLAGS_APPEND([-g])
CC_CHECK_CFLAGS_APPEND([-std=gnu89])
CC_CHECK_CFLAGS_APPEND([-pedantic])
Expand Down
13 changes: 13 additions & 0 deletions deps/uv/docs/src/dns.rst
Expand Up @@ -39,6 +39,13 @@ Public members
Loop that started this getaddrinfo request and where completion will be
reported. Readonly.

.. c:member:: struct addrinfo* uv_getaddrinfo_t.addrinfo
Pointer to a `struct addrinfo` containing the result. Must be freed by the user
with :c:func:`uv_freeaddrinfo`.

.. versionchanged:: 1.3.0 the field is declared as public.

.. c:member:: uv_loop_t* uv_getnameinfo_t.loop
Loop that started this getnameinfo request and where completion will be
Expand Down Expand Up @@ -68,6 +75,9 @@ API
Call :c:func:`uv_freeaddrinfo` to free the addrinfo structure.
.. versionchanged:: 1.3.0 the callback parameter is now allowed to be NULL,
in which case the request will run **synchronously**.
.. c:function:: void uv_freeaddrinfo(struct addrinfo* ai)
Free the struct addrinfo. Passing NULL is allowed and is a no-op.
Expand All @@ -80,4 +90,7 @@ API
callback will get called sometime in the future with the lookup result.
Consult `man -s 3 getnameinfo` for more details.
.. versionchanged:: 1.3.0 the callback parameter is now allowed to be NULL,
in which case the request will run **synchronously**.
.. seealso:: The :c:type:`uv_req_t` API functions also apply.
10 changes: 8 additions & 2 deletions deps/uv/docs/src/fs_event.rst
Expand Up @@ -87,16 +87,22 @@ API
Start the handle with the given callback, which will watch the specified
`path` for changes. `flags` can be an ORed mask of :c:type:`uv_fs_event_flags`.
.. note:: Currently the only supported flag is ``UV_FS_EVENT_RECURSIVE`` and
only on OSX.
.. c:function:: int uv_fs_event_stop(uv_fs_event_t* handle)
Stop the handle, the callback will no longer be called.
.. c:function:: int uv_fs_event_getpath(uv_fs_event_t* handle, char* buf, size_t* len)
.. c:function:: int uv_fs_event_getpath(uv_fs_event_t* handle, char* buffer, size_t* size)
Get the path being monitored by the handle. The buffer must be preallocated
by the user. Returns 0 on success or an error code < 0 in case of failure.
On success, `buf` will contain the path and `len` its length. If the buffer
On success, `buffer` will contain the path and `size` its length. If the buffer
is not big enough UV_ENOBUFS will be returned and len will be set to the
required size.
.. versionchanged:: 1.3.0 the returned length no longer includes the terminating null byte,
and the buffer is not null terminated.
.. seealso:: The :c:type:`uv_handle_t` API functions also apply.
7 changes: 5 additions & 2 deletions deps/uv/docs/src/fs_poll.rst
Expand Up @@ -58,12 +58,15 @@ API
Stop the handle, the callback will no longer be called.
.. c:function:: int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buf, size_t* len)
.. c:function:: int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buffer, size_t* size)
Get the path being monitored by the handle. The buffer must be preallocated
by the user. Returns 0 on success or an error code < 0 in case of failure.
On success, `buf` will contain the path and `len` its length. If the buffer
On success, `buffer` will contain the path and `size` its length. If the buffer
is not big enough UV_ENOBUFS will be returned and len will be set to the
required size.
.. versionchanged:: 1.3.0 the returned length no longer includes the terminating null byte,
and the buffer is not null terminated.
.. seealso:: The :c:type:`uv_handle_t` API functions also apply.
6 changes: 6 additions & 0 deletions deps/uv/docs/src/loop.rst
Expand Up @@ -80,6 +80,12 @@ API
Returns the initialized default loop. It may return NULL in case of
allocation failure.
This function is just a convenient way for having a global loop throughout
an application, the default loop is in no way different than the ones
initialized with :c:func:`uv_loop_init`. As such, the default loop can (and
should) be closed with :c:func:`uv_loop_close` so the resources associated
with it are freed.
.. c:function:: int uv_run(uv_loop_t* loop, uv_run_mode mode)
This function runs the event loop. It will act differently depending on the
Expand Down
19 changes: 17 additions & 2 deletions deps/uv/docs/src/pipe.rst
Expand Up @@ -56,15 +56,30 @@ API
Paths on Unix get truncated to ``sizeof(sockaddr_un.sun_path)`` bytes, typically between
92 and 108 bytes.
.. c:function:: int uv_pipe_getsockname(const uv_pipe_t* handle, char* buf, size_t* len)
.. c:function:: int uv_pipe_getsockname(const uv_pipe_t* handle, char* buffer, size_t* size)
Get the name of the Unix domain socket or the named pipe.
A preallocated buffer must be provided. The len parameter holds the length
A preallocated buffer must be provided. The size parameter holds the length
of the buffer and it's set to the number of bytes written to the buffer on
output. If the buffer is not big enough ``UV_ENOBUFS`` will be returned and
len will contain the required size.
.. versionchanged:: 1.3.0 the returned length no longer includes the terminating null byte,
and the buffer is not null terminated.
.. c:function:: int uv_pipe_getpeername(const uv_pipe_t* handle, char* buffer, size_t* size)
Get the name of the Unix domain socket or the named pipe to which the handle
is connected.
A preallocated buffer must be provided. The size parameter holds the length
of the buffer and it's set to the number of bytes written to the buffer on
output. If the buffer is not big enough ``UV_ENOBUFS`` will be returned and
len will contain the required size.
.. versionadded:: 1.3.0
.. c:function:: void uv_pipe_pending_instances(uv_pipe_t* handle, int count)
Set the number of pending pipe instance handles when the pipe server is
Expand Down
4 changes: 4 additions & 0 deletions deps/uv/docs/src/poll.rst
Expand Up @@ -70,11 +70,15 @@ API
Initialize the handle using a file descriptor.
.. versionchanged:: 1.2.2 the file descriptor is set to non-blocking mode.
.. c:function:: int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle, uv_os_sock_t socket)
Initialize the handle using a socket descriptor. On Unix this is identical
to :c:func:`uv_poll_init`. On windows it takes a SOCKET handle.
.. versionchanged:: 1.2.2 the socket is set to non-blocking mode.
.. c:function:: int uv_poll_start(uv_poll_t* handle, int events, uv_poll_cb cb)
Starts polling the file descriptor. `events` is a bitmask consisting made up
Expand Down
6 changes: 5 additions & 1 deletion deps/uv/docs/src/threadpool.rst
Expand Up @@ -12,7 +12,11 @@ Its default size is 4, but it can be changed at startup time by setting the
``UV_THREADPOOL_SIZE`` environment variable to any value (the absolute maximum
is 128).

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


Data types
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/include/uv-unix.h
Expand Up @@ -326,7 +326,7 @@ typedef struct {
struct addrinfo* hints; \
char* hostname; \
char* service; \
struct addrinfo* res; \
struct addrinfo* addrinfo; \
int retcode;

#define UV_GETNAMEINFO_PRIVATE_FIELDS \
Expand Down
4 changes: 2 additions & 2 deletions deps/uv/include/uv-version.h
Expand Up @@ -31,8 +31,8 @@
*/

#define UV_VERSION_MAJOR 1
#define UV_VERSION_MINOR 2
#define UV_VERSION_PATCH 1
#define UV_VERSION_MINOR 3
#define UV_VERSION_PATCH 0
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX ""

Expand Down
7 changes: 5 additions & 2 deletions deps/uv/include/uv-win.h
Expand Up @@ -565,8 +565,11 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
void* alloc; \
WCHAR* node; \
WCHAR* service; \
struct addrinfoW* hints; \
struct addrinfoW* res; \
/* The addrinfoW field is used to store a pointer to the hints, and */ \
/* later on to store the result of GetAddrInfoW. The final result will */ \
/* be converted to struct addrinfo* and stored in the addrinfo field. */ \
struct addrinfoW* addrinfow; \
struct addrinfo* addrinfo; \
int retcode;

#define UV_GETNAMEINFO_PRIVATE_FIELDS \
Expand Down
16 changes: 11 additions & 5 deletions deps/uv/include/uv.h
Expand Up @@ -675,8 +675,11 @@ UV_EXTERN void uv_pipe_connect(uv_connect_t* req,
const char* name,
uv_connect_cb cb);
UV_EXTERN int uv_pipe_getsockname(const uv_pipe_t* handle,
char* buf,
size_t* len);
char* buffer,
size_t* size);
UV_EXTERN int uv_pipe_getpeername(const uv_pipe_t* handle,
char* buffer,
size_t* size);
UV_EXTERN void uv_pipe_pending_instances(uv_pipe_t* handle, int count);
UV_EXTERN int uv_pipe_pending_count(uv_pipe_t* handle);
UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle);
Expand Down Expand Up @@ -772,6 +775,7 @@ struct uv_getaddrinfo_s {
UV_REQ_FIELDS
/* read-only */
uv_loop_t* loop;
/* struct addrinfo* addrinfo is marked as private, but it really isn't. */
UV_GETADDRINFO_PRIVATE_FIELDS
};

Expand Down Expand Up @@ -1260,7 +1264,9 @@ UV_EXTERN int uv_fs_poll_start(uv_fs_poll_t* handle,
const char* path,
unsigned int interval);
UV_EXTERN int uv_fs_poll_stop(uv_fs_poll_t* handle);
UV_EXTERN int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buf, size_t* len);
UV_EXTERN int uv_fs_poll_getpath(uv_fs_poll_t* handle,
char* buffer,
size_t* size);


struct uv_signal_s {
Expand Down Expand Up @@ -1317,8 +1323,8 @@ UV_EXTERN int uv_fs_event_start(uv_fs_event_t* handle,
unsigned int flags);
UV_EXTERN int uv_fs_event_stop(uv_fs_event_t* handle);
UV_EXTERN int uv_fs_event_getpath(uv_fs_event_t* handle,
char* buf,
size_t* len);
char* buffer,
size_t* size);

UV_EXTERN int uv_ip4_addr(const char* ip, int port, struct sockaddr_in* addr);
UV_EXTERN int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr);
Expand Down
14 changes: 7 additions & 7 deletions deps/uv/src/fs-poll.c
Expand Up @@ -125,26 +125,26 @@ int uv_fs_poll_stop(uv_fs_poll_t* handle) {
}


int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buf, size_t* len) {
int uv_fs_poll_getpath(uv_fs_poll_t* handle, char* buffer, size_t* size) {
struct poll_ctx* ctx;
size_t required_len;

if (!uv__is_active(handle)) {
*len = 0;
*size = 0;
return UV_EINVAL;
}

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

required_len = strlen(ctx->path) + 1;
if (required_len > *len) {
*len = required_len;
required_len = strlen(ctx->path);
if (required_len > *size) {
*size = required_len;
return UV_ENOBUFS;
}

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

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/src/unix/aix.c
Expand Up @@ -61,7 +61,7 @@
#define RDWR_BUF_SIZE 4096
#define EQ(a,b) (strcmp(a,b) == 0)

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

/* Passing maxfd of -1 should mean the limit is determined
Expand Down
5 changes: 4 additions & 1 deletion deps/uv/src/unix/darwin-proctitle.c
Expand Up @@ -21,6 +21,7 @@
#include <dlfcn.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>

#include <TargetConditionals.h>

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

/* pthread_setname_np() first appeared in OS X 10.6 and iOS 3.2. */
*(void **)(&dynamic_pthread_setname_np) = dlsym(RTLD_DEFAULT, "pthread_setname_np");
*(void **)(&dynamic_pthread_setname_np) =
dlsym(RTLD_DEFAULT, "pthread_setname_np");

if (dynamic_pthread_setname_np == NULL)
return -ENOSYS;

Expand Down
2 changes: 1 addition & 1 deletion deps/uv/src/unix/darwin.c
Expand Up @@ -37,7 +37,7 @@
#include <unistd.h> /* sysconf */


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

if (uv__kqueue_init(loop))
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/src/unix/freebsd.c
Expand Up @@ -58,7 +58,7 @@
static char *process_title;


int uv__platform_loop_init(uv_loop_t* loop, int default_loop) {
int uv__platform_loop_init(uv_loop_t* loop) {
return uv__kqueue_init(loop);
}

Expand Down

0 comments on commit 097fde7

Please sign in to comment.