Skip to content

Commit ac799ba

Browse files
committed
uv: Upgrade to v0.10.19
1 parent 007393a commit ac799ba

21 files changed

Lines changed: 528 additions & 37 deletions

deps/uv/AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,5 @@ Miroslav Bajtoš <miro.bajtos@gmail.com>
8585
Elliot Saba <staticfloat@gmail.com>
8686
Wynn Wilkes <wynnw@movenetworks.com>
8787
Andrei Sedoi <bsnote@gmail.com>
88+
Chris Bank <cbank@adobe.com>
89+
Geert Jansen <geertj@gmail.com>

deps/uv/ChangeLog

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
2013.10.19, Version 0.10.18 (Stable)
1+
2013.11.13, Version 0.10.19 (Stable)
2+
3+
Changes since version 0.10.18:
4+
5+
* darwin: avoid calling GetCurrentProcess (Fedor Indutny)
6+
7+
* unix: update events from pevents between polls (Fedor Indutny)
8+
9+
* fsevents: support japaneese characters in path (Chris Bank)
10+
11+
* linux: don't turn on SO_REUSEPORT socket option (Ben Noordhuis)
12+
13+
* build: fix windows smp build with gyp (Geert Jansen)
14+
15+
* linux: handle EPOLLHUP without EPOLLIN/EPOLLOUT (Ben Noordhuis)
16+
17+
* unix: fix reopened fd bug (Fedor Indutny)
18+
19+
* core: fix fake watcher list and count preservation (Fedor Indutny)
20+
21+
22+
2013.10.19, Version 0.10.18 (Stable), 9ec52963b585e822e87bdc5de28d6143aff0d2e5
223

324
Changes since version 0.10.17:
425

deps/uv/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ Or:
9191

9292
Unix users run
9393

94-
./gyp_uv -f make
94+
./gyp_uv.py -f make
9595
make -C out
9696

9797
Macintosh users run
9898

99-
./gyp_uv -f xcode
99+
./gyp_uv.py -f xcode
100100
xcodebuild -project uv.xcodeproj -configuration Release -target All
101101

102102
Note for UNIX users: compile your project with `-D_LARGEFILE_SOURCE` and

deps/uv/build.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ TESTS= \
114114
test/test-tcp-bind6-error.o \
115115
test/test-tcp-bind-error.o \
116116
test/test-tcp-close.o \
117+
test/test-tcp-close-accept.o \
117118
test/test-tcp-close-while-connecting.o \
118119
test/test-tcp-connect6-error.o \
119120
test/test-tcp-connect-error-after-write.o \
@@ -142,6 +143,7 @@ TESTS= \
142143
test/test-udp-send-and-recv.o \
143144
test/test-util.o \
144145
test/test-walk-handles.o \
146+
test/test-watcher-cross-stop.o \
145147

146148
.PHONY: all bench clean clean-platform distclean test
147149

deps/uv/checksparse.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ test/test-stdio-over-pipes.c
133133
test/test-tcp-bind-error.c
134134
test/test-tcp-bind6-error.c
135135
test/test-tcp-close-while-connecting.c
136+
test/test-tcp-close-accept.c
136137
test/test-tcp-close.c
137138
test/test-tcp-connect-error-after-write.c
138139
test/test-tcp-connect-error.c
@@ -161,6 +162,7 @@ test/test-udp-options.c
161162
test/test-udp-send-and-recv.c
162163
test/test-util.c
163164
test/test-walk-handles.c
165+
test/test-watcher-cross-stop.c
164166
"
165167

166168
case `uname -s` in
File renamed without changes.

deps/uv/src/unix/core.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,20 +595,33 @@ static unsigned int next_power_of_two(unsigned int val) {
595595

596596
static void maybe_resize(uv_loop_t* loop, unsigned int len) {
597597
uv__io_t** watchers;
598+
void* fake_watcher_list;
599+
void* fake_watcher_count;
598600
unsigned int nwatchers;
599601
unsigned int i;
600602

601603
if (len <= loop->nwatchers)
602604
return;
603605

604-
nwatchers = next_power_of_two(len);
605-
watchers = realloc(loop->watchers, nwatchers * sizeof(loop->watchers[0]));
606+
/* Preserve fake watcher list and count at the end of the watchers */
607+
if (loop->watchers != NULL) {
608+
fake_watcher_list = loop->watchers[loop->nwatchers];
609+
fake_watcher_count = loop->watchers[loop->nwatchers + 1];
610+
} else {
611+
fake_watcher_list = NULL;
612+
fake_watcher_count = NULL;
613+
}
614+
615+
nwatchers = next_power_of_two(len + 2) - 2;
616+
watchers = realloc(loop->watchers,
617+
(nwatchers + 2) * sizeof(loop->watchers[0]));
606618

607619
if (watchers == NULL)
608620
abort();
609-
610621
for (i = loop->nwatchers; i < nwatchers; i++)
611622
watchers[i] = NULL;
623+
watchers[nwatchers] = fake_watcher_list;
624+
watchers[nwatchers + 1] = fake_watcher_count;
612625

613626
loop->watchers = watchers;
614627
loop->nwatchers = nwatchers;
@@ -700,6 +713,9 @@ void uv__io_stop(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
700713
void uv__io_close(uv_loop_t* loop, uv__io_t* w) {
701714
uv__io_stop(loop, w, UV__POLLIN | UV__POLLOUT);
702715
ngx_queue_remove(&w->pending_queue);
716+
717+
/* Remove stale events for this file descriptor */
718+
uv__platform_invalidate_fd(loop, w->fd);
703719
}
704720

705721

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

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,22 @@ int uv__set_process_title(const char* title) {
3636
CFStringRef,
3737
CFStringRef,
3838
CFDictionaryRef*);
39+
typedef CFDictionaryRef (*LSApplicationCheckInType)(int, CFDictionaryRef);
40+
typedef OSStatus (*SetApplicationIsDaemonType)(int);
41+
typedef void (*LSSetApplicationLaunchServicesServerConnectionStatusType)(
42+
uint64_t, void*);
3943
CFBundleRef launch_services_bundle;
4044
LSGetCurrentApplicationASNType ls_get_current_application_asn;
4145
LSSetApplicationInformationItemType ls_set_application_information_item;
4246
CFStringRef* display_name_key;
43-
ProcessSerialNumber psn;
4447
CFTypeRef asn;
4548
CFStringRef display_name;
4649
OSStatus err;
50+
CFBundleRef hi_services_bundle;
51+
LSApplicationCheckInType ls_application_check_in;
52+
SetApplicationIsDaemonType set_application_is_daemon;
53+
LSSetApplicationLaunchServicesServerConnectionStatusType
54+
ls_set_application_launch_services_server_connection_status;
4755

4856
launch_services_bundle =
4957
CFBundleGetBundleWithIdentifier(CFSTR("com.apple.LaunchServices"));
@@ -71,8 +79,36 @@ int uv__set_process_title(const char* title) {
7179
if (display_name_key == NULL || *display_name_key == NULL)
7280
return -1;
7381

74-
/* Force the process manager to initialize. */
75-
GetCurrentProcess(&psn);
82+
/* Black 10.9 magic, to remove (Not responding) mark in Activity Monitor */
83+
hi_services_bundle =
84+
CFBundleGetBundleWithIdentifier(CFSTR("com.apple.HIServices"));
85+
if (hi_services_bundle == NULL)
86+
return -1;
87+
88+
set_application_is_daemon = CFBundleGetFunctionPointerForName(
89+
hi_services_bundle,
90+
CFSTR("SetApplicationIsDaemon"));
91+
ls_application_check_in = CFBundleGetFunctionPointerForName(
92+
launch_services_bundle,
93+
CFSTR("_LSApplicationCheckIn"));
94+
ls_set_application_launch_services_server_connection_status =
95+
CFBundleGetFunctionPointerForName(
96+
launch_services_bundle,
97+
CFSTR("_LSSetApplicationLaunchServicesServerConnectionStatus"));
98+
if (set_application_is_daemon == NULL ||
99+
ls_application_check_in == NULL ||
100+
ls_set_application_launch_services_server_connection_status == NULL) {
101+
return -1;
102+
}
103+
104+
if (set_application_is_daemon(1) != noErr)
105+
return -1;
106+
107+
ls_set_application_launch_services_server_connection_status(0, NULL);
108+
109+
/* Check into process manager?! */
110+
ls_application_check_in(-2,
111+
CFBundleGetInfoDictionary(CFBundleGetMainBundle()));
76112

77113
display_name = CFStringCreateWithCString(NULL, title, kCFStringEncodingUTF8);
78114
asn = ls_get_current_application_asn();

deps/uv/src/unix/darwin.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,25 @@ void uv__platform_loop_delete(uv_loop_t* loop) {
102102
}
103103

104104

105+
void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
106+
struct kevent* events;
107+
uintptr_t i;
108+
uintptr_t nfds;
109+
110+
assert(loop->watchers != NULL);
111+
112+
events = (struct kevent*) loop->watchers[loop->nwatchers];
113+
nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1];
114+
if (events == NULL)
115+
return;
116+
117+
/* Invalidate events with same file descriptor */
118+
for (i = 0; i < nfds; i++)
119+
if ((int) events[i].ident == fd)
120+
events[i].ident = -1;
121+
}
122+
123+
105124
static void uv__cf_loop_runner(void* arg) {
106125
uv_loop_t* loop;
107126

deps/uv/src/unix/fsevents.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,7 @@ int uv__fsevents_init(uv_fs_event_t* handle) {
223223
handle->realpath_len = strlen(handle->realpath);
224224

225225
/* Initialize paths array */
226-
path = CFStringCreateWithCString(NULL,
227-
handle->filename,
228-
CFStringGetSystemEncoding());
226+
path = CFStringCreateWithFileSystemRepresentation(NULL, handle->filename);
229227
paths = CFArrayCreate(NULL, (const void**)&path, 1, NULL);
230228

231229
latency = 0.15;

0 commit comments

Comments
 (0)