diff options
author | Bert Belder <bertbelder@gmail.com> | 2012-08-30 19:28:02 +0400 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2012-08-30 19:28:02 +0400 |
commit | 9603f08f21987d5367d98267a16179a61e4400c1 (patch) | |
tree | 918f15a91a79788aa217494aaa9cccfd8eda6b38 /deps | |
parent | b0d2795fe9501218dd8c953252fffe2d05d59c2a (diff) |
uv: upgrade to 24c062c
Diffstat (limited to 'deps')
-rw-r--r-- | deps/uv/include/uv.h | 5 | ||||
-rw-r--r-- | deps/uv/src/unix/error.c | 1 | ||||
-rw-r--r-- | deps/uv/src/unix/udp.c | 5 | ||||
-rw-r--r-- | deps/uv/src/win/core.c | 3 | ||||
-rw-r--r-- | deps/uv/src/win/tcp.c | 14 |
5 files changed, 25 insertions, 3 deletions
diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h index 7c2c03f9286..49160b2bc29 100644 --- a/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h @@ -120,8 +120,9 @@ extern "C" { XX( 53, ENOTEMPTY, "directory not empty") \ XX( 54, ENOSPC, "no space left on device") \ XX( 55, EIO, "i/o error") \ - XX( 56, EROFS, "read-only file system" ) \ - XX( 57, ENODEV, "no such device" ) + XX( 56, EROFS, "read-only file system") \ + XX( 57, ENODEV, "no such device") \ + XX( 58, ESPIPE, "invalid seek") \ #define UV_ERRNO_GEN(val, name, s) UV_##name = val, diff --git a/deps/uv/src/unix/error.c b/deps/uv/src/unix/error.c index 9fbb312eef6..b2add994a00 100644 --- a/deps/uv/src/unix/error.c +++ b/deps/uv/src/unix/error.c @@ -68,6 +68,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) { case EAFNOSUPPORT: return UV_EAFNOSUPPORT; case EBADF: return UV_EBADF; case EPIPE: return UV_EPIPE; + case ESPIPE: return UV_ESPIPE; case EAGAIN: return UV_EAGAIN; #if EWOULDBLOCK != EAGAIN case EWOULDBLOCK: return UV_EAGAIN; diff --git a/deps/uv/src/unix/udp.c b/deps/uv/src/unix/udp.c index 9f87060aee3..634d4a0613b 100644 --- a/deps/uv/src/unix/udp.c +++ b/deps/uv/src/unix/udp.c @@ -86,6 +86,10 @@ void uv__udp_finish_close(uv_udp_t* handle) { req = ngx_queue_data(q, uv_udp_send_t, queue); uv__req_unregister(handle->loop, req); + if (req->bufs != req->bufsml) + free(req->bufs); + req->bufs = NULL; + if (req->send_cb) { /* FIXME proper error code like UV_EABORTED */ uv__set_artificial_error(handle->loop, UV_EINTR); @@ -171,6 +175,7 @@ static void uv__udp_run_completed(uv_udp_t* handle) { if (req->bufs != req->bufsml) free(req->bufs); + req->bufs = NULL; if (req->send_cb == NULL) continue; diff --git a/deps/uv/src/win/core.c b/deps/uv/src/win/core.c index 7a35580382b..79fb655c0fa 100644 --- a/deps/uv/src/win/core.c +++ b/deps/uv/src/win/core.c @@ -70,6 +70,9 @@ static void uv_loop_init(uv_loop_t* loop) { uv_fatal_error(GetLastError(), "CreateIoCompletionPort"); } + /* To prevent uninitialized memory access, loop->time must be intialized */ + /* to zero before calling uv_update_time for the first time. */ + loop->time = 0; uv_update_time(loop); ngx_queue_init(&loop->handle_queue); diff --git a/deps/uv/src/win/tcp.c b/deps/uv/src/win/tcp.c index e13c0f3dfe9..9ac01401e18 100644 --- a/deps/uv/src/win/tcp.c +++ b/deps/uv/src/win/tcp.c @@ -547,7 +547,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"); } @@ -571,6 +571,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; |