Browse Source

uv: upgrade to 24c062c

v0.8.9-release
Bert Belder 12 years ago
parent
commit
9603f08f21
  1. 5
      deps/uv/include/uv.h
  2. 1
      deps/uv/src/unix/error.c
  3. 5
      deps/uv/src/unix/udp.c
  4. 3
      deps/uv/src/win/core.c
  5. 14
      deps/uv/src/win/tcp.c

5
deps/uv/include/uv.h

@ -120,8 +120,9 @@ extern "C" {
XX( 53, ENOTEMPTY, "directory not empty") \ XX( 53, ENOTEMPTY, "directory not empty") \
XX( 54, ENOSPC, "no space left on device") \ XX( 54, ENOSPC, "no space left on device") \
XX( 55, EIO, "i/o error") \ XX( 55, EIO, "i/o error") \
XX( 56, EROFS, "read-only file system" ) \ XX( 56, EROFS, "read-only file system") \
XX( 57, ENODEV, "no such device" ) XX( 57, ENODEV, "no such device") \
XX( 58, ESPIPE, "invalid seek") \
#define UV_ERRNO_GEN(val, name, s) UV_##name = val, #define UV_ERRNO_GEN(val, name, s) UV_##name = val,

1
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 EAFNOSUPPORT: return UV_EAFNOSUPPORT;
case EBADF: return UV_EBADF; case EBADF: return UV_EBADF;
case EPIPE: return UV_EPIPE; case EPIPE: return UV_EPIPE;
case ESPIPE: return UV_ESPIPE;
case EAGAIN: return UV_EAGAIN; case EAGAIN: return UV_EAGAIN;
#if EWOULDBLOCK != EAGAIN #if EWOULDBLOCK != EAGAIN
case EWOULDBLOCK: return UV_EAGAIN; case EWOULDBLOCK: return UV_EAGAIN;

5
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); req = ngx_queue_data(q, uv_udp_send_t, queue);
uv__req_unregister(handle->loop, req); uv__req_unregister(handle->loop, req);
if (req->bufs != req->bufsml)
free(req->bufs);
req->bufs = NULL;
if (req->send_cb) { if (req->send_cb) {
/* FIXME proper error code like UV_EABORTED */ /* FIXME proper error code like UV_EABORTED */
uv__set_artificial_error(handle->loop, UV_EINTR); 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) if (req->bufs != req->bufsml)
free(req->bufs); free(req->bufs);
req->bufs = NULL;
if (req->send_cb == NULL) if (req->send_cb == NULL)
continue; continue;

3
deps/uv/src/win/core.c

@ -70,6 +70,9 @@ static void uv_loop_init(uv_loop_t* loop) {
uv_fatal_error(GetLastError(), "CreateIoCompletionPort"); 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); uv_update_time(loop);
ngx_queue_init(&loop->handle_queue); ngx_queue_init(&loop->handle_queue);

14
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) { if(!handle->accept_reqs) {
handle->accept_reqs = (uv_tcp_accept_t*) 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) { if (!handle->accept_reqs) {
uv_fatal_error(ERROR_OUTOFMEMORY, "malloc"); 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); 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; return 0;

Loading…
Cancel
Save