visaljs 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/cli.js +155 -27
- package/node/include/js_node.h +2 -0
- package/node/prelude/async_hooks.js +0 -0
- package/node/prelude/buffer.js +0 -0
- package/node/prelude/events.js +0 -0
- package/node/prelude/fs.js +0 -0
- package/node/prelude/http2.js +0 -0
- package/node/prelude/internal/crypto/asym.js +0 -0
- package/node/prelude/internal/crypto/cipher.js +0 -0
- package/node/prelude/internal/crypto/kdf.js +0 -0
- package/node/prelude/internal/crypto/keys.js +0 -0
- package/node/prelude/internal/crypto/random.js +0 -0
- package/node/prelude/internal/crypto/util.js +0 -0
- package/node/prelude/internal/errors.js +0 -0
- package/node/prelude/internal/querystring.js +0 -0
- package/node/prelude/internal/tls/wrap.js +5 -2
- package/node/prelude/module.js +0 -0
- package/node/prelude/net.js +1 -2
- package/node/prelude/os.js +2 -2
- package/node/prelude/path.js +0 -0
- package/node/prelude/process.js +0 -0
- package/node/prelude/querystring.js +0 -0
- package/node/prelude/stream.js +0 -0
- package/node/prelude/stream_promises.js +0 -0
- package/node/prelude/stream_web.js +0 -0
- package/node/prelude/string_decoder.js +0 -0
- package/node/prelude/tty.js +0 -0
- package/node/prelude/url.js +0 -0
- package/node/prelude/util.js +0 -0
- package/node/prelude/zlib.js +0 -0
- package/node/src/host_fs.c +10 -2
- package/node/src/host_os.c +0 -0
- package/node/src/host_sys.c +44 -32
- package/node/third_party/libuv/LICENSE +0 -0
- package/node/third_party/libuv/include/uv/aix.h +0 -0
- package/node/third_party/libuv/include/uv/bsd.h +0 -0
- package/node/third_party/libuv/include/uv/darwin.h +0 -0
- package/node/third_party/libuv/include/uv/errno.h +0 -0
- package/node/third_party/libuv/include/uv/linux.h +0 -0
- package/node/third_party/libuv/include/uv/os390.h +0 -0
- package/node/third_party/libuv/include/uv/posix.h +0 -0
- package/node/third_party/libuv/include/uv/sunos.h +0 -0
- package/node/third_party/libuv/include/uv/threadpool.h +0 -0
- package/node/third_party/libuv/include/uv/tree.h +0 -0
- package/node/third_party/libuv/include/uv/unix.h +0 -0
- package/node/third_party/libuv/include/uv/version.h +0 -0
- package/node/third_party/libuv/include/uv/win.h +0 -0
- package/node/third_party/libuv/include/uv.h +0 -0
- package/node/third_party/libuv/src/fs-poll.c +0 -0
- package/node/third_party/libuv/src/heap-inl.h +0 -0
- package/node/third_party/libuv/src/idna.c +0 -0
- package/node/third_party/libuv/src/idna.h +0 -0
- package/node/third_party/libuv/src/inet.c +0 -0
- package/node/third_party/libuv/src/queue.h +0 -0
- package/node/third_party/libuv/src/random.c +0 -0
- package/node/third_party/libuv/src/strscpy.c +0 -0
- package/node/third_party/libuv/src/strscpy.h +0 -0
- package/node/third_party/libuv/src/strtok.c +0 -0
- package/node/third_party/libuv/src/strtok.h +0 -0
- package/node/third_party/libuv/src/thread-common.c +0 -0
- package/node/third_party/libuv/src/threadpool.c +0 -0
- package/node/third_party/libuv/src/timer.c +0 -0
- package/node/third_party/libuv/src/unix/async.c +0 -0
- package/node/third_party/libuv/src/unix/bsd-ifaddrs.c +0 -0
- package/node/third_party/libuv/src/unix/core.c +0 -0
- package/node/third_party/libuv/src/unix/darwin-proctitle.c +0 -0
- package/node/third_party/libuv/src/unix/darwin-stub.h +0 -0
- package/node/third_party/libuv/src/unix/darwin-syscalls.h +0 -0
- package/node/third_party/libuv/src/unix/darwin.c +0 -0
- package/node/third_party/libuv/src/unix/dl.c +0 -0
- package/node/third_party/libuv/src/unix/fs.c +0 -0
- package/node/third_party/libuv/src/unix/fsevents.c +0 -0
- package/node/third_party/libuv/src/unix/getaddrinfo.c +0 -0
- package/node/third_party/libuv/src/unix/getnameinfo.c +0 -0
- package/node/third_party/libuv/src/unix/internal.h +0 -0
- package/node/third_party/libuv/src/unix/kqueue.c +0 -0
- package/node/third_party/libuv/src/unix/linux.c +0 -0
- package/node/third_party/libuv/src/unix/loop-watcher.c +0 -0
- package/node/third_party/libuv/src/unix/loop.c +0 -0
- package/node/third_party/libuv/src/unix/pipe.c +0 -0
- package/node/third_party/libuv/src/unix/poll.c +0 -0
- package/node/third_party/libuv/src/unix/process.c +0 -0
- package/node/third_party/libuv/src/unix/procfs-exepath.c +0 -0
- package/node/third_party/libuv/src/unix/proctitle.c +0 -0
- package/node/third_party/libuv/src/unix/random-devurandom.c +0 -0
- package/node/third_party/libuv/src/unix/random-getentropy.c +0 -0
- package/node/third_party/libuv/src/unix/random-getrandom.c +0 -0
- package/node/third_party/libuv/src/unix/random-sysctl-linux.c +0 -0
- package/node/third_party/libuv/src/unix/signal.c +0 -0
- package/node/third_party/libuv/src/unix/stream.c +0 -0
- package/node/third_party/libuv/src/unix/tcp.c +0 -0
- package/node/third_party/libuv/src/unix/thread.c +0 -0
- package/node/third_party/libuv/src/unix/tty.c +0 -0
- package/node/third_party/libuv/src/unix/udp.c +0 -0
- package/node/third_party/libuv/src/uv-common.c +0 -0
- package/node/third_party/libuv/src/uv-common.h +0 -0
- package/node/third_party/libuv/src/uv-data-getter-setters.c +0 -0
- package/node/third_party/libuv/src/version.c +0 -0
- package/node/third_party/libuv/src/win/async.c +98 -0
- package/node/third_party/libuv/src/win/atomicops-inl.h +61 -0
- package/node/third_party/libuv/src/win/core.c +683 -0
- package/node/third_party/libuv/src/win/detect-wakeup.c +56 -0
- package/node/third_party/libuv/src/win/dl.c +135 -0
- package/node/third_party/libuv/src/win/error.c +183 -0
- package/node/third_party/libuv/src/win/fs-event.c +620 -0
- package/node/third_party/libuv/src/win/fs-fd-hash-inl.h +200 -0
- package/node/third_party/libuv/src/win/fs.c +3774 -0
- package/node/third_party/libuv/src/win/getaddrinfo.c +388 -0
- package/node/third_party/libuv/src/win/getnameinfo.c +146 -0
- package/node/third_party/libuv/src/win/handle-inl.h +180 -0
- package/node/third_party/libuv/src/win/handle.c +162 -0
- package/node/third_party/libuv/src/win/internal.h +335 -0
- package/node/third_party/libuv/src/win/loop-watcher.c +122 -0
- package/node/third_party/libuv/src/win/pipe.c +2725 -0
- package/node/third_party/libuv/src/win/poll.c +586 -0
- package/node/third_party/libuv/src/win/process-stdio.c +419 -0
- package/node/third_party/libuv/src/win/process.c +1407 -0
- package/node/third_party/libuv/src/win/req-inl.h +214 -0
- package/node/third_party/libuv/src/win/signal.c +282 -0
- package/node/third_party/libuv/src/win/snprintf.c +42 -0
- package/node/third_party/libuv/src/win/stream-inl.h +54 -0
- package/node/third_party/libuv/src/win/stream.c +252 -0
- package/node/third_party/libuv/src/win/tcp.c +1674 -0
- package/node/third_party/libuv/src/win/thread.c +568 -0
- package/node/third_party/libuv/src/win/tty.c +2460 -0
- package/node/third_party/libuv/src/win/udp.c +1162 -0
- package/node/third_party/libuv/src/win/util.c +1750 -0
- package/node/third_party/libuv/src/win/winapi.c +144 -0
- package/node/third_party/libuv/src/win/winapi.h +4831 -0
- package/node/third_party/libuv/src/win/winsock.c +575 -0
- package/node/third_party/libuv/src/win/winsock.h +160 -0
- package/node/third_party/llhttp/LICENSE +0 -0
- package/node/third_party/llhttp/api.c +0 -0
- package/node/third_party/llhttp/http.c +0 -0
- package/node/third_party/llhttp/llhttp.c +0 -0
- package/node/third_party/llhttp/llhttp.h +0 -0
- package/package.json +1 -1
- package/runtime/include/js_atoms.gen.h +0 -0
- package/runtime/include/js_atoms.h +0 -0
- package/runtime/include/js_bigint.h +0 -0
- package/runtime/include/js_buffer.h +0 -0
- package/runtime/include/js_builtins.h +0 -0
- package/runtime/include/js_console.h +0 -0
- package/runtime/include/js_convert.h +0 -0
- package/runtime/include/js_core.def +0 -0
- package/runtime/include/js_error.h +0 -0
- package/runtime/include/js_exception.h +0 -0
- package/runtime/include/js_function.h +0 -0
- package/runtime/include/js_gc.h +0 -0
- package/runtime/include/js_generator.h +0 -0
- package/runtime/include/js_host.h +0 -0
- package/runtime/include/js_jobs.h +0 -0
- package/runtime/include/js_module.h +0 -0
- package/runtime/include/js_object.h +0 -0
- package/runtime/include/js_ops.h +0 -0
- package/runtime/include/js_promise.h +0 -0
- package/runtime/include/js_regexp.h +0 -0
- package/runtime/include/js_runtime.h +0 -0
- package/runtime/include/js_symbol.h +0 -0
- package/runtime/include/js_web.h +0 -0
- package/runtime/include/jscell.h +0 -0
- package/runtime/include/jscontext.h +0 -0
- package/runtime/include/jsnum.h +0 -0
- package/runtime/include/jsstring.h +0 -0
- package/runtime/include/jsvalue.h +0 -0
- package/runtime/src/arguments.c +0 -0
- package/runtime/src/array.c +0 -0
- package/runtime/src/arraybuffer.c +0 -0
- package/runtime/src/async_iter.c +0 -0
- package/runtime/src/atoms.c +0 -0
- package/runtime/src/base64.c +0 -0
- package/runtime/src/bigint.c +0 -0
- package/runtime/src/blob.c +0 -0
- package/runtime/src/boringssl_support.cc +4 -1
- package/runtime/src/buffer.c +0 -0
- package/runtime/src/builtin_table.c +0 -0
- package/runtime/src/builtins.c +0 -0
- package/runtime/src/builtins_util.h +0 -0
- package/runtime/src/collections.c +0 -0
- package/runtime/src/components.c +0 -0
- package/runtime/src/console.c +0 -0
- package/runtime/src/convert.c +0 -0
- package/runtime/src/core_all.c +0 -0
- package/runtime/src/crypto.c +0 -0
- package/runtime/src/crypto_host.c +0 -0
- package/runtime/src/crypto_kdf.c +0 -0
- package/runtime/src/crypto_key.c +0 -0
- package/runtime/src/date.c +0 -0
- package/runtime/src/domexception.c +0 -0
- package/runtime/src/elements.c +0 -0
- package/runtime/src/elements.h +0 -0
- package/runtime/src/encoding.c +0 -0
- package/runtime/src/error.c +0 -0
- package/runtime/src/events.c +0 -0
- package/runtime/src/exception.c +0 -0
- package/runtime/src/fetch.c +0 -0
- package/runtime/src/function.c +0 -0
- package/runtime/src/gc.c +0 -0
- package/runtime/src/generator.c +0 -0
- package/runtime/src/global.c +0 -0
- package/runtime/src/headers.c +0 -0
- package/runtime/src/inspect.c +0 -0
- package/runtime/src/internal.h +0 -0
- package/runtime/src/iterate.c +0 -0
- package/runtime/src/iterator.c +0 -0
- package/runtime/src/jobs.c +0 -0
- package/runtime/src/jsnum.c +0 -0
- package/runtime/src/json.c +0 -0
- package/runtime/src/math.c +0 -0
- package/runtime/src/module.c +0 -0
- package/runtime/src/number.c +0 -0
- package/runtime/src/object.c +0 -0
- package/runtime/src/ops.c +0 -0
- package/runtime/src/os.c +0 -0
- package/runtime/src/os.h +0 -0
- package/runtime/src/process.c +7 -0
- package/runtime/src/promise.c +0 -0
- package/runtime/src/proxy.c +0 -0
- package/runtime/src/reflect.c +0 -0
- package/runtime/src/regexp.c +0 -0
- package/runtime/src/regexp_anchor.h +0 -0
- package/runtime/src/regexp_message.h +0 -0
- package/runtime/src/shape.c +0 -0
- package/runtime/src/shape.h +0 -0
- package/runtime/src/streams.c +0 -0
- package/runtime/src/streams.h +0 -0
- package/runtime/src/string.c +0 -0
- package/runtime/src/string_builtins.c +0 -0
- package/runtime/src/symbol.c +0 -0
- package/runtime/src/test_host.c +0 -0
- package/runtime/src/typedarray.c +0 -0
- package/runtime/src/tznames.gen.h +0 -0
- package/runtime/src/uri.c +0 -0
- package/runtime/src/url.c +0 -0
- package/runtime/src/weak.c +0 -0
- package/runtime/src/web.c +0 -0
- package/runtime/src/wrapper.c +0 -0
- package/runtime/src/writable.c +0 -0
- package/runtime/third_party/ada-idna/LICENSE-MIT +0 -0
- package/runtime/third_party/ada-idna/README.md +0 -0
- package/runtime/third_party/ada-idna/convert.mjs +0 -0
- package/runtime/third_party/ada-idna/idna.c +0 -0
- package/runtime/third_party/ada-idna/idna.h +0 -0
- package/runtime/third_party/ada-idna/idna_tables.h +0 -0
- package/runtime/third_party/quickjs-dtoa/LICENSE +0 -0
- package/runtime/third_party/quickjs-dtoa/README.md +0 -0
- package/runtime/third_party/quickjs-dtoa/dtoa.c +0 -0
- package/runtime/third_party/quickjs-dtoa/dtoa.h +0 -0
- package/runtime/third_party/quickjs-dtoa/dtoa_compat.h +0 -0
- package/runtime/third_party/quickjs-regexp/LICENSE +0 -0
- package/runtime/third_party/quickjs-regexp/README.md +0 -0
- package/runtime/third_party/quickjs-regexp/cutils.c +0 -0
- package/runtime/third_party/quickjs-regexp/cutils.h +0 -0
- package/runtime/third_party/quickjs-regexp/libregexp-opcode.h +0 -0
- package/runtime/third_party/quickjs-regexp/libregexp.c +0 -0
- package/runtime/third_party/quickjs-regexp/libregexp.h +0 -0
- package/runtime/third_party/quickjs-regexp/libunicode-table.h +0 -0
- package/runtime/third_party/quickjs-regexp/libunicode.c +0 -0
- package/runtime/third_party/quickjs-regexp/libunicode.h +0 -0
- package/runtime/third_party/v8-ieee754/LICENSE +0 -0
- package/runtime/third_party/v8-ieee754/README.md +0 -0
- package/runtime/third_party/v8-ieee754/convert.py +0 -0
- package/runtime/third_party/v8-ieee754/ieee754.c +0 -0
- package/runtime/third_party/v8-ieee754/ieee754.h +0 -0
- package/runtime/tools/regexp_compile.c +0 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
* of this software and associated documentation files (the "Software"), to
|
|
5
|
+
* deal in the Software without restriction, including without limitation the
|
|
6
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
7
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
* furnished to do so, subject to the following conditions:
|
|
9
|
+
*
|
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
|
11
|
+
* all copies or substantial portions of the Software.
|
|
12
|
+
*
|
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
18
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
19
|
+
* IN THE SOFTWARE.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#ifndef UV_WIN_REQ_INL_H_
|
|
23
|
+
#define UV_WIN_REQ_INL_H_
|
|
24
|
+
|
|
25
|
+
#include <assert.h>
|
|
26
|
+
|
|
27
|
+
#include "uv.h"
|
|
28
|
+
#include "internal.h"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
#define SET_REQ_STATUS(req, status) \
|
|
32
|
+
(req)->u.io.overlapped.Internal = (ULONG_PTR) (status)
|
|
33
|
+
|
|
34
|
+
#define SET_REQ_ERROR(req, error) \
|
|
35
|
+
SET_REQ_STATUS((req), NTSTATUS_FROM_WIN32((error)))
|
|
36
|
+
|
|
37
|
+
/* Note: used open-coded in UV_REQ_INIT() because of a circular dependency
|
|
38
|
+
* between src/uv-common.h and src/win/internal.h.
|
|
39
|
+
*/
|
|
40
|
+
#define SET_REQ_SUCCESS(req) \
|
|
41
|
+
SET_REQ_STATUS((req), STATUS_SUCCESS)
|
|
42
|
+
|
|
43
|
+
#define GET_REQ_STATUS(req) \
|
|
44
|
+
((NTSTATUS) (req)->u.io.overlapped.Internal)
|
|
45
|
+
|
|
46
|
+
#define REQ_SUCCESS(req) \
|
|
47
|
+
(NT_SUCCESS(GET_REQ_STATUS((req))))
|
|
48
|
+
|
|
49
|
+
#define GET_REQ_ERROR(req) \
|
|
50
|
+
(pRtlNtStatusToDosError(GET_REQ_STATUS((req))))
|
|
51
|
+
|
|
52
|
+
#define GET_REQ_SOCK_ERROR(req) \
|
|
53
|
+
(uv__ntstatus_to_winsock_error(GET_REQ_STATUS((req))))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
#define REGISTER_HANDLE_REQ(loop, handle) \
|
|
57
|
+
do { \
|
|
58
|
+
INCREASE_ACTIVE_COUNT((loop), (handle)); \
|
|
59
|
+
uv__req_register((loop)); \
|
|
60
|
+
} while (0)
|
|
61
|
+
|
|
62
|
+
#define UNREGISTER_HANDLE_REQ(loop, handle) \
|
|
63
|
+
do { \
|
|
64
|
+
DECREASE_ACTIVE_COUNT((loop), (handle)); \
|
|
65
|
+
uv__req_unregister((loop)); \
|
|
66
|
+
} while (0)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
#define UV_SUCCEEDED_WITHOUT_IOCP(result) \
|
|
70
|
+
((result) && (handle->flags & UV_HANDLE_SYNC_BYPASS_IOCP))
|
|
71
|
+
|
|
72
|
+
#define UV_SUCCEEDED_WITH_IOCP(result) \
|
|
73
|
+
((result) || (GetLastError() == ERROR_IO_PENDING))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
#define POST_COMPLETION_FOR_REQ(loop, req) \
|
|
77
|
+
if (!PostQueuedCompletionStatus((loop)->iocp, \
|
|
78
|
+
0, \
|
|
79
|
+
0, \
|
|
80
|
+
&((req)->u.io.overlapped))) { \
|
|
81
|
+
uv_fatal_error(GetLastError(), "PostQueuedCompletionStatus"); \
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
INLINE static uv_req_t* uv__overlapped_to_req(OVERLAPPED* overlapped) {
|
|
86
|
+
return container_of(overlapped, uv_req_t, u.io.overlapped);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
INLINE static void uv__insert_pending_req(uv_loop_t* loop, uv_req_t* req) {
|
|
91
|
+
req->next_req = NULL;
|
|
92
|
+
if (loop->pending_reqs_tail) {
|
|
93
|
+
#ifdef _DEBUG
|
|
94
|
+
/* Ensure the request is not already in the queue, or the queue
|
|
95
|
+
* will get corrupted.
|
|
96
|
+
*/
|
|
97
|
+
uv_req_t* current = loop->pending_reqs_tail;
|
|
98
|
+
do {
|
|
99
|
+
assert(req != current);
|
|
100
|
+
current = current->next_req;
|
|
101
|
+
} while(current != loop->pending_reqs_tail);
|
|
102
|
+
#endif
|
|
103
|
+
|
|
104
|
+
req->next_req = loop->pending_reqs_tail->next_req;
|
|
105
|
+
loop->pending_reqs_tail->next_req = req;
|
|
106
|
+
loop->pending_reqs_tail = req;
|
|
107
|
+
} else {
|
|
108
|
+
req->next_req = req;
|
|
109
|
+
loop->pending_reqs_tail = req;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
#define DELEGATE_STREAM_REQ(loop, req, method, handle_at) \
|
|
115
|
+
do { \
|
|
116
|
+
switch (((uv_handle_t*) (req)->handle_at)->type) { \
|
|
117
|
+
case UV_TCP: \
|
|
118
|
+
uv__process_tcp_##method##_req(loop, \
|
|
119
|
+
(uv_tcp_t*) ((req)->handle_at), \
|
|
120
|
+
req); \
|
|
121
|
+
break; \
|
|
122
|
+
\
|
|
123
|
+
case UV_NAMED_PIPE: \
|
|
124
|
+
uv__process_pipe_##method##_req(loop, \
|
|
125
|
+
(uv_pipe_t*) ((req)->handle_at), \
|
|
126
|
+
req); \
|
|
127
|
+
break; \
|
|
128
|
+
\
|
|
129
|
+
case UV_TTY: \
|
|
130
|
+
uv__process_tty_##method##_req(loop, \
|
|
131
|
+
(uv_tty_t*) ((req)->handle_at), \
|
|
132
|
+
req); \
|
|
133
|
+
break; \
|
|
134
|
+
\
|
|
135
|
+
default: \
|
|
136
|
+
assert(0); \
|
|
137
|
+
} \
|
|
138
|
+
} while (0)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
INLINE static void uv__process_reqs(uv_loop_t* loop) {
|
|
142
|
+
uv_req_t* req;
|
|
143
|
+
uv_req_t* first;
|
|
144
|
+
uv_req_t* next;
|
|
145
|
+
|
|
146
|
+
if (loop->pending_reqs_tail == NULL)
|
|
147
|
+
return;
|
|
148
|
+
|
|
149
|
+
first = loop->pending_reqs_tail->next_req;
|
|
150
|
+
next = first;
|
|
151
|
+
loop->pending_reqs_tail = NULL;
|
|
152
|
+
|
|
153
|
+
while (next != NULL) {
|
|
154
|
+
req = next;
|
|
155
|
+
next = req->next_req != first ? req->next_req : NULL;
|
|
156
|
+
|
|
157
|
+
switch (req->type) {
|
|
158
|
+
case UV_READ:
|
|
159
|
+
DELEGATE_STREAM_REQ(loop, req, read, data);
|
|
160
|
+
break;
|
|
161
|
+
|
|
162
|
+
case UV_WRITE:
|
|
163
|
+
DELEGATE_STREAM_REQ(loop, (uv_write_t*) req, write, handle);
|
|
164
|
+
break;
|
|
165
|
+
|
|
166
|
+
case UV_ACCEPT:
|
|
167
|
+
DELEGATE_STREAM_REQ(loop, req, accept, data);
|
|
168
|
+
break;
|
|
169
|
+
|
|
170
|
+
case UV_CONNECT:
|
|
171
|
+
DELEGATE_STREAM_REQ(loop, (uv_connect_t*) req, connect, handle);
|
|
172
|
+
break;
|
|
173
|
+
|
|
174
|
+
case UV_SHUTDOWN:
|
|
175
|
+
DELEGATE_STREAM_REQ(loop, (uv_shutdown_t*) req, shutdown, handle);
|
|
176
|
+
break;
|
|
177
|
+
|
|
178
|
+
case UV_UDP_RECV:
|
|
179
|
+
uv__process_udp_recv_req(loop, (uv_udp_t*) req->data, req);
|
|
180
|
+
break;
|
|
181
|
+
|
|
182
|
+
case UV_UDP_SEND:
|
|
183
|
+
uv__process_udp_send_req(loop,
|
|
184
|
+
((uv_udp_send_t*) req)->handle,
|
|
185
|
+
(uv_udp_send_t*) req);
|
|
186
|
+
break;
|
|
187
|
+
|
|
188
|
+
case UV_WAKEUP:
|
|
189
|
+
uv__process_async_wakeup_req(loop, (uv_async_t*) req->data, req);
|
|
190
|
+
break;
|
|
191
|
+
|
|
192
|
+
case UV_SIGNAL_REQ:
|
|
193
|
+
uv__process_signal_req(loop, (uv_signal_t*) req->data, req);
|
|
194
|
+
break;
|
|
195
|
+
|
|
196
|
+
case UV_POLL_REQ:
|
|
197
|
+
uv__process_poll_req(loop, (uv_poll_t*) req->data, req);
|
|
198
|
+
break;
|
|
199
|
+
|
|
200
|
+
case UV_PROCESS_EXIT:
|
|
201
|
+
uv__process_proc_exit(loop, (uv_process_t*) req->data);
|
|
202
|
+
break;
|
|
203
|
+
|
|
204
|
+
case UV_FS_EVENT_REQ:
|
|
205
|
+
uv__process_fs_event_req(loop, req, (uv_fs_event_t*) req->data);
|
|
206
|
+
break;
|
|
207
|
+
|
|
208
|
+
default:
|
|
209
|
+
assert(0);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
#endif /* UV_WIN_REQ_INL_H_ */
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|
2
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3
|
+
* of this software and associated documentation files (the "Software"), to
|
|
4
|
+
* deal in the Software without restriction, including without limitation the
|
|
5
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
6
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
|
7
|
+
* furnished to do so, subject to the following conditions:
|
|
8
|
+
*
|
|
9
|
+
* The above copyright notice and this permission notice shall be included in
|
|
10
|
+
* all copies or substantial portions of the Software.
|
|
11
|
+
*
|
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
17
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
18
|
+
* IN THE SOFTWARE.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
#include <assert.h>
|
|
22
|
+
#include <signal.h>
|
|
23
|
+
|
|
24
|
+
#include "uv.h"
|
|
25
|
+
#include "internal.h"
|
|
26
|
+
#include "handle-inl.h"
|
|
27
|
+
#include "req-inl.h"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
RB_HEAD(uv_signal_tree_s, uv_signal_s);
|
|
31
|
+
|
|
32
|
+
static struct uv_signal_tree_s uv__signal_tree = RB_INITIALIZER(uv__signal_tree);
|
|
33
|
+
static CRITICAL_SECTION uv__signal_lock;
|
|
34
|
+
|
|
35
|
+
static BOOL WINAPI uv__signal_control_handler(DWORD type);
|
|
36
|
+
|
|
37
|
+
int uv__signal_start(uv_signal_t* handle,
|
|
38
|
+
uv_signal_cb signal_cb,
|
|
39
|
+
int signum,
|
|
40
|
+
int oneshot);
|
|
41
|
+
|
|
42
|
+
void uv__signals_init(void) {
|
|
43
|
+
InitializeCriticalSection(&uv__signal_lock);
|
|
44
|
+
if (!SetConsoleCtrlHandler(uv__signal_control_handler, TRUE))
|
|
45
|
+
abort();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
void uv__signal_cleanup(void) {
|
|
50
|
+
/* TODO(bnoordhuis) Undo effects of uv_signal_init()? */
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
static int uv__signal_compare(uv_signal_t* w1, uv_signal_t* w2) {
|
|
55
|
+
/* Compare signums first so all watchers with the same signnum end up
|
|
56
|
+
* adjacent. */
|
|
57
|
+
if (w1->signum < w2->signum) return -1;
|
|
58
|
+
if (w1->signum > w2->signum) return 1;
|
|
59
|
+
|
|
60
|
+
/* Sort by loop pointer, so we can easily look up the first item after
|
|
61
|
+
* { .signum = x, .loop = NULL }. */
|
|
62
|
+
if ((uintptr_t) w1->loop < (uintptr_t) w2->loop) return -1;
|
|
63
|
+
if ((uintptr_t) w1->loop > (uintptr_t) w2->loop) return 1;
|
|
64
|
+
|
|
65
|
+
if ((uintptr_t) w1 < (uintptr_t) w2) return -1;
|
|
66
|
+
if ((uintptr_t) w1 > (uintptr_t) w2) return 1;
|
|
67
|
+
|
|
68
|
+
return 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
RB_GENERATE_STATIC(uv_signal_tree_s, uv_signal_s, tree_entry, uv__signal_compare)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
/*
|
|
76
|
+
* Dispatches signal {signum} to all active uv_signal_t watchers in all loops.
|
|
77
|
+
* Returns 1 if the signal was dispatched to any watcher, or 0 if there were
|
|
78
|
+
* no active signal watchers observing this signal.
|
|
79
|
+
*/
|
|
80
|
+
int uv__signal_dispatch(int signum) {
|
|
81
|
+
uv_signal_t lookup;
|
|
82
|
+
uv_signal_t* handle;
|
|
83
|
+
int dispatched;
|
|
84
|
+
|
|
85
|
+
dispatched = 0;
|
|
86
|
+
|
|
87
|
+
EnterCriticalSection(&uv__signal_lock);
|
|
88
|
+
|
|
89
|
+
lookup.signum = signum;
|
|
90
|
+
lookup.loop = NULL;
|
|
91
|
+
|
|
92
|
+
for (handle = RB_NFIND(uv_signal_tree_s, &uv__signal_tree, &lookup);
|
|
93
|
+
handle != NULL && handle->signum == signum;
|
|
94
|
+
handle = RB_NEXT(uv_signal_tree_s, handle)) {
|
|
95
|
+
unsigned long previous = InterlockedExchange(
|
|
96
|
+
(volatile LONG*) &handle->pending_signum, signum);
|
|
97
|
+
|
|
98
|
+
if (handle->flags & UV_SIGNAL_ONE_SHOT_DISPATCHED)
|
|
99
|
+
continue;
|
|
100
|
+
|
|
101
|
+
if (!previous) {
|
|
102
|
+
POST_COMPLETION_FOR_REQ(handle->loop, &handle->signal_req);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
dispatched = 1;
|
|
106
|
+
if (handle->flags & UV_SIGNAL_ONE_SHOT)
|
|
107
|
+
handle->flags |= UV_SIGNAL_ONE_SHOT_DISPATCHED;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
LeaveCriticalSection(&uv__signal_lock);
|
|
111
|
+
|
|
112
|
+
return dispatched;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
static BOOL WINAPI uv__signal_control_handler(DWORD type) {
|
|
117
|
+
switch (type) {
|
|
118
|
+
case CTRL_C_EVENT:
|
|
119
|
+
return uv__signal_dispatch(SIGINT);
|
|
120
|
+
|
|
121
|
+
case CTRL_BREAK_EVENT:
|
|
122
|
+
return uv__signal_dispatch(SIGBREAK);
|
|
123
|
+
|
|
124
|
+
case CTRL_CLOSE_EVENT:
|
|
125
|
+
if (uv__signal_dispatch(SIGHUP)) {
|
|
126
|
+
/* Windows will terminate the process after the control handler
|
|
127
|
+
* returns. After that it will just terminate our process. Therefore
|
|
128
|
+
* block the signal handler so the main loop has some time to pick up
|
|
129
|
+
* the signal and do something for a few seconds. */
|
|
130
|
+
Sleep(INFINITE);
|
|
131
|
+
return TRUE;
|
|
132
|
+
}
|
|
133
|
+
return FALSE;
|
|
134
|
+
|
|
135
|
+
case CTRL_LOGOFF_EVENT:
|
|
136
|
+
case CTRL_SHUTDOWN_EVENT:
|
|
137
|
+
/* These signals are only sent to services. Services have their own
|
|
138
|
+
* notification mechanism, so there's no point in handling these. */
|
|
139
|
+
|
|
140
|
+
default:
|
|
141
|
+
/* We don't handle these. */
|
|
142
|
+
return FALSE;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle) {
|
|
148
|
+
uv__handle_init(loop, (uv_handle_t*) handle, UV_SIGNAL);
|
|
149
|
+
handle->pending_signum = 0;
|
|
150
|
+
handle->signum = 0;
|
|
151
|
+
handle->signal_cb = NULL;
|
|
152
|
+
|
|
153
|
+
UV_REQ_INIT(&handle->signal_req, UV_SIGNAL_REQ);
|
|
154
|
+
handle->signal_req.data = handle;
|
|
155
|
+
|
|
156
|
+
return 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
int uv_signal_stop(uv_signal_t* handle) {
|
|
161
|
+
uv_signal_t* removed_handle;
|
|
162
|
+
|
|
163
|
+
/* If the watcher wasn't started, this is a no-op. */
|
|
164
|
+
if (handle->signum == 0)
|
|
165
|
+
return 0;
|
|
166
|
+
|
|
167
|
+
EnterCriticalSection(&uv__signal_lock);
|
|
168
|
+
|
|
169
|
+
removed_handle = RB_REMOVE(uv_signal_tree_s, &uv__signal_tree, handle);
|
|
170
|
+
assert(removed_handle == handle);
|
|
171
|
+
|
|
172
|
+
LeaveCriticalSection(&uv__signal_lock);
|
|
173
|
+
|
|
174
|
+
handle->signum = 0;
|
|
175
|
+
uv__handle_stop(handle);
|
|
176
|
+
|
|
177
|
+
return 0;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
int uv_signal_start(uv_signal_t* handle, uv_signal_cb signal_cb, int signum) {
|
|
182
|
+
return uv__signal_start(handle, signal_cb, signum, 0);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
int uv_signal_start_oneshot(uv_signal_t* handle,
|
|
187
|
+
uv_signal_cb signal_cb,
|
|
188
|
+
int signum) {
|
|
189
|
+
return uv__signal_start(handle, signal_cb, signum, 1);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
int uv__signal_start(uv_signal_t* handle,
|
|
194
|
+
uv_signal_cb signal_cb,
|
|
195
|
+
int signum,
|
|
196
|
+
int oneshot) {
|
|
197
|
+
/* Test for invalid signal values. */
|
|
198
|
+
if (signum <= 0 || signum >= NSIG)
|
|
199
|
+
return UV_EINVAL;
|
|
200
|
+
|
|
201
|
+
/* Short circuit: if the signal watcher is already watching {signum} don't go
|
|
202
|
+
* through the process of deregistering and registering the handler.
|
|
203
|
+
* Additionally, this avoids pending signals getting lost in the (small) time
|
|
204
|
+
* frame that handle->signum == 0. */
|
|
205
|
+
if (signum == handle->signum) {
|
|
206
|
+
handle->signal_cb = signal_cb;
|
|
207
|
+
return 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* If the signal handler was already active, stop it first. */
|
|
211
|
+
if (handle->signum != 0) {
|
|
212
|
+
int r = uv_signal_stop(handle);
|
|
213
|
+
/* uv_signal_stop is infallible. */
|
|
214
|
+
assert(r == 0);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
EnterCriticalSection(&uv__signal_lock);
|
|
218
|
+
|
|
219
|
+
handle->signum = signum;
|
|
220
|
+
if (oneshot)
|
|
221
|
+
handle->flags |= UV_SIGNAL_ONE_SHOT;
|
|
222
|
+
|
|
223
|
+
RB_INSERT(uv_signal_tree_s, &uv__signal_tree, handle);
|
|
224
|
+
|
|
225
|
+
LeaveCriticalSection(&uv__signal_lock);
|
|
226
|
+
|
|
227
|
+
handle->signal_cb = signal_cb;
|
|
228
|
+
uv__handle_start(handle);
|
|
229
|
+
|
|
230
|
+
return 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
void uv__process_signal_req(uv_loop_t* loop, uv_signal_t* handle,
|
|
235
|
+
uv_req_t* req) {
|
|
236
|
+
long dispatched_signum;
|
|
237
|
+
|
|
238
|
+
assert(handle->type == UV_SIGNAL);
|
|
239
|
+
assert(req->type == UV_SIGNAL_REQ);
|
|
240
|
+
|
|
241
|
+
dispatched_signum = InterlockedExchange(
|
|
242
|
+
(volatile LONG*) &handle->pending_signum, 0);
|
|
243
|
+
assert(dispatched_signum != 0);
|
|
244
|
+
|
|
245
|
+
/* Check if the pending signal equals the signum that we are watching for.
|
|
246
|
+
* These can get out of sync when the handler is stopped and restarted while
|
|
247
|
+
* the signal_req is pending. */
|
|
248
|
+
if (dispatched_signum == handle->signum)
|
|
249
|
+
handle->signal_cb(handle, dispatched_signum);
|
|
250
|
+
|
|
251
|
+
if (handle->flags & UV_SIGNAL_ONE_SHOT)
|
|
252
|
+
uv_signal_stop(handle);
|
|
253
|
+
|
|
254
|
+
if (handle->flags & UV_HANDLE_CLOSING) {
|
|
255
|
+
/* When it is closing, it must be stopped at this point. */
|
|
256
|
+
assert(handle->signum == 0);
|
|
257
|
+
uv__want_endgame(loop, (uv_handle_t*) handle);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
void uv__signal_close(uv_loop_t* loop, uv_signal_t* handle) {
|
|
263
|
+
uv_signal_stop(handle);
|
|
264
|
+
uv__handle_closing(handle);
|
|
265
|
+
|
|
266
|
+
if (handle->pending_signum == 0) {
|
|
267
|
+
uv__want_endgame(loop, (uv_handle_t*) handle);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
void uv__signal_endgame(uv_loop_t* loop, uv_signal_t* handle) {
|
|
273
|
+
assert(handle->flags & UV_HANDLE_CLOSING);
|
|
274
|
+
assert(!(handle->flags & UV_HANDLE_CLOSED));
|
|
275
|
+
|
|
276
|
+
assert(handle->signum == 0);
|
|
277
|
+
assert(handle->pending_signum == 0);
|
|
278
|
+
|
|
279
|
+
handle->flags |= UV_HANDLE_CLOSED;
|
|
280
|
+
|
|
281
|
+
uv__handle_close(handle);
|
|
282
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* Copyright the libuv project contributors. All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
* of this software and associated documentation files (the "Software"), to
|
|
5
|
+
* deal in the Software without restriction, including without limitation the
|
|
6
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
7
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
* furnished to do so, subject to the following conditions:
|
|
9
|
+
*
|
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
|
11
|
+
* all copies or substantial portions of the Software.
|
|
12
|
+
*
|
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
18
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
19
|
+
* IN THE SOFTWARE.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#if defined(_MSC_VER) && _MSC_VER < 1900
|
|
23
|
+
|
|
24
|
+
#include <stdio.h>
|
|
25
|
+
#include <stdarg.h>
|
|
26
|
+
|
|
27
|
+
/* Emulate snprintf() on MSVC<2015, _snprintf() doesn't zero-terminate the buffer
|
|
28
|
+
* on overflow...
|
|
29
|
+
*/
|
|
30
|
+
int snprintf(char* buf, size_t len, const char* fmt, ...) {
|
|
31
|
+
int n;
|
|
32
|
+
va_list ap;
|
|
33
|
+
va_start(ap, fmt);
|
|
34
|
+
|
|
35
|
+
n = _vscprintf(fmt, ap);
|
|
36
|
+
vsnprintf_s(buf, len, _TRUNCATE, fmt, ap);
|
|
37
|
+
|
|
38
|
+
va_end(ap);
|
|
39
|
+
return n;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#endif
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|
2
|
+
*
|
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
* of this software and associated documentation files (the "Software"), to
|
|
5
|
+
* deal in the Software without restriction, including without limitation the
|
|
6
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
7
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
* furnished to do so, subject to the following conditions:
|
|
9
|
+
*
|
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
|
11
|
+
* all copies or substantial portions of the Software.
|
|
12
|
+
*
|
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
18
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
19
|
+
* IN THE SOFTWARE.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#ifndef UV_WIN_STREAM_INL_H_
|
|
23
|
+
#define UV_WIN_STREAM_INL_H_
|
|
24
|
+
|
|
25
|
+
#include <assert.h>
|
|
26
|
+
|
|
27
|
+
#include "uv.h"
|
|
28
|
+
#include "internal.h"
|
|
29
|
+
#include "handle-inl.h"
|
|
30
|
+
#include "req-inl.h"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
INLINE static void uv__stream_init(uv_loop_t* loop,
|
|
34
|
+
uv_stream_t* handle,
|
|
35
|
+
uv_handle_type type) {
|
|
36
|
+
uv__handle_init(loop, (uv_handle_t*) handle, type);
|
|
37
|
+
handle->write_queue_size = 0;
|
|
38
|
+
handle->activecnt = 0;
|
|
39
|
+
handle->stream.conn.shutdown_req = NULL;
|
|
40
|
+
handle->stream.conn.write_reqs_pending = 0;
|
|
41
|
+
|
|
42
|
+
UV_REQ_INIT(&handle->read_req, UV_READ);
|
|
43
|
+
handle->read_req.event_handle = NULL;
|
|
44
|
+
handle->read_req.wait_handle = INVALID_HANDLE_VALUE;
|
|
45
|
+
handle->read_req.data = handle;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
INLINE static void uv__connection_init(uv_stream_t* handle) {
|
|
50
|
+
handle->flags |= UV_HANDLE_CONNECTION;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
#endif /* UV_WIN_STREAM_INL_H_ */
|