From cd894521dd9e1e648fde803950f2dcb3a8529a3b Mon Sep 17 00:00:00 2001 From: schlamar Date: Fri, 5 Dec 2014 08:24:07 +0100 Subject: [PATCH 1/3] win: keep a reference to AFD_POLL_INFO in cancel poll --- include/uv-private/uv-win.h | 5 ++++- src/win/poll.c | 31 +++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/include/uv-private/uv-win.h b/include/uv-private/uv-win.h index c9ec38ef..e5f2f3b4 100644 --- a/include/uv-private/uv-win.h +++ b/include/uv-private/uv-win.h @@ -474,7 +474,10 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s); /* Used in fast mode */ \ SOCKET peer_socket; \ AFD_POLL_INFO afd_poll_info_1; \ - AFD_POLL_INFO afd_poll_info_2; \ + union { \ + AFD_POLL_INFO* afd_poll_info_ptr; \ + AFD_POLL_INFO afd_poll_info; \ + } afd_poll_info_2; \ /* Used in fast and slow mode. */ \ uv_req_t poll_req_1; \ uv_req_t poll_req_2; \ diff --git a/src/win/poll.c b/src/win/poll.c index 76427b01..5c5c7d80 100644 --- a/src/win/poll.c +++ b/src/win/poll.c @@ -79,7 +79,7 @@ static void uv__fast_poll_submit_poll_req(uv_loop_t* loop, uv_poll_t* handle) { handle->mask_events_2 = handle->events; } else if (handle->submitted_events_2 == 0) { req = &handle->poll_req_2; - afd_poll_info = &handle->afd_poll_info_2; + afd_poll_info = &handle->afd_poll_info_2.afd_poll_info_ptr[0]; handle->submitted_events_2 = handle->events; handle->mask_events_1 = handle->events; handle->mask_events_2 = 0; @@ -118,18 +118,19 @@ static void uv__fast_poll_submit_poll_req(uv_loop_t* loop, uv_poll_t* handle) { static int uv__fast_poll_cancel_poll_req(uv_loop_t* loop, uv_poll_t* handle) { - AFD_POLL_INFO afd_poll_info; + AFD_POLL_INFO* afd_poll_info; DWORD result; - afd_poll_info.Exclusive = TRUE; - afd_poll_info.NumberOfHandles = 1; - afd_poll_info.Timeout.QuadPart = INT64_MAX; - afd_poll_info.Handles[0].Handle = (HANDLE) handle->socket; - afd_poll_info.Handles[0].Status = 0; - afd_poll_info.Handles[0].Events = AFD_POLL_ALL; + afd_poll_info = &handle->afd_poll_info_2.afd_poll_info_ptr[1]; + afd_poll_info->Exclusive = TRUE; + afd_poll_info->NumberOfHandles = 1; + afd_poll_info->Timeout.QuadPart = INT64_MAX; + afd_poll_info->Handles[0].Handle = (HANDLE) handle->socket; + afd_poll_info->Handles[0].Status = 0; + afd_poll_info->Handles[0].Events = AFD_POLL_ALL; result = uv_msafd_poll(handle->socket, - &afd_poll_info, + afd_poll_info, uv__get_overlapped_dummy()); if (result == SOCKET_ERROR) { @@ -154,7 +155,7 @@ static void uv__fast_poll_process_poll_req(uv_loop_t* loop, uv_poll_t* handle, handle->submitted_events_1 = 0; mask_events = handle->mask_events_1; } else if (req == &handle->poll_req_2) { - afd_poll_info = &handle->afd_poll_info_2; + afd_poll_info = &handle->afd_poll_info_2.afd_poll_info_ptr[0]; handle->submitted_events_2 = 0; mask_events = handle->mask_events_2; } else { @@ -551,6 +552,12 @@ int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle, handle->poll_req_2.type = UV_POLL_REQ; handle->poll_req_2.data = handle; + handle->afd_poll_info_2.afd_poll_info_ptr = malloc(sizeof(*handle->afd_poll_info_2.afd_poll_info_ptr) * 2); + if (handle->afd_poll_info_2.afd_poll_info_ptr == NULL) { + uv__set_artificial_error(loop, UV_ENOMEM); + return -1; + } + return 0; } @@ -604,5 +611,9 @@ void uv_poll_endgame(uv_loop_t* loop, uv_poll_t* handle) { assert(handle->submitted_events_1 == 0); assert(handle->submitted_events_2 == 0); + if (handle->afd_poll_info_2.afd_poll_info_ptr) { + free(handle->afd_poll_info_2.afd_poll_info_ptr); + handle->afd_poll_info_2.afd_poll_info_ptr = NULL; + } uv__handle_close(handle); } From 5a63f5e9546dca482eeebc3054139b21f509f21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 9 Dec 2014 19:49:43 +0100 Subject: [PATCH 2/3] 2014.12.10, Version 0.10.30 (Stable) Changes since version 0.10.29: * linux: fix sigmask size arg in epoll_pwait() call (Ben Noordhuis) * linux: handle O_NONBLOCK != SOCK_NONBLOCK case (Helge Deller) * doc: update project links (Ben Noordhuis) * windows: fix compilation of tests (Marc Schlaich) * unix: add flag for blocking SIGPROF during poll (Ben Noordhuis) * unix, windows: add uv_loop_configure() function (Ben Noordhuis) * win: keep a reference to AFD_POLL_INFO in cancel poll (Marc Schlaich) --- AUTHORS | 1 + ChangeLog | 19 +++++++++++++++++++ src/version.c | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index b27d1771..48a74db3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -131,3 +131,4 @@ Paul Tan Javier Hernández Tonis Tiigi Michael Hudson-Doyle +Helge Deller diff --git a/ChangeLog b/ChangeLog index de77a4f2..4ba348d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2014.12.10, Version 0.10.30 (Stable) + +Changes since version 0.10.29: + +* linux: fix sigmask size arg in epoll_pwait() call (Ben Noordhuis) + +* linux: handle O_NONBLOCK != SOCK_NONBLOCK case (Helge Deller) + +* doc: update project links (Ben Noordhuis) + +* windows: fix compilation of tests (Marc Schlaich) + +* unix: add flag for blocking SIGPROF during poll (Ben Noordhuis) + +* unix, windows: add uv_loop_configure() function (Ben Noordhuis) + +* win: keep a reference to AFD_POLL_INFO in cancel poll (Marc Schlaich) + + 2014.10.21, Version 0.10.29 (Stable), 2d728542d3790183417f8f122a110693cd85db14 Changes since version 0.10.28: diff --git a/src/version.c b/src/version.c index 010d4f22..1b5a1e4c 100644 --- a/src/version.c +++ b/src/version.c @@ -35,7 +35,7 @@ #define UV_VERSION_MAJOR 0 #define UV_VERSION_MINOR 10 #define UV_VERSION_PATCH 30 -#define UV_VERSION_IS_RELEASE 0 +#define UV_VERSION_IS_RELEASE 1 #define UV_VERSION ((UV_VERSION_MAJOR << 16) | \ From 20fe7f9bc749b249ce41cdce124ccdedbb17d76e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 9 Dec 2014 19:49:50 +0100 Subject: [PATCH 3/3] Now working on v0.10.31 --- ChangeLog | 2 +- src/version.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ba348d5..28a94100 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2014.12.10, Version 0.10.30 (Stable) +2014.12.10, Version 0.10.30 (Stable), 5a63f5e9546dca482eeebc3054139b21f509f21f Changes since version 0.10.29: diff --git a/src/version.c b/src/version.c index 1b5a1e4c..f4ab9183 100644 --- a/src/version.c +++ b/src/version.c @@ -34,8 +34,8 @@ #define UV_VERSION_MAJOR 0 #define UV_VERSION_MINOR 10 -#define UV_VERSION_PATCH 30 -#define UV_VERSION_IS_RELEASE 1 +#define UV_VERSION_PATCH 31 +#define UV_VERSION_IS_RELEASE 0 #define UV_VERSION ((UV_VERSION_MAJOR << 16) | \