Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Upgrade libuv to ea63f06

  • Loading branch information...
commit 7244b9cee8d77144507af6f5d9a71f9af11df888 1 parent a639cf7
@piscisaureus piscisaureus authored
View
1  deps/uv/src/unix/cygwin.c
@@ -24,6 +24,7 @@
#include <stdint.h>
#include <stddef.h>
#include <errno.h>
+#include <unistd.h>
#include <time.h>
#undef NANOSEC
View
2  deps/uv/src/unix/fs.c
@@ -518,11 +518,11 @@ static int _futime(const uv_file file, double atime, double mtime) {
int uv_fs_futime(uv_loop_t* loop, uv_fs_t* req, uv_file file, double atime,
double mtime, uv_fs_cb cb) {
-#if HAVE_FUTIMES
const char* path = NULL;
uv_fs_req_init(loop, req, UV_FS_FUTIME, path, cb);
+#if HAVE_FUTIMES
WRAP_EIO(UV_FS_FUTIME, eio_futime, _futime, ARGS3(file, atime, mtime))
#else
uv__set_sys_error(loop, ENOSYS);
View
4 deps/uv/src/unix/internal.h
@@ -27,6 +27,10 @@
#include <stddef.h> /* offsetof */
+#if __STRICT_ANSI__
+# define inline __inline
+#endif
+
#undef HAVE_FUTIMES
#undef HAVE_PIPE2
#undef HAVE_ACCEPT4
View
40 deps/uv/src/win/udp.c
@@ -466,17 +466,31 @@ void uv_process_udp_recv_req(uv_loop_t* loop, uv_udp_t* handle,
handle->flags &= ~UV_HANDLE_READ_PENDING;
- if (!REQ_SUCCESS(req) &&
- GET_REQ_SOCK_ERROR(req) != WSAEMSGSIZE) {
- /* An error occurred doing the read. */
- if (handle->flags & UV_HANDLE_READING) {
- uv__set_sys_error(loop, GET_REQ_SOCK_ERROR(req));
- uv_udp_recv_stop(handle);
- buf = (handle->flags & UV_HANDLE_ZERO_READ) ?
- uv_buf_init(NULL, 0) : handle->recv_buffer;
- handle->recv_cb(handle, -1, buf, NULL, 0);
+ if (!REQ_SUCCESS(req)) {
+ DWORD err = GET_REQ_SOCK_ERROR(req);
+ if (err == WSAEMSGSIZE) {
+ /* Not a real error, it just indicates that the received packet */
+ /* was bigger than the receive buffer. */
+ } else if (err == WSAECONNRESET || err == WSAENETRESET) {
+ /* A previous sendto operation failed; ignore this error. If */
+ /* zero-reading we need to call WSARecv/WSARecvFrom _without_ the */
+ /* MSG_PEEK flag to clear out the error queue. For nonzero reads, */
+ /* immediately queue a new receive. */
+ if (!(handle->flags & UV_HANDLE_ZERO_READ)) {
+ goto done;
+ }
+ } else {
+ /* A real error occurred. Report the error to the user only if we're */
+ /* currently reading. */
+ if (handle->flags & UV_HANDLE_READING) {
+ uv__set_sys_error(loop, err);
+ uv_udp_recv_stop(handle);
+ buf = (handle->flags & UV_HANDLE_ZERO_READ) ?
+ uv_buf_init(NULL, 0) : handle->recv_buffer;
+ handle->recv_cb(handle, -1, buf, NULL, 0);
+ }
+ goto done;
}
- goto done;
}
if (!(handle->flags & UV_HANDLE_ZERO_READ)) {
@@ -527,8 +541,10 @@ void uv_process_udp_recv_req(uv_loop_t* loop, uv_udp_t* handle,
/* Kernel buffer empty */
uv__set_sys_error(loop, WSAEWOULDBLOCK);
handle->recv_cb(handle, 0, buf, NULL, 0);
- } else {
- /* Ouch! serious error. */
+ } else if (err != WSAECONNRESET && err != WSAENETRESET) {
+ /* Serious error. WSAECONNRESET/WSANETRESET is ignored because this */
+ /* just indicates that a previous sendto operation failed. */
+ uv_udp_recv_stop(handle);
uv__set_sys_error(loop, err);
handle->recv_cb(handle, -1, buf, NULL, 0);
}
View
4 deps/uv/src/win/winsock.c
@@ -144,6 +144,7 @@ int uv_ntstatus_to_winsock_error(NTSTATUS status) {
case STATUS_LINK_FAILED:
case STATUS_CONNECTION_DISCONNECTED:
case STATUS_PORT_UNREACHABLE:
+ case STATUS_HOPLIMIT_EXCEEDED:
return WSAECONNRESET;
case STATUS_LOCAL_DISCONNECT:
@@ -206,7 +207,8 @@ int uv_ntstatus_to_winsock_error(NTSTATUS status) {
return WSAEACCES;
default:
- if (status & ((FACILITY_NTWIN32 << 16) | ERROR_SEVERITY_ERROR)) {
+ if ((status & (FACILITY_NTWIN32 << 16)) == (FACILITY_NTWIN32 << 16) &&
+ (status & (ERROR_SEVERITY_ERROR | ERROR_SEVERITY_WARNING))) {
/* It's a windows error that has been previously mapped to an */
/* ntstatus code. */
return (DWORD) (status & 0xffff);
Please sign in to comment.
Something went wrong with that request. Please try again.