Skip to content

Commit

Permalink
deps: update uv to 0.11.18
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Jan 27, 2014
1 parent cc4b6e6 commit 64d33a7
Show file tree
Hide file tree
Showing 46 changed files with 385 additions and 94 deletions.
2 changes: 2 additions & 0 deletions deps/uv/.mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Bert Belder <[email protected]> <user@ChrUbuntu.(none)>
Brandon Philips <[email protected]> <[email protected]>
Brian White <[email protected]>
Brian White <[email protected]> <[email protected]>
Christoph Iserlohn <[email protected]>
Frank Denis <[email protected]>
Isaac Z. Schlueter <[email protected]>
Keno Fischer <[email protected]> <[email protected]>
Expand All @@ -19,4 +20,5 @@ Saúl Ibarra Corretgé <[email protected]>
Shigeki Ohtsu <[email protected]> <[email protected]>
Timothy J. Fontaine <[email protected]>
Yasuhiro Matsumoto <[email protected]>
Yazhong Liu <[email protected]>
Yuki Okumura <[email protected]>
8 changes: 5 additions & 3 deletions deps/uv/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,16 @@ Maks Naumov <[email protected]>
Sean Farrell <[email protected]>
Chris Bank <[email protected]>
Geert Jansen <[email protected]>
Christoph Iserlohn <[email protected]>
Steven Kabbes <[email protected]>
Alex Gaynor <[email protected]>
huxingyi <[email protected]>
ci-innoq <[email protected]>
Steven Kabbes <[email protected]>
Tenor Biel <[email protected]>
Andrej Manduch <[email protected]>
Joshua Neuheisel <[email protected]>
Alexis Campailla <[email protected]>
Yorkie <[email protected]>
Yazhong Liu <[email protected]>
Sam Roberts <[email protected]>
River Tarnell <[email protected]>
Nathan Sweet <[email protected]>
Trevor Norris <[email protected]>
43 changes: 42 additions & 1 deletion deps/uv/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,45 @@
2013.12.32, Version 0.11.17 (Unstable)
2014.01.23, Version 0.11.18 (Unstable)

Changes since version 0.11.17:

* osx: Fix a possible segfault in uv__io_poll (Alex Crichton)

* windows: improved handling of invalid FDs (Alexis Campailla)

* doc: adding ARCHS flag to OS X build command (Nathan Sweet)

* tcp: reveal bind-time errors before listen (Alexis Campailla)

* tcp: uv_tcp_dualstack() (Fedor Indutny)

* linux: relax assumption on /proc/stat parsing (Luca Bruno)

* openbsd: fix obvious bug in uv_cpu_info (Fedor Indutny)

* process: close stdio after dup2'ing it (Fedor Indutny)

* linux: move sscanf() out of the assert() (Trevor Norris)


2014.01.23, Version 0.10.23 (Stable)

Changes since version 0.10.22:

* linux: relax assumption on /proc/stat parsing (Luca Bruno)

* openbsd: fix obvious bug in uv_cpu_info (Fedor Indutny)

* process: close stdio after dup2'ing it (Fedor Indutny)


2014.01.08, Version 0.10.22 (Stable), f526c90eeff271d9323a9107b9a64a4671fd3103

Changes since version 0.10.21:

* windows: avoid assertion failure when pipe server is closed (Bert Belder)


2013.12.32, Version 0.11.17 (Unstable), 589c224d4c2e79fec65db01d361948f1e4976858

Changes since version 0.11.16:

Expand Down
9 changes: 8 additions & 1 deletion deps/uv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ Run:
Run:

$ ./gyp_uv.py -f xcode
$ xcodebuild -project uv.xcodeproj -configuration Release -target All
$ xcodebuild -ARCHS="x86_64" -project uv.xcodeproj \
-configuration Release -target All

Note to OS X users:

Make sure that you specify the architecture you wish to build for in the
"ARCHS" flag. You can specify more than one by delimiting with a space
(e.g. "x86_64 i386").

### Android

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

AC_PREREQ(2.57)
AC_INIT([libuv], [0.11.17], [https://github.com/joyent/libuv/issues])
AC_INIT([libuv], [0.11.18], [https://github.com/joyent/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects] UV_EXTRA_AUTOMAKE_FLAGS)
Expand Down
10 changes: 8 additions & 2 deletions deps/uv/include/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,11 @@ UV_EXTERN int uv_tcp_keepalive(uv_tcp_t* handle,
*/
UV_EXTERN int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable);

enum uv_tcp_flags {
/* Used with uv_tcp_bind, when an IPv6 address is used */
UV_TCP_IPV6ONLY = 1
};

/*
* Bind the handle to an address and port. `addr` should point to an
* initialized struct sockaddr_in or struct sockaddr_in6.
Expand All @@ -793,8 +798,9 @@ UV_EXTERN int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable);
* That is, a successful call to uv_tcp_bind() does not guarantee that
* the call to uv_listen() or uv_tcp_connect() will succeed as well.
*/
UV_EXTERN int uv_tcp_bind(uv_tcp_t* handle, const struct sockaddr* addr);

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,
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/samples/socks5-proxy/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static void do_bind(uv_getaddrinfo_t *req, int status, struct addrinfo *addrs) {
CHECK(0 == uv_tcp_init(loop, &sx->tcp_handle));

what = "uv_tcp_bind";
err = uv_tcp_bind(&sx->tcp_handle, &s.addr);
err = uv_tcp_bind(&sx->tcp_handle, &s.addr, 0);
if (err == 0) {
what = "uv_listen";
err = uv_listen((uv_stream_t *) &sx->tcp_handle, 128, on_connection);
Expand Down
7 changes: 5 additions & 2 deletions deps/uv/src/unix/linux-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,11 @@ static int read_times(unsigned int numcpus, uv_cpu_info_t* ci) {

/* skip "cpu<num> " marker */
{
unsigned int n = num;
unsigned int n;
int r = sscanf(buf, "cpu%u ", &n);
assert(r == 1);
(void) r; // silence build warning
for (len = sizeof("cpu0"); n /= 10; len++);
assert(sscanf(buf, "cpu%u ", &n) == 1 && n == num);
}

/* Line contains user, nice, system, idle, iowait, irq, softirq, steal,
Expand All @@ -664,6 +666,7 @@ static int read_times(unsigned int numcpus, uv_cpu_info_t* ci) {
ci[num++].cpu_times = ts;
}
fclose(fp);
assert(num == numcpus);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/src/unix/openbsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
uint64_t info[CPUSTATES];
char model[512];
int numcpus = 1;
static int which[] = {CTL_HW,HW_MODEL,0};
int which[] = {CTL_HW,HW_MODEL,0};
size_t size;
int i;
uv_cpu_info_t* cpu_info;
Expand Down
43 changes: 25 additions & 18 deletions deps/uv/src/unix/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,34 +287,41 @@ static void uv__process_child_init(const uv_process_options_t* options,
close_fd = pipes[fd][0];
use_fd = pipes[fd][1];

if (use_fd >= 0) {
if (close_fd != -1)
uv__close(close_fd);
}
else if (fd >= 3)
continue;
else {
/* redirect stdin, stdout and stderr to /dev/null even if UV_IGNORE is
* set
*/
use_fd = open("/dev/null", fd == 0 ? O_RDONLY : O_RDWR);

if (use_fd == -1) {
if (use_fd < 0) {
if (fd >= 3)
continue;
else {
/* redirect stdin, stdout and stderr to /dev/null even if UV_IGNORE is
* set
*/
use_fd = open("/dev/null", fd == 0 ? O_RDONLY : O_RDWR);
close_fd = use_fd;

if (use_fd == -1) {
uv__write_int(error_fd, -errno);
perror("failed to open stdio");
_exit(127);
perror("failed to open stdio");
_exit(127);
}
}
}

if (fd == use_fd)
uv__cloexec(use_fd, 0);
else {
else
dup2(use_fd, fd);
uv__close(use_fd);
}

if (fd <= 2)
uv__nonblock(fd, 0);

if (close_fd != -1)
uv__close(close_fd);
}

for (fd = 0; fd < stdio_count; fd++) {
use_fd = pipes[fd][1];

if (use_fd >= 0 && fd != use_fd)
close(use_fd);
}

if (options->cwd != NULL && chdir(options->cwd)) {
Expand Down
16 changes: 15 additions & 1 deletion deps/uv/src/unix/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ static int maybe_new_socket(uv_tcp_t* handle, int domain, int flags) {

int uv__tcp_bind(uv_tcp_t* tcp,
const struct sockaddr* addr,
unsigned int addrlen) {
unsigned int addrlen,
unsigned int flags) {
int err;
int on;

Expand All @@ -72,6 +73,19 @@ int uv__tcp_bind(uv_tcp_t* tcp,
if (setsockopt(tcp->io_watcher.fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)))
return -errno;

#ifdef IPV6_V6ONLY
if (addr->sa_family == AF_INET6) {
on = (flags & UV_TCP_IPV6ONLY) != 0;
if (setsockopt(tcp->io_watcher.fd,
IPPROTO_IPV6,
IPV6_V6ONLY,
&on,
sizeof on) == -1) {
return -errno;
}
}
#endif

errno = 0;
if (bind(tcp->io_watcher.fd, addr, addrlen) && errno != EADDRINUSE)
return -errno;
Expand Down
6 changes: 4 additions & 2 deletions deps/uv/src/uv-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ int uv_ip6_name(struct sockaddr_in6* src, char* dst, size_t size) {
}


int uv_tcp_bind(uv_tcp_t* handle, const struct sockaddr* addr) {
int uv_tcp_bind(uv_tcp_t* handle,
const struct sockaddr* addr,
unsigned int flags) {
unsigned int addrlen;

if (handle->type != UV_TCP)
Expand All @@ -165,7 +167,7 @@ int uv_tcp_bind(uv_tcp_t* handle, const struct sockaddr* addr) {
else
return UV_EINVAL;

return uv__tcp_bind(handle, addr, addrlen);
return uv__tcp_bind(handle, addr, addrlen, flags);
}


Expand Down
3 changes: 2 additions & 1 deletion deps/uv/src/uv-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ enum {

int uv__tcp_bind(uv_tcp_t* tcp,
const struct sockaddr* addr,
unsigned int addrlen);
unsigned int addrlen,
unsigned int flags);

int uv__tcp_connect(uv_connect_t* req,
uv_tcp_t* handle,
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#define UV_VERSION_MAJOR 0
#define UV_VERSION_MINOR 11
#define UV_VERSION_PATCH 17
#define UV_VERSION_PATCH 18
#define UV_VERSION_IS_RELEASE 1


Expand Down
34 changes: 34 additions & 0 deletions deps/uv/src/win/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <crtdbg.h>

#include "uv.h"
#include "internal.h"
Expand All @@ -41,6 +42,32 @@ static uv_once_t uv_init_guard_ = UV_ONCE_INIT;
static uv_once_t uv_default_loop_init_guard_ = UV_ONCE_INIT;


#ifdef _DEBUG
/* Our crt debug report handler allows us to temporarily disable asserts */
/* just for the current thread. */

__declspec( thread ) int uv__crt_assert_enabled = TRUE;

static int uv__crt_dbg_report_handler(int report_type, char *message, int *ret_val) {
if (uv__crt_assert_enabled || report_type != _CRT_ASSERT)
return FALSE;

if (ret_val) {
/* Set ret_val to 0 to continue with normal execution. */
/* Set ret_val to 1 to trigger a breakpoint. */

if(IsDebuggerPresent())
*ret_val = 1;
else
*ret_val = 0;
}

/* Don't call _CrtDbgReport. */
return TRUE;
}
#endif


static void uv__crt_invalid_parameter_handler(const wchar_t* expression,
const wchar_t* function, const wchar_t * file, unsigned int line,
uintptr_t reserved) {
Expand All @@ -59,6 +86,13 @@ static void uv_init(void) {
_set_invalid_parameter_handler(uv__crt_invalid_parameter_handler);
#endif

/* We also need to setup our debug report handler because some CRT */
/* functions (eg _get_osfhandle) raise an assert when called with invalid */
/* FDs even though they return the proper error code in the release build. */
#ifdef _DEBUG
_CrtSetReportHook(uv__crt_dbg_report_handler);
#endif

/* Fetch winapi function pointers. This must be done first because other */
/* intialization code might need these function pointers to be loaded. */
uv_winapi_init();
Expand Down
Loading

0 comments on commit 64d33a7

Please sign in to comment.