Browse Source

uv: upgrade to 5eb1d19

v0.9.2-release
Bert Belder 12 years ago
parent
commit
ed103409c4
  1. 2
      deps/uv/include/uv-private/uv-bsd.h
  2. 14
      deps/uv/src/win/tcp.c
  3. 12
      deps/uv/test/test-spawn.c

2
deps/uv/include/uv-private/uv-bsd.h

@ -23,7 +23,7 @@
#define UV_BSD_H
#define UV_PLATFORM_FS_EVENT_FIELDS \
uv__io_t event_watcher; \
ev_io event_watcher; \
int fflags; \
int fd; \

14
deps/uv/src/win/tcp.c

@ -540,7 +540,7 @@ int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb) {
if(!handle->accept_reqs) {
handle->accept_reqs = (uv_tcp_accept_t*)
malloc(simultaneous_accepts * sizeof(uv_tcp_accept_t));
malloc(uv_simultaneous_server_accepts * sizeof(uv_tcp_accept_t));
if (!handle->accept_reqs) {
uv_fatal_error(ERROR_OUTOFMEMORY, "malloc");
}
@ -564,6 +564,18 @@ int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb) {
uv_tcp_queue_accept(handle, req);
}
/* Initialize other unused requests too, because uv_tcp_endgame */
/* doesn't know how how many requests were intialized, so it will */
/* try to clean up {uv_simultaneous_server_accepts} requests. */
for (i = simultaneous_accepts; i < uv_simultaneous_server_accepts; i++) {
req = &handle->accept_reqs[i];
uv_req_init(loop, (uv_req_t*) req);
req->type = UV_ACCEPT;
req->accept_socket = INVALID_SOCKET;
req->data = handle;
req->wait_handle = INVALID_HANDLE_VALUE;
}
}
return 0;

12
deps/uv/test/test-spawn.c

@ -667,7 +667,7 @@ TEST_IMPL(argument_escaping) {
return 0;
}
WCHAR* make_program_env(char** env_block);
uv_err_t make_program_env(char** env_block, WCHAR** dst_ptr);
TEST_IMPL(environment_creation) {
int i;
@ -682,8 +682,9 @@ TEST_IMPL(environment_creation) {
WCHAR expected[512];
WCHAR* ptr = expected;
WCHAR* result;
uv_err_t result;
WCHAR* str;
WCHAR* env;
for (i = 0; i < sizeof(environment) / sizeof(environment[0]) - 1; i++) {
ptr += uv_utf8_to_utf16(environment[i], ptr, expected + sizeof(expected) - ptr);
@ -700,13 +701,14 @@ TEST_IMPL(environment_creation) {
++ptr;
*ptr = '\0';
result = make_program_env(environment);
result = make_program_env(environment, &env);
ASSERT(result.code == UV_OK);
for (str = result; *str; str += wcslen(str) + 1) {
for (str = env; *str; str += wcslen(str) + 1) {
wprintf(L"%s\n", str);
}
ASSERT(wcscmp(expected, result) == 0);
ASSERT(wcscmp(expected, env) == 0);
return 0;
}

Loading…
Cancel
Save