Skip to content

Commit

Permalink
deps: update uv to v0.11.25
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed May 1, 2014
1 parent d0fc553 commit 3d3d48d
Show file tree
Hide file tree
Showing 30 changed files with 294 additions and 108 deletions.
3 changes: 2 additions & 1 deletion deps/uv/.mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ Fedor Indutny <[email protected]> <[email protected]>
Frank Denis <[email protected]>
Isaac Z. Schlueter <[email protected]>
Justin Venus <[email protected]> <[email protected]>
Keno Fischer <[email protected]> <[email protected]>
Keno Fischer <[email protected]> <[email protected]>
Keno Fischer <[email protected]> <[email protected]>
Maciej Małecki <[email protected]> <[email protected]>
Marc Schlaich <[email protected]> <[email protected]>
Rasmus Christian Pedersen <[email protected]>
Rasmus Pedersen <[email protected]> <[email protected]>
Robert Mustacchi <[email protected]> <[email protected]>
Ryan Dahl <[email protected]> <[email protected]>
Expand Down
34 changes: 6 additions & 28 deletions deps/uv/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ Marc Schlaich <[email protected]>
Brian Mazza <[email protected]>
Elliot Saba <[email protected]>
Ben Kelly <[email protected]>
Kristian Evensen <[email protected]>
Nils Maier <[email protected]>
Nicholas Vavilov <[email protected]>
Miroslav Bajtoš <[email protected]>
Expand Down Expand Up @@ -111,48 +110,23 @@ Yazhong Liu <[email protected]>
Sam Roberts <[email protected]>
River Tarnell <[email protected]>
Nathan Sweet <[email protected]>
Alex Crichton <[email protected]>
Luca Bruno <[email protected]>
Trevor Norris <[email protected]>
Oguz Bastemur <[email protected]>
Dylan Cali <[email protected]>
Austin Foxley <[email protected]>
Benjamin Saunders <[email protected]>
Geoffry Song <[email protected]>
Rasmus Pedersen <[email protected]>
Rasmus Christian Pedersen <[email protected]>
William Light <[email protected]>
Oleg Efimov <[email protected]>
Lars Gierth <[email protected]>
rcp <[email protected]>
Alexis Campailla <[email protected]>
Rasmus Christian Pedersen <[email protected]>
Justin Venus <[email protected]>
Ben Kelly <[email protected]>
Kristian Evensen <[email protected]>
Sean Silva <[email protected]>
Linus Mårtensson <[email protected]>
Navaneeth Kedaram Nambiathan <[email protected]>
Brent Cook <[email protected]>
Brian Kaisner <[email protected]>
Reini Urban <[email protected]>
Maks Naumov <[email protected]>
Sean Farrell <[email protected]>
Christoph Iserlohn <[email protected]>
Steven Kabbes <[email protected]>
Tenor Biel <[email protected]>
Andrej Manduch <[email protected]>
Joshua Neuheisel <[email protected]>
Yorkie <[email protected]>
Sam Roberts <[email protected]>
River Tarnell <[email protected]>
Nathan Sweet <[email protected]>
Dylan Cali <[email protected]>
Austin Foxley <[email protected]>
Geoffry Song <[email protected]>
Benjamin Saunders <[email protected]>
Rasmus Pedersen <[email protected]>
William Light <[email protected]>
Oleg Efimov <[email protected]>
Lars Gierth <[email protected]>
StarWing <[email protected]>
thierry-FreeBSD <[email protected]>
Isaiah Norton <[email protected]>
Expand All @@ -161,3 +135,7 @@ David Capello <[email protected]>
Paul Tan <[email protected]>
Javier Hernández <[email protected]>
Tonis Tiigi <[email protected]>
Norio Kobota <[email protected]>
李港平 <[email protected]>
Chernyshev Viacheslav <[email protected]>
Stephen von Takach <[email protected]>
40 changes: 39 additions & 1 deletion deps/uv/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
2014.04.07, Version 0.11.23 (Unstable)
2014.05.02, Version 0.11.25 (Unstable)

Changes since version 0.11.24:

* osx: pass const handle pointer to uv___stream_fd (Chernyshev Viacheslav)

* unix, windows: pass const handle ptr to uv_tcp_get*name (Chernyshev
Viacheslav)

* common: pass const sockaddr ptr to uv_ip*_name (Chernyshev Viacheslav)

* unix, windows: validate flags on uv_udp|tcp_bind (Saúl Ibarra Corretgé)

* unix: handle case when addr is not initialized after recvmsg (Saúl Ibarra
Corretgé)

* unix, windows: uv_now constness (Rasmus Pedersen)


2014.04.15, Version 0.11.24 (Unstable), ed948c29f6e8c290f79325a6f0bc9ef35bcde644

Changes since version 0.11.23:

* linux: reduce file descriptor count of async pipe (Ben Noordhuis)

* sunos: support IPv6 qualified link-local addresses (Saúl Ibarra Corretgé)

* windows: fix opening of read-only stdin pipes (Alexis Campailla)

* windows: Fix an infinite loop in uv_spawn (Alex Crichton)

* windows: fix console signal handler refcount (李港平)

* inet: allow scopeid in uv_inet_pton (Fedor Indutny)

* win: always leave crit section in get_proc_title (Fedor Indutny)


2014.04.07, Version 0.11.23 (Unstable), e54de537efcacd593f36fcaaf8b4cb9e64313275

Changes since version 0.11.22:

Expand Down
3 changes: 2 additions & 1 deletion deps/uv/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AC_PREREQ(2.57)
AC_INIT([libuv], [0.11.23], [https://github.com/joyent/libuv/issues])
AC_INIT([libuv], [0.11.25], [https://github.com/joyent/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects] UV_EXTRA_AUTOMAKE_FLAGS)
AC_CANONICAL_HOST
AC_ENABLE_SHARED
Expand Down
2 changes: 2 additions & 0 deletions deps/uv/include/uv-sunos.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@

#endif /* defined(PORT_SOURCE_FILE) */

#define UV_PLATFORM_HAS_IP6_LINK_LOCAL_ADDRESS

#endif /* UV_SUNOS_H */
2 changes: 1 addition & 1 deletion deps/uv/include/uv-unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ typedef struct {
uv_buf_t bufsml[4]; \

#define UV_HANDLE_PRIVATE_FIELDS \
int flags; \
uv_handle_t* next_closing; \
unsigned int flags; \

#define UV_STREAM_PRIVATE_FIELDS \
uv_connect_t *connect_req; \
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/include/uv-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#define UV_VERSION_MAJOR 0
#define UV_VERSION_MINOR 11
#define UV_VERSION_PATCH 23
#define UV_VERSION_PATCH 25
#define UV_VERSION_IS_RELEASE 1

#endif /* UV_VERSION_H */
3 changes: 2 additions & 1 deletion deps/uv/include/uv-win.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
void* queue[2]; \
int queue_len; \
} pending_ipc_info; \
uv_write_t* non_overlapped_writes_tail;
uv_write_t* non_overlapped_writes_tail; \
void* reserved;

#define UV_PIPE_PRIVATE_FIELDS \
HANDLE handle; \
Expand Down
25 changes: 13 additions & 12 deletions deps/uv/include/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ UV_EXTERN void uv_update_time(uv_loop_t*);
*
* Use uv_hrtime() if you need sub-millisecond granularity.
*/
UV_EXTERN uint64_t uv_now(uv_loop_t*);
UV_EXTERN uint64_t uv_now(const uv_loop_t*);

/*
* Get backend file descriptor. Only kqueue, epoll and event ports are
Expand Down Expand Up @@ -695,9 +695,8 @@ UV_EXTERN int uv_write2(uv_write_t* req,
* Same as `uv_write()`, but won't queue write request if it can't be completed
* immediately.
* Will return either:
* - positive number of bytes written
* - zero - if queued write is needed
* - negative error code
* - >= 0: number of bytes written (can be less than the supplied buffer size)
* - < 0: negative error code
*/
UV_EXTERN int uv_try_write(uv_stream_t* handle,
const uv_buf_t bufs[],
Expand Down Expand Up @@ -809,10 +808,12 @@ enum uv_tcp_flags {
UV_EXTERN int uv_tcp_bind(uv_tcp_t* handle,
const struct sockaddr* addr,
unsigned int flags);
UV_EXTERN int uv_tcp_getsockname(uv_tcp_t* handle, struct sockaddr* name,
int* namelen);
UV_EXTERN int uv_tcp_getpeername(uv_tcp_t* handle, struct sockaddr* name,
int* namelen);
UV_EXTERN int uv_tcp_getsockname(const uv_tcp_t* handle,
struct sockaddr* name,
int* namelen);
UV_EXTERN int uv_tcp_getpeername(const uv_tcp_t* handle,
struct sockaddr* name,
int* namelen);

/*
* Establish an IPv4 or IPv6 TCP connection. Provide an initialized TCP handle
Expand Down Expand Up @@ -873,8 +874,8 @@ typedef void (*uv_udp_send_cb)(uv_udp_send_t* req, int status);
* discard or repurpose the read buffer.
* < 0 if a transmission error was detected.
* buf uv_buf_t with the received data.
* addr struct sockaddr_in or struct sockaddr_in6.
* Valid for the duration of the callback only.
* addr struct sockaddr* containing the address of the sender.
* Can be NULL. Valid for the duration of the callback only.
* flags One or more OR'ed UV_UDP_* constants.
* Right now only UV_UDP_PARTIAL is used.
*/
Expand Down Expand Up @@ -2055,8 +2056,8 @@ 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);

/* Convert binary addresses to strings */
UV_EXTERN int uv_ip4_name(struct sockaddr_in* src, char* dst, size_t size);
UV_EXTERN int uv_ip6_name(struct sockaddr_in6* src, char* dst, size_t size);
UV_EXTERN int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size);
UV_EXTERN int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size);

/* Cross-platform IPv6-capable implementation of the 'standard' inet_ntop */
/* and inet_pton functions. On success they return 0. If an error */
Expand Down
16 changes: 14 additions & 2 deletions deps/uv/src/inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static int inet_pton6(const char *src, unsigned char *dst) {
curtok = src;
seen_xdigits = 0;
val = 0;
while ((ch = *src++) != '\0') {
while ((ch = *src++) != '\0' && ch != '%') {
const char *pch;

if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
Expand Down Expand Up @@ -256,7 +256,19 @@ static int inet_pton6(const char *src, unsigned char *dst) {
continue;
}
if (ch == '.' && ((tp + sizeof(struct in_addr)) <= endp)) {
int err = inet_pton4(curtok, tp);
int err;

/* Scope id present, parse ipv4 addr without it */
pch = strchr(curtok, '%');
if (pch != NULL) {
char tmp[sizeof "255.255.255.255"];

memcpy(tmp, curtok, pch - curtok);
curtok = tmp;
src = pch;
}

err = inet_pton4(curtok, tp);
if (err == 0) {
tp += sizeof(struct in_addr);
seen_xdigits = 0;
Expand Down
34 changes: 28 additions & 6 deletions deps/uv/src/unix/async.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "internal.h"

#include <errno.h>
#include <stdio.h> /* snprintf() */
#include <assert.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -217,8 +218,28 @@ int uv__async_start(uv_loop_t* loop, struct uv__async* wa, uv__async_cb cb) {
pipefd[0] = err;
pipefd[1] = -1;
}
else if (err == -ENOSYS)
else if (err == -ENOSYS) {
err = uv__make_pipe(pipefd, UV__F_NONBLOCK);
#if defined(__linux__)
/* Save a file descriptor by opening one of the pipe descriptors as
* read/write through the procfs. That file descriptor can then
* function as both ends of the pipe.
*/
if (err == 0) {
char buf[32];
int fd;

snprintf(buf, sizeof(buf), "/proc/self/fd/%d", pipefd[0]);
fd = uv__open_cloexec(buf, O_RDWR);
if (fd != -1) {
uv__close(pipefd[0]);
uv__close(pipefd[1]);
pipefd[0] = fd;
pipefd[1] = fd;
}
}
#endif
}

if (err < 0)
return err;
Expand All @@ -236,14 +257,15 @@ void uv__async_stop(uv_loop_t* loop, struct uv__async* wa) {
if (wa->io_watcher.fd == -1)
return;

uv__io_stop(loop, &wa->io_watcher, UV__POLLIN);
uv__close(wa->io_watcher.fd);
wa->io_watcher.fd = -1;

if (wa->wfd != -1) {
uv__close(wa->wfd);
if (wa->wfd != wa->io_watcher.fd)
uv__close(wa->wfd);
wa->wfd = -1;
}

uv__io_stop(loop, &wa->io_watcher, UV__POLLIN);
uv__close(wa->io_watcher.fd);
wa->io_watcher.fd = -1;
}


Expand Down
4 changes: 2 additions & 2 deletions deps/uv/src/unix/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ void uv__udp_finish_close(uv_udp_t* handle);
uv_handle_type uv__handle_type(int fd);

#if defined(__APPLE__)
int uv___stream_fd(uv_stream_t* handle);
#define uv__stream_fd(handle) (uv___stream_fd((uv_stream_t*) (handle)))
int uv___stream_fd(const uv_stream_t* handle);
#define uv__stream_fd(handle) (uv___stream_fd((const uv_stream_t*) (handle)))
#else
#define uv__stream_fd(handle) ((handle)->io_watcher.fd)
#endif /* defined(__APPLE__) */
Expand Down
4 changes: 2 additions & 2 deletions deps/uv/src/unix/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,8 +1482,8 @@ int uv_is_writable(const uv_stream_t* stream) {


#if defined(__APPLE__)
int uv___stream_fd(uv_stream_t* handle) {
uv__stream_select_t* s;
int uv___stream_fd(const uv_stream_t* handle) {
const uv__stream_select_t* s;

assert(handle->type == UV_TCP ||
handle->type == UV_TTY ||
Expand Down
8 changes: 6 additions & 2 deletions deps/uv/src/unix/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ int uv__tcp_bind(uv_tcp_t* tcp,
int err;
int on;

/* Cannot set IPv6-only mode on non-IPv6 socket. */
if ((flags & UV_TCP_IPV6ONLY) && addr->sa_family != AF_INET6)
return -EINVAL;

err = maybe_new_socket(tcp,
addr->sa_family,
UV_STREAM_READABLE | UV_STREAM_WRITABLE);
Expand Down Expand Up @@ -158,7 +162,7 @@ int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock) {
}


int uv_tcp_getsockname(uv_tcp_t* handle,
int uv_tcp_getsockname(const uv_tcp_t* handle,
struct sockaddr* name,
int* namelen) {
socklen_t socklen;
Expand All @@ -180,7 +184,7 @@ int uv_tcp_getsockname(uv_tcp_t* handle,
}


int uv_tcp_getpeername(uv_tcp_t* handle,
int uv_tcp_getpeername(const uv_tcp_t* handle,
struct sockaddr* name,
int* namelen) {
socklen_t socklen;
Expand Down
13 changes: 7 additions & 6 deletions deps/uv/src/unix/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,17 @@ static void uv__udp_recvmsg(uv_loop_t* loop,
handle->recv_cb(handle, -errno, &buf, NULL, 0);
}
else {
flags = 0;
const struct sockaddr *addr;
if (h.msg_namelen == 0)
addr = NULL;
else
addr = (const struct sockaddr*) &peer;

flags = 0;
if (h.msg_flags & MSG_TRUNC)
flags |= UV_UDP_PARTIAL;

handle->recv_cb(handle,
nread,
&buf,
(const struct sockaddr*) &peer,
flags);
handle->recv_cb(handle, nread, &buf, addr, flags);
}
}
/* recv_cb callback may decide to pause or close the handle */
Expand Down
Loading

0 comments on commit 3d3d48d

Please sign in to comment.