Skip to content

Commit 061151c

Browse files
committed
uv: Upgrade to v0.11.1
1 parent 259839f commit 061151c

31 files changed

+369
-142
lines changed

deps/uv/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ vgcore.*
1212
/libuv.so
1313
/libuv.dylib
1414

15+
# Generated by dtrace(1) when doing an in-tree build.
16+
/src/unix/uv-dtrace.h
17+
1518
/out/
1619
/build/gyp
1720

deps/uv/AUTHORS

+5
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,8 @@ Tim Bradshaw <tfb@cley.com>
7979
Timothy J. Fontaine <tjfontaine@gmail.com>
8080
Marc Schlaich <marc.schlaich@googlemail.com>
8181
Brian Mazza <louseman@gmail.com>
82+
Elliot Saba <staticfloat@gmail.com>
83+
Ben Kelly <ben@wanderview.com>
84+
Kristian Evensen <kristian.evensen@gmail.com>
85+
Nils Maier <maierman@web.de>
86+
Nicholas Vavilov <vvnicholas@gmail.com>

deps/uv/ChangeLog

+38
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
2013.04.11, Version 0.11.1 (Unstable)
2+
3+
This is the first versioned release from the current unstable libuv branch.
4+
5+
Changes since Node.js v0.11.0:
6+
7+
* all platforms: nanosecond resolution support for uv_fs_[fl]stat (Timothy J.
8+
Fontaine)
9+
10+
* all platforms: add netmask to uv_interface_address (Ben Kelly)
11+
12+
* unix: make sure the `status` parameter passed to the `uv_getaddrinfo` is 0 or
13+
-1 (Ben Noordhuis)
14+
15+
* unix: limit the number of iovecs written in a single `writev` syscall to
16+
IOV_MAX (Fedor Indutny)
17+
18+
* unix: add dtrace probes for tick-start and tick-stop (Timothy J. Fontaine)
19+
20+
* mingw-w64: don't call _set_invalid_parameter_handler (Nils Maier)
21+
22+
* windows: fix memory leak in fs__sendfile (Shannen Saez)
23+
24+
* windows: fix edge case bugs in uv_cpu_info (Bert Belder)
25+
26+
* include: no longer ship with / include ngx-queue.h (Ben Noordhuis)
27+
28+
* include: remove UV_VERSION_* macros from uv.h (Ben Noordhuis)
29+
30+
* documentation updates (Kristian Evensen, Ben Kelly, Ben Noordhuis)
31+
32+
* build: fix dtrace-enabled builds (Ben Noordhuis, Timothy J. Fontaine)
33+
34+
* build: gyp disable thin archives (Timothy J. Fontaine)
35+
36+
* build: add support for Visual Studio 2012 (Nicholas Vavilov)
37+
38+
139
2013.02.04, Version 0.10.3 (Stable)
240

341
Changes since version 0.10.2:

deps/uv/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,14 @@ autotools, add a `AC_GNU_SOURCE` declaration to your `configure.ac`.
109109
## Supported Platforms
110110

111111
Microsoft Windows operating systems since Windows XP SP2. It can be built
112-
with either Visual Studio or MinGW.
112+
with either Visual Studio or MinGW. Consider using
113+
[Visual Studio Express 2010][] or later if you do not have a full Visual
114+
Studio license.
113115

114116
Linux 2.6 using the GCC toolchain.
115117

116118
MacOS using the GCC or XCode toolchain.
117119

118120
Solaris 121 and later using GCC toolchain.
121+
122+
[Visual Studio Express 2010]: http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express

deps/uv/build.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,5 @@ bench: run-benchmarks$(E)
160160
clean distclean: clean-platform
161161
$(RM) libuv.a libuv.$(SOEXT) \
162162
test/run-tests.o test/run-benchmarks.o \
163-
test/run-tests$(E) test/run-benchmarks$(E) \
163+
test/runner.o run-tests$(E) test/run-benchmarks$(E) \
164164
$(BENCHMARKS) $(TESTS) $(RUNNER_LIBS)

deps/uv/common.gypi

+10
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@
132132
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
133133
'cflags': [ '-Wall' ],
134134
'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
135+
'target_conditions': [
136+
['_type=="static_library"', {
137+
'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
138+
}],
139+
],
135140
'conditions': [
136141
[ 'host_arch != target_arch and target_arch=="ia32"', {
137142
'cflags': [ '-m32' ],
@@ -192,6 +197,11 @@
192197
}],
193198
],
194199
}],
200+
['OS=="solaris"', {
201+
'cflags': [ '-fno-omit-frame-pointer' ],
202+
# pull in V8's postmortem metadata
203+
'ldflags': [ '-Wl,-z,allextract' ]
204+
}],
195205
],
196206
},
197207
}

deps/uv/config-unix.mk

+28-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ RUNNER_SRC=test/runner-unix.c
3333
RUNNER_CFLAGS=$(CFLAGS) -I$(SRCDIR)/test
3434
RUNNER_LDFLAGS=-L"$(CURDIR)" -luv -Xlinker -rpath -Xlinker "$(CURDIR)"
3535

36+
HAVE_DTRACE=
37+
DTRACE_OBJS=
38+
DTRACE_HEADER=
39+
3640
OBJS += src/unix/async.o
3741
OBJS += src/unix/core.o
3842
OBJS += src/unix/dl.o
@@ -58,11 +62,14 @@ OBJS += src/inet.o
5862
OBJS += src/version.o
5963

6064
ifeq (sunos,$(PLATFORM))
65+
HAVE_DTRACE=1
6166
CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
6267
LDFLAGS+=-lkstat -lnsl -lsendfile -lsocket
6368
# Library dependencies are not transitive.
6469
RUNNER_LDFLAGS += $(LDFLAGS)
6570
OBJS += src/unix/sunos.o
71+
OBJS += src/unix/dtrace.o
72+
DTRACE_OBJS += src/unix/core.o
6673
endif
6774

6875
ifeq (aix,$(PLATFORM))
@@ -72,6 +79,9 @@ OBJS += src/unix/aix.o
7279
endif
7380

7481
ifeq (darwin,$(PLATFORM))
82+
HAVE_DTRACE=1
83+
# dtrace(1) probes contain dollar signs.
84+
CFLAGS += -Wno-dollar-in-identifier-extension
7585
CPPFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
7686
LDFLAGS += -framework Foundation \
7787
-framework CoreServices \
@@ -96,6 +106,7 @@ OBJS += src/unix/linux-core.o \
96106
endif
97107

98108
ifeq (freebsd,$(PLATFORM))
109+
HAVE_DTRACE=1
99110
LDFLAGS+=-lkvm
100111
OBJS += src/unix/freebsd.o
101112
OBJS += src/unix/kqueue.o
@@ -132,6 +143,12 @@ else
132143
RUNNER_LDFLAGS += -pthread
133144
endif
134145

146+
ifeq ($(HAVE_DTRACE), 1)
147+
DTRACE_HEADER = src/unix/uv-dtrace.h
148+
CPPFLAGS += -Isrc/unix
149+
CFLAGS += -DHAVE_DTRACE
150+
endif
151+
135152
libuv.a: $(OBJS)
136153
$(AR) rcs $@ $^
137154

@@ -152,7 +169,7 @@ src/.buildstamp src/unix/.buildstamp test/.buildstamp:
152169
mkdir -p $(@D)
153170
touch $@
154171

155-
src/unix/%.o src/unix/%.pic.o: src/unix/%.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h src/unix/.buildstamp
172+
src/unix/%.o src/unix/%.pic.o: src/unix/%.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h src/unix/.buildstamp $(DTRACE_HEADER)
156173
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
157174

158175
src/%.o src/%.pic.o: src/%.c include/uv.h include/uv-private/uv-unix.h src/.buildstamp
@@ -162,7 +179,16 @@ test/%.o: test/%.c include/uv.h test/.buildstamp
162179
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
163180

164181
clean-platform:
165-
$(RM) test/run-{tests,benchmarks}.dSYM $(OBJS) $(OBJS:%.o=%.pic.o)
182+
$(RM) test/run-{tests,benchmarks}.dSYM $(OBJS) $(OBJS:%.o=%.pic.o) src/unix/uv-dtrace.h
166183

167184
%.pic.o %.o: %.m
168185
$(OBJC) $(CPPFLAGS) $(CFLAGS) -c $^ -o $@
186+
187+
src/unix/uv-dtrace.h: src/unix/uv-dtrace.d
188+
dtrace -h -xnolibs -s $< -o $@
189+
190+
src/unix/dtrace.o: src/unix/uv-dtrace.d $(DTRACE_OBJS)
191+
dtrace -G -s $^ -o $@
192+
193+
src/unix/dtrace.pic.o: src/unix/uv-dtrace.d $(DTRACE_OBJS:%.o=%.pic.o)
194+
dtrace -G -s $^ -o $@

deps/uv/include/uv.h

+12-2
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ UV_EXTERN uint64_t uv_now(uv_loop_t*);
289289
* Get backend file descriptor. Only kqueue, epoll and event ports are
290290
* supported.
291291
*
292-
* This can be used in conjunction with uv_run_once() to poll in one thread and
293-
* run the event loop's event callbacks in another.
292+
* This can be used in conjunction with `uv_run(loop, UV_RUN_NOWAIT)` to
293+
* poll in one thread and run the event loop's event callbacks in another.
294294
*
295295
* Useful for embedding libuv's event loop in another event loop.
296296
* See test/test-embed.c for an example.
@@ -787,6 +787,12 @@ UV_EXTERN int uv_udp_init(uv_loop_t*, uv_udp_t* handle);
787787

788788
/*
789789
* Opens an existing file descriptor or SOCKET as a udp handle.
790+
*
791+
* Unix only:
792+
* The only requirement of the sock argument is that it follows the
793+
* datagram contract (works in unconnected mode, supports sendmsg()/recvmsg(),
794+
* etc.). In other words, other datagram-type sockets like raw sockets or
795+
* netlink sockets can also be passed to this function.
790796
*/
791797
UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock);
792798

@@ -1473,6 +1479,10 @@ struct uv_interface_address_s {
14731479
struct sockaddr_in address4;
14741480
struct sockaddr_in6 address6;
14751481
} address;
1482+
union {
1483+
struct sockaddr_in netmask4;
1484+
struct sockaddr_in6 netmask6;
1485+
} netmask;
14761486
};
14771487

14781488
UV_EXTERN char** uv_setup_args(int argc, char** argv);

deps/uv/src/inet.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ uv_err_t uv_inet_ntop(int af, const void* src, char* dst, size_t size) {
5454
static uv_err_t inet_ntop4(const unsigned char *src, char *dst, size_t size) {
5555
static const char fmt[] = "%u.%u.%u.%u";
5656
char tmp[sizeof "255.255.255.255"];
57-
size_t l;
57+
int l;
5858

5959
#ifndef _WIN32
6060
l = snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]);
6161
#else
6262
l = _snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]);
6363
#endif
64-
if (l <= 0 || l >= size) {
64+
if (l <= 0 || (size_t) l >= size) {
6565
return uv_enospc_;
6666
}
6767
strncpy(dst, tmp, size);

deps/uv/src/unix/aix.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ uint64_t uv__hrtime(void) {
6262
int uv_exepath(char* buffer, size_t* size) {
6363
ssize_t res;
6464
char pp[64], cwdl[PATH_MAX];
65-
size_t cwdl_len;
6665
struct psinfo ps;
6766
int fd;
6867

@@ -79,7 +78,6 @@ int uv_exepath(char* buffer, size_t* size) {
7978
return res;
8079

8180
cwdl[res] = '\0';
82-
cwdl_len = res;
8381

8482
(void) snprintf(pp, sizeof(pp), "/proc/%lu/psinfo", (unsigned long) getpid());
8583
fd = open(pp, O_RDONLY);
@@ -364,11 +362,13 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses,
364362
address->name = strdup(p->ifr_name);
365363

366364
if (p->ifr_addr.sa_family == AF_INET6) {
367-
address->address.address6 = *((struct sockaddr_in6 *)&p->ifr_addr);
365+
address->address.address6 = *((struct sockaddr_in6*) &p->ifr_addr);
368366
} else {
369-
address->address.address4 = *((struct sockaddr_in *)&p->ifr_addr);
367+
address->address.address4 = *((struct sockaddr_in*) &p->ifr_addr);
370368
}
371369

370+
/* TODO: Retrieve netmask using SIOCGIFNETMASK ioctl */
371+
372372
address->is_internal = flg.ifr_flags & IFF_LOOPBACK ? 1 : 0;
373373

374374
address++;

deps/uv/src/unix/core.c

+4
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) {
299299

300300
r = uv__loop_alive(loop);
301301
while (r != 0 && loop->stop_flag == 0) {
302+
UV_TICK_START(loop, mode);
303+
302304
uv__update_time(loop);
303305
uv__run_timers(loop);
304306
uv__run_idle(loop);
@@ -314,6 +316,8 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) {
314316
uv__run_closing_handles(loop);
315317
r = uv__loop_alive(loop);
316318

319+
UV_TICK_STOP(loop, mode);
320+
317321
if (mode & (UV_RUN_ONCE | UV_RUN_NOWAIT))
318322
break;
319323
}

deps/uv/src/unix/cygwin.c

-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ void uv_loadavg(double avg[3]) {
5656

5757
int uv_exepath(char* buffer, size_t* size) {
5858
uint32_t usize;
59-
int result;
60-
char* path;
61-
char* fullpath;
6259

6360
if (!buffer || !size) {
6461
return -1;

deps/uv/src/unix/darwin.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,15 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses,
403403
address->name = strdup(ent->ifa_name);
404404

405405
if (ent->ifa_addr->sa_family == AF_INET6) {
406-
address->address.address6 = *((struct sockaddr_in6 *)ent->ifa_addr);
406+
address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr);
407407
} else {
408-
address->address.address4 = *((struct sockaddr_in *)ent->ifa_addr);
408+
address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr);
409+
}
410+
411+
if (ent->ifa_netmask->sa_family == AF_INET6) {
412+
address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask);
413+
} else {
414+
address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
409415
}
410416

411417
address->is_internal = ent->ifa_flags & IFF_LOOPBACK ? 1 : 0;

deps/uv/src/unix/getaddrinfo.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ static void uv__getaddrinfo_done(struct uv__work* w, int status) {
8787
#if defined(EAI_NODATA) /* Newer FreeBSDs don't have EAI_NODATA. */
8888
else if (req->retcode == EAI_NODATA)
8989
uv__set_sys_error(req->loop, ENOENT);
90-
#elif defined(__sun)
91-
if (req->retcode == EAI_MEMORY && hostlen >= MAXHOSTNAMELEN) {
90+
#endif
91+
#if defined(__sun)
92+
else if (req->retcode == EAI_MEMORY && hostlen >= MAXHOSTNAMELEN)
9293
uv__set_sys_error(req->loop, ENOENT);
9394
#endif
9495
else {

deps/uv/src/unix/internal.h

+7
Original file line numberDiff line numberDiff line change
@@ -256,4 +256,11 @@ static void uv__update_time(uv_loop_t* loop) {
256256
loop->time = uv__hrtime() / 1000000;
257257
}
258258

259+
#ifdef HAVE_DTRACE
260+
#include "uv-dtrace.h"
261+
#else
262+
#define UV_TICK_START(arg0, arg1)
263+
#define UV_TICK_STOP(arg0, arg1)
264+
#endif
265+
259266
#endif /* UV_UNIX_INTERNAL_H_ */

deps/uv/src/unix/linux-core.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,15 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses,
688688
address->name = strdup(ent->ifa_name);
689689

690690
if (ent->ifa_addr->sa_family == AF_INET6) {
691-
address->address.address6 = *((struct sockaddr_in6 *)ent->ifa_addr);
691+
address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr);
692692
} else {
693-
address->address.address4 = *((struct sockaddr_in *)ent->ifa_addr);
693+
address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr);
694+
}
695+
696+
if (ent->ifa_netmask->sa_family == AF_INET6) {
697+
address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask);
698+
} else {
699+
address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
694700
}
695701

696702
address->is_internal = ent->ifa_flags & IFF_LOOPBACK ? 1 : 0;

deps/uv/src/unix/netbsd.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,15 @@ uv_err_t uv_interface_addresses(uv_interface_address_t** addresses, int* count)
326326
address->name = strdup(ent->ifa_name);
327327

328328
if (ent->ifa_addr->sa_family == AF_INET6) {
329-
address->address.address6 = *((struct sockaddr_in6 *)ent->ifa_addr);
329+
address->address.address6 = *((struct sockaddr_in6*) ent->ifa_addr);
330330
} else {
331-
address->address.address4 = *((struct sockaddr_in *)ent->ifa_addr);
331+
address->address.address4 = *((struct sockaddr_in*) ent->ifa_addr);
332+
}
333+
334+
if (ent->ifa_netmask->sa_family == AF_INET6) {
335+
address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask);
336+
} else {
337+
address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
332338
}
333339

334340
address->is_internal = !!(ent->ifa_flags & IFF_LOOPBACK) ? 1 : 0;

0 commit comments

Comments
 (0)