Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
uv: upgrade to 24c062c
  • Loading branch information
piscisaureus committed Aug 30, 2012
1 parent b0d2795 commit 9603f08
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
5 changes: 3 additions & 2 deletions deps/uv/include/uv.h
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions deps/uv/src/unix/error.c
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions deps/uv/src/unix/udp.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions deps/uv/src/win/core.c
Expand Up @@ -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);
Expand Down
14 changes: 13 additions & 1 deletion deps/uv/src/win/tcp.c
Expand Up @@ -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");
}
Expand All @@ -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;
Expand Down

0 comments on commit 9603f08

Please sign in to comment.