@encharm/cws 4.4.1 → 4.5.1
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/dist/bindings/cws_darwin_arm64_node115.node +0 -0
- package/dist/bindings/cws_darwin_arm64_node127.node +0 -0
- package/dist/bindings/cws_linux_arm64_node115.node +0 -0
- package/dist/bindings/cws_linux_arm64_node127.node +0 -0
- package/dist/bindings/cws_linux_x64_node115.node +0 -0
- package/dist/bindings/cws_linux_x64_node127.node +0 -0
- package/dist/bindings/cws_win32_x64_node108.node +0 -0
- package/dist/bindings/cws_win32_x64_node115.node +0 -0
- package/dist/bindings/cws_win32_x64_node127.node +0 -0
- package/dist/bindings/cws_win32_x64_node83.node +0 -0
- package/dist/bindings/cws_win32_x64_node93.node +0 -0
- package/package.json +1 -1
- package/src/Addon.h +8 -23
- package/src/Socket.h +0 -1
- package/src/headers/22/acorn_version.h +6 -0
- package/src/headers/22/aliased_buffer-inl.h +243 -0
- package/src/headers/22/aliased_buffer.h +206 -0
- package/src/headers/{18 → 22}/async_wrap-inl.h +8 -6
- package/src/headers/{18 → 22}/async_wrap.h +65 -59
- package/src/headers/{16 → 22}/base_object-inl.h +57 -117
- package/src/headers/{18 → 22}/base_object.h +58 -30
- package/src/headers/22/base_object_types.h +74 -0
- package/src/headers/22/blob_serializer_deserializer-inl.h +385 -0
- package/src/headers/22/blob_serializer_deserializer.h +132 -0
- package/src/headers/{16 → 22}/callback_queue.h +1 -0
- package/src/headers/{16 → 22}/cares_wrap.h +27 -20
- package/src/headers/22/cjs_module_lexer_version.h +6 -0
- package/src/headers/22/cleanup_queue-inl.h +62 -0
- package/src/headers/22/cleanup_queue.h +85 -0
- package/src/headers/22/compile_cache.h +104 -0
- package/src/headers/{18 → 22}/crypto/crypto_clienthello.h +1 -1
- package/src/headers/{18 → 22}/crypto/crypto_context.h +31 -7
- package/src/headers/{18 → 22}/crypto/crypto_keys.h +118 -148
- package/src/headers/{18 → 22}/crypto/crypto_tls.h +20 -5
- package/src/headers/{18 → 22}/crypto/crypto_util.h +219 -263
- package/src/headers/22/crypto/ncrypto.h +752 -0
- package/src/headers/{16 → 22}/debug_utils-inl.h +15 -7
- package/src/headers/{18 → 22}/debug_utils.h +25 -19
- package/src/headers/22/encoding_binding.h +59 -0
- package/src/headers/{14 → 22}/env-inl.h +276 -409
- package/src/headers/22/env.h +1266 -0
- package/src/headers/22/env_properties.h +497 -0
- package/src/headers/{18 → 22}/handle_wrap.h +2 -0
- package/src/headers/{18 → 22}/histogram.h +88 -48
- package/src/headers/{16 → 22}/inspector_agent.h +17 -1
- package/src/headers/{16 → 22}/inspector_profiler.h +15 -13
- package/src/headers/{18 → 22}/js_native_api.h +78 -30
- package/src/headers/{18 → 22}/js_native_api_types.h +46 -1
- package/src/headers/{18 → 22}/js_native_api_v8.h +206 -161
- package/src/headers/{18 → 22}/js_native_api_v8_internals.h +6 -0
- package/src/headers/22/json_parser.h +40 -0
- package/src/headers/{16 → 22}/json_utils.h +19 -8
- package/src/headers/{18 → 22}/memory_tracker-inl.h +16 -13
- package/src/headers/{14 → 22}/memory_tracker.h +13 -8
- package/src/headers/{16 → 22}/module_wrap.h +49 -19
- package/src/headers/22/ncrypto/ncrypto.h +752 -0
- package/src/headers/{18 → 22}/node.h +465 -68
- package/src/headers/{18 → 22}/node_api.h +66 -81
- package/src/headers/{18 → 22}/node_api_internals.h +8 -4
- package/src/headers/{18 → 22}/node_api_types.h +5 -0
- package/src/headers/22/node_binding.h +154 -0
- package/src/headers/{18 → 22}/node_blob.h +46 -78
- package/src/headers/{18 → 22}/node_bob-inl.h +1 -2
- package/src/headers/{18 → 22}/node_bob.h +2 -6
- package/src/headers/{18 → 22}/node_buffer.h +1 -1
- package/src/headers/22/node_builtins.h +220 -0
- package/src/headers/{18 → 22}/node_constants.h +3 -5
- package/src/headers/22/node_context_data.h +168 -0
- package/src/headers/22/node_contextify.h +199 -0
- package/src/headers/{16 → 22}/node_crypto.h +1 -2
- package/src/headers/22/node_dotenv.h +45 -0
- package/src/headers/{18 → 22}/node_errors.h +86 -27
- package/src/headers/22/node_exit_code.h +54 -0
- package/src/headers/22/node_external_reference.h +249 -0
- package/src/headers/{18 → 22}/node_file-inl.h +127 -30
- package/src/headers/{16 → 22}/node_file.h +122 -11
- package/src/headers/{18 → 22}/node_http2.h +28 -11
- package/src/headers/{16 → 22}/node_http2_state.h +34 -25
- package/src/headers/{18 → 22}/node_http_common-inl.h +2 -1
- package/src/headers/{18 → 22}/node_http_common.h +56 -55
- package/src/headers/{16 → 22}/node_i18n.h +5 -18
- package/src/headers/{18 → 22}/node_internals.h +121 -59
- package/src/headers/{18 → 22}/node_main_instance.h +4 -31
- package/src/headers/{18 → 22}/node_messaging.h +27 -10
- package/src/headers/{18 → 22}/node_metadata.h +23 -1
- package/src/headers/{18 → 22}/node_options-inl.h +24 -11
- package/src/headers/{18 → 22}/node_options.h +124 -39
- package/src/headers/{18 → 22}/node_perf.h +0 -2
- package/src/headers/{18 → 22}/node_perf_common.h +20 -9
- package/src/headers/{18 → 22}/node_platform.h +11 -5
- package/src/headers/{18 → 22}/node_process.h +26 -14
- package/src/headers/22/node_realm-inl.h +145 -0
- package/src/headers/22/node_realm.h +184 -0
- package/src/headers/{16 → 22}/node_report.h +13 -17
- package/src/headers/{16 → 22}/node_revert.h +3 -3
- package/src/headers/{16 → 22}/node_root_certs.h +902 -461
- package/src/headers/22/node_sea.h +64 -0
- package/src/headers/22/node_shadow_realm.h +46 -0
- package/src/headers/22/node_snapshot_builder.h +57 -0
- package/src/headers/22/node_snapshotable.h +174 -0
- package/src/headers/{18 → 22}/node_sockaddr.h +2 -2
- package/src/headers/{16 → 22}/node_stat_watcher.h +2 -1
- package/src/headers/22/node_threadsafe_cow-inl.h +54 -0
- package/src/headers/22/node_threadsafe_cow.h +105 -0
- package/src/headers/22/node_union_bytes.h +81 -0
- package/src/headers/22/node_url.h +96 -0
- package/src/headers/22/node_v8.h +77 -0
- package/src/headers/{14 → 22}/node_v8_platform-inl.h +17 -6
- package/src/headers/{18 → 22}/node_version.h +20 -8
- package/src/headers/22/node_wasi.h +185 -0
- package/src/headers/{14 → 22}/node_watchdog.h +2 -0
- package/src/headers/{18 → 22}/node_worker.h +7 -2
- package/src/headers/22/permission/child_process_permission.h +31 -0
- package/src/headers/22/permission/fs_permission.h +167 -0
- package/src/headers/22/permission/inspector_permission.h +31 -0
- package/src/headers/22/permission/permission.h +99 -0
- package/src/headers/22/permission/permission_base.h +60 -0
- package/src/headers/22/permission/wasi_permission.h +31 -0
- package/src/headers/22/permission/worker_permission.h +31 -0
- package/src/headers/{16 → 22}/req_wrap-inl.h +7 -6
- package/src/headers/{14 → 22}/spawn_sync.h +3 -3
- package/src/headers/{18 → 22}/stream_base-inl.h +0 -135
- package/src/headers/{18 → 22}/stream_base.h +35 -16
- package/src/headers/{18 → 22}/stream_pipe.h +3 -4
- package/src/headers/{16 → 22}/stream_wrap.h +2 -1
- package/src/headers/{18 → 22}/string_bytes.h +5 -14
- package/src/headers/{14 → 22}/string_decoder-inl.h +0 -6
- package/src/headers/{16 → 22}/string_decoder.h +0 -1
- package/src/headers/{18 → 22}/tcp_wrap.h +1 -1
- package/src/headers/{18 → 22}/threadpoolwork-inl.h +14 -1
- package/src/headers/22/timers.h +76 -0
- package/src/headers/{18 → 22}/tracing/trace_event.h +7 -5
- package/src/headers/{16 → 22}/udp_wrap.h +8 -5
- package/src/headers/22/undici_version.h +6 -0
- package/src/headers/{18 → 22}/util-inl.h +97 -127
- package/src/headers/{18 → 22}/util.h +293 -106
- package/src/headers/{18 → 22}/v8-fast-api-calls.h +103 -58
- package/dist/bindings/cws_darwin_arm64_node83.node +0 -0
- package/dist/bindings/cws_darwin_arm64_node93.node +0 -0
- package/dist/bindings/cws_darwin_x64_node83.node +0 -0
- package/dist/bindings/cws_darwin_x64_node93.node +0 -0
- package/dist/bindings/cws_linux_arm64_node83.node +0 -0
- package/dist/bindings/cws_linux_arm64_node93.node +0 -0
- package/dist/bindings/cws_linux_x64_node83.node +0 -0
- package/dist/bindings/cws_linux_x64_node93.node +0 -0
- package/src/headers/14/aliased_buffer.h +0 -263
- package/src/headers/14/allocated_buffer-inl.h +0 -110
- package/src/headers/14/allocated_buffer.h +0 -73
- package/src/headers/14/async_wrap-inl.h +0 -94
- package/src/headers/14/async_wrap.h +0 -230
- package/src/headers/14/base64.h +0 -183
- package/src/headers/14/base_object-inl.h +0 -371
- package/src/headers/14/base_object.h +0 -281
- package/src/headers/14/callback_queue-inl.h +0 -97
- package/src/headers/14/callback_queue.h +0 -78
- package/src/headers/14/debug_utils-inl.h +0 -223
- package/src/headers/14/debug_utils.h +0 -181
- package/src/headers/14/env.h +0 -1388
- package/src/headers/14/handle_wrap.h +0 -117
- package/src/headers/14/histogram-inl.h +0 -83
- package/src/headers/14/histogram.h +0 -98
- package/src/headers/14/inspector_agent.h +0 -149
- package/src/headers/14/inspector_profiler.h +0 -137
- package/src/headers/14/js_native_api.h +0 -544
- package/src/headers/14/js_native_api_types.h +0 -143
- package/src/headers/14/js_native_api_v8.h +0 -301
- package/src/headers/14/js_native_api_v8_internals.h +0 -38
- package/src/headers/14/json_utils.h +0 -161
- package/src/headers/14/memory_tracker-inl.h +0 -355
- package/src/headers/14/module_wrap.h +0 -99
- package/src/headers/14/node.h +0 -1032
- package/src/headers/14/node_api.h +0 -255
- package/src/headers/14/node_api_types.h +0 -44
- package/src/headers/14/node_binding.h +0 -99
- package/src/headers/14/node_buffer.h +0 -92
- package/src/headers/14/node_constants.h +0 -84
- package/src/headers/14/node_context_data.h +0 -44
- package/src/headers/14/node_contextify.h +0 -161
- package/src/headers/14/node_crypto.h +0 -865
- package/src/headers/14/node_crypto_bio.h +0 -195
- package/src/headers/14/node_crypto_clienthello-inl.h +0 -91
- package/src/headers/14/node_crypto_clienthello.h +0 -132
- package/src/headers/14/node_crypto_common.h +0 -138
- package/src/headers/14/node_crypto_groups.h +0 -415
- package/src/headers/14/node_dtrace.h +0 -86
- package/src/headers/14/node_errors.h +0 -214
- package/src/headers/14/node_file-inl.h +0 -306
- package/src/headers/14/node_file.h +0 -417
- package/src/headers/14/node_http2.h +0 -1191
- package/src/headers/14/node_http2_state.h +0 -149
- package/src/headers/14/node_http_common-inl.h +0 -194
- package/src/headers/14/node_http_common.h +0 -529
- package/src/headers/14/node_i18n.h +0 -144
- package/src/headers/14/node_internals.h +0 -405
- package/src/headers/14/node_main_instance.h +0 -96
- package/src/headers/14/node_mem.h +0 -45
- package/src/headers/14/node_messaging.h +0 -303
- package/src/headers/14/node_metadata.h +0 -109
- package/src/headers/14/node_mutex.h +0 -247
- package/src/headers/14/node_native_module.h +0 -101
- package/src/headers/14/node_native_module_env.h +0 -66
- package/src/headers/14/node_options-inl.h +0 -451
- package/src/headers/14/node_options.h +0 -481
- package/src/headers/14/node_perf.h +0 -181
- package/src/headers/14/node_perf_common.h +0 -97
- package/src/headers/14/node_platform.h +0 -189
- package/src/headers/14/node_process.h +0 -40
- package/src/headers/14/node_report.h +0 -47
- package/src/headers/14/node_revert.h +0 -72
- package/src/headers/14/node_root_certs.h +0 -3458
- package/src/headers/14/node_sockaddr-inl.h +0 -170
- package/src/headers/14/node_sockaddr.h +0 -123
- package/src/headers/14/node_stat_watcher.h +0 -70
- package/src/headers/14/node_union_bytes.h +0 -103
- package/src/headers/14/node_url.h +0 -188
- package/src/headers/14/node_version.h +0 -98
- package/src/headers/14/node_wasi.h +0 -108
- package/src/headers/14/node_win32_etw_provider-inl.h +0 -287
- package/src/headers/14/node_win32_etw_provider.h +0 -99
- package/src/headers/14/node_worker.h +0 -141
- package/src/headers/14/pipe_wrap.h +0 -78
- package/src/headers/14/req_wrap-inl.h +0 -170
- package/src/headers/14/req_wrap.h +0 -77
- package/src/headers/14/stream_base-inl.h +0 -275
- package/src/headers/14/stream_base.h +0 -434
- package/src/headers/14/stream_pipe.h +0 -73
- package/src/headers/14/stream_wrap.h +0 -130
- package/src/headers/14/string_bytes.h +0 -129
- package/src/headers/14/string_decoder.h +0 -50
- package/src/headers/14/string_search.h +0 -638
- package/src/headers/14/tcp_wrap.h +0 -101
- package/src/headers/14/threadpoolwork-inl.h +0 -57
- package/src/headers/14/tls_wrap.h +0 -222
- package/src/headers/14/tracing/agent.h +0 -195
- package/src/headers/14/tracing/node_trace_buffer.h +0 -83
- package/src/headers/14/tracing/node_trace_writer.h +0 -75
- package/src/headers/14/tracing/trace_event.h +0 -720
- package/src/headers/14/tracing/traced_value.h +0 -70
- package/src/headers/14/tty_wrap.h +0 -64
- package/src/headers/14/udp_wrap.h +0 -227
- package/src/headers/14/util-inl.h +0 -566
- package/src/headers/14/util.h +0 -804
- package/src/headers/14/v8abbr.h +0 -124
- package/src/headers/16/aliased_buffer.h +0 -315
- package/src/headers/16/aliased_struct-inl.h +0 -54
- package/src/headers/16/aliased_struct.h +0 -63
- package/src/headers/16/allocated_buffer-inl.h +0 -110
- package/src/headers/16/allocated_buffer.h +0 -73
- package/src/headers/16/async_wrap-inl.h +0 -94
- package/src/headers/16/async_wrap.h +0 -246
- package/src/headers/16/base64-inl.h +0 -189
- package/src/headers/16/base64.h +0 -69
- package/src/headers/16/base_object.h +0 -294
- package/src/headers/16/connect_wrap.h +0 -26
- package/src/headers/16/connection_wrap.h +0 -30
- package/src/headers/16/crypto/crypto_aes.h +0 -89
- package/src/headers/16/crypto/crypto_bio.h +0 -194
- package/src/headers/16/crypto/crypto_cipher.h +0 -286
- package/src/headers/16/crypto/crypto_clienthello-inl.h +0 -90
- package/src/headers/16/crypto/crypto_clienthello.h +0 -131
- package/src/headers/16/crypto/crypto_common.h +0 -187
- package/src/headers/16/crypto/crypto_context.h +0 -147
- package/src/headers/16/crypto/crypto_dh.h +0 -157
- package/src/headers/16/crypto/crypto_dsa.h +0 -76
- package/src/headers/16/crypto/crypto_ec.h +0 -169
- package/src/headers/16/crypto/crypto_groups.h +0 -415
- package/src/headers/16/crypto/crypto_hash.h +0 -89
- package/src/headers/16/crypto/crypto_hkdf.h +0 -66
- package/src/headers/16/crypto/crypto_hmac.h +0 -94
- package/src/headers/16/crypto/crypto_keygen.h +0 -301
- package/src/headers/16/crypto/crypto_keys.h +0 -412
- package/src/headers/16/crypto/crypto_pbkdf2.h +0 -76
- package/src/headers/16/crypto/crypto_random.h +0 -130
- package/src/headers/16/crypto/crypto_rsa.h +0 -141
- package/src/headers/16/crypto/crypto_scrypt.h +0 -87
- package/src/headers/16/crypto/crypto_sig.h +0 -167
- package/src/headers/16/crypto/crypto_spkac.h +0 -20
- package/src/headers/16/crypto/crypto_timing.h +0 -20
- package/src/headers/16/crypto/crypto_tls.h +0 -292
- package/src/headers/16/crypto/crypto_util.h +0 -736
- package/src/headers/16/crypto/crypto_x509.h +0 -141
- package/src/headers/16/debug_utils.h +0 -184
- package/src/headers/16/diagnosticfilename-inl.h +0 -33
- package/src/headers/16/env-inl.h +0 -1277
- package/src/headers/16/env.h +0 -1629
- package/src/headers/16/handle_wrap.h +0 -121
- package/src/headers/16/histogram-inl.h +0 -88
- package/src/headers/16/histogram.h +0 -216
- package/src/headers/16/inspector_io.h +0 -78
- package/src/headers/16/inspector_socket.h +0 -60
- package/src/headers/16/inspector_socket_server.h +0 -110
- package/src/headers/16/js_native_api.h +0 -561
- package/src/headers/16/js_native_api_types.h +0 -160
- package/src/headers/16/js_native_api_v8.h +0 -451
- package/src/headers/16/js_native_api_v8_internals.h +0 -39
- package/src/headers/16/js_stream.h +0 -52
- package/src/headers/16/memory_tracker-inl.h +0 -356
- package/src/headers/16/memory_tracker.h +0 -284
- package/src/headers/16/node.d +0 -315
- package/src/headers/16/node.h +0 -1132
- package/src/headers/16/node.stp +0 -146
- package/src/headers/16/node_api.h +0 -275
- package/src/headers/16/node_api_internals.h +0 -30
- package/src/headers/16/node_api_types.h +0 -50
- package/src/headers/16/node_binding.h +0 -99
- package/src/headers/16/node_blob.h +0 -191
- package/src/headers/16/node_bob-inl.h +0 -37
- package/src/headers/16/node_bob.h +0 -111
- package/src/headers/16/node_buffer.h +0 -92
- package/src/headers/16/node_constants.h +0 -84
- package/src/headers/16/node_context_data.h +0 -44
- package/src/headers/16/node_contextify.h +0 -196
- package/src/headers/16/node_dir.h +0 -52
- package/src/headers/16/node_dtrace.h +0 -86
- package/src/headers/16/node_errors.h +0 -277
- package/src/headers/16/node_external_reference.h +0 -129
- package/src/headers/16/node_file-inl.h +0 -306
- package/src/headers/16/node_http2.h +0 -1140
- package/src/headers/16/node_http_common-inl.h +0 -200
- package/src/headers/16/node_http_common.h +0 -531
- package/src/headers/16/node_internals.h +0 -421
- package/src/headers/16/node_main_instance.h +0 -103
- package/src/headers/16/node_mem-inl.h +0 -112
- package/src/headers/16/node_messaging.h +0 -373
- package/src/headers/16/node_metadata.h +0 -122
- package/src/headers/16/node_native_module.h +0 -101
- package/src/headers/16/node_native_module_env.h +0 -68
- package/src/headers/16/node_object_wrap.h +0 -132
- package/src/headers/16/node_options-inl.h +0 -477
- package/src/headers/16/node_options.h +0 -494
- package/src/headers/16/node_perf.h +0 -185
- package/src/headers/16/node_perf_common.h +0 -89
- package/src/headers/16/node_platform.h +0 -192
- package/src/headers/16/node_process.h +0 -43
- package/src/headers/16/node_provider.d +0 -80
- package/src/headers/16/node_snapshotable.h +0 -137
- package/src/headers/16/node_sockaddr-inl.h +0 -266
- package/src/headers/16/node_sockaddr.h +0 -405
- package/src/headers/16/node_union_bytes.h +0 -103
- package/src/headers/16/node_url.h +0 -205
- package/src/headers/16/node_v8.h +0 -41
- package/src/headers/16/node_v8_platform-inl.h +0 -194
- package/src/headers/16/node_version.h +0 -98
- package/src/headers/16/node_wasi.h +0 -108
- package/src/headers/16/node_watchdog.h +0 -152
- package/src/headers/16/node_win32_etw_provider-inl.h +0 -288
- package/src/headers/16/node_win32_etw_provider.h +0 -99
- package/src/headers/16/node_worker.h +0 -145
- package/src/headers/16/req_wrap.h +0 -77
- package/src/headers/16/spawn_sync.h +0 -242
- package/src/headers/16/stream_base-inl.h +0 -303
- package/src/headers/16/stream_base.h +0 -454
- package/src/headers/16/stream_pipe.h +0 -73
- package/src/headers/16/string_bytes.h +0 -122
- package/src/headers/16/string_decoder-inl.h +0 -37
- package/src/headers/16/string_search.h +0 -638
- package/src/headers/16/tcp_wrap.h +0 -103
- package/src/headers/16/threadpoolwork-inl.h +0 -57
- package/src/headers/16/timer_wrap.h +0 -84
- package/src/headers/16/tracing/agent.h +0 -195
- package/src/headers/16/tracing/node_trace_buffer.h +0 -83
- package/src/headers/16/tracing/node_trace_writer.h +0 -75
- package/src/headers/16/tracing/trace_event.h +0 -720
- package/src/headers/16/tracing/trace_event_common.h +0 -1109
- package/src/headers/16/tracing/traced_value.h +0 -70
- package/src/headers/16/tty_wrap.h +0 -66
- package/src/headers/16/util-inl.h +0 -575
- package/src/headers/16/util.h +0 -824
- package/src/headers/16/v8abbr.h +0 -123
- package/src/headers/16/v8ustack.d +0 -695
- package/src/headers/18/aliased_buffer.h +0 -315
- package/src/headers/18/aliased_struct-inl.h +0 -54
- package/src/headers/18/aliased_struct.h +0 -63
- package/src/headers/18/base64-inl.h +0 -189
- package/src/headers/18/base64.h +0 -69
- package/src/headers/18/base_object-inl.h +0 -374
- package/src/headers/18/callback_queue-inl.h +0 -97
- package/src/headers/18/callback_queue.h +0 -78
- package/src/headers/18/cares_wrap.h +0 -523
- package/src/headers/18/connect_wrap.h +0 -26
- package/src/headers/18/connection_wrap.h +0 -30
- package/src/headers/18/crypto/crypto_aes.h +0 -89
- package/src/headers/18/crypto/crypto_bio.h +0 -194
- package/src/headers/18/crypto/crypto_cipher.h +0 -291
- package/src/headers/18/crypto/crypto_clienthello-inl.h +0 -90
- package/src/headers/18/crypto/crypto_common.h +0 -151
- package/src/headers/18/crypto/crypto_dh.h +0 -156
- package/src/headers/18/crypto/crypto_dsa.h +0 -77
- package/src/headers/18/crypto/crypto_ec.h +0 -170
- package/src/headers/18/crypto/crypto_groups.h +0 -415
- package/src/headers/18/crypto/crypto_hash.h +0 -89
- package/src/headers/18/crypto/crypto_hkdf.h +0 -65
- package/src/headers/18/crypto/crypto_hmac.h +0 -94
- package/src/headers/18/crypto/crypto_keygen.h +0 -305
- package/src/headers/18/crypto/crypto_pbkdf2.h +0 -76
- package/src/headers/18/crypto/crypto_random.h +0 -130
- package/src/headers/18/crypto/crypto_rsa.h +0 -141
- package/src/headers/18/crypto/crypto_scrypt.h +0 -87
- package/src/headers/18/crypto/crypto_sig.h +0 -168
- package/src/headers/18/crypto/crypto_spkac.h +0 -21
- package/src/headers/18/crypto/crypto_timing.h +0 -20
- package/src/headers/18/crypto/crypto_x509.h +0 -143
- package/src/headers/18/debug_utils-inl.h +0 -223
- package/src/headers/18/diagnosticfilename-inl.h +0 -33
- package/src/headers/18/env-inl.h +0 -1308
- package/src/headers/18/env.h +0 -1667
- package/src/headers/18/inspector_agent.h +0 -144
- package/src/headers/18/inspector_io.h +0 -78
- package/src/headers/18/inspector_profiler.h +0 -149
- package/src/headers/18/inspector_socket.h +0 -60
- package/src/headers/18/inspector_socket_server.h +0 -110
- package/src/headers/18/js_stream.h +0 -52
- package/src/headers/18/json_utils.h +0 -161
- package/src/headers/18/memory_tracker.h +0 -284
- package/src/headers/18/module_wrap.h +0 -116
- package/src/headers/18/node_binding.h +0 -99
- package/src/headers/18/node_context_data.h +0 -44
- package/src/headers/18/node_contextify.h +0 -196
- package/src/headers/18/node_crypto.h +0 -57
- package/src/headers/18/node_dir.h +0 -52
- package/src/headers/18/node_dtrace.h +0 -86
- package/src/headers/18/node_external_reference.h +0 -145
- package/src/headers/18/node_file.h +0 -426
- package/src/headers/18/node_http2_state.h +0 -149
- package/src/headers/18/node_i18n.h +0 -145
- package/src/headers/18/node_mem-inl.h +0 -112
- package/src/headers/18/node_mem.h +0 -45
- package/src/headers/18/node_mutex.h +0 -323
- package/src/headers/18/node_native_module.h +0 -109
- package/src/headers/18/node_native_module_env.h +0 -71
- package/src/headers/18/node_object_wrap.h +0 -132
- package/src/headers/18/node_process-inl.h +0 -26
- package/src/headers/18/node_report.h +0 -47
- package/src/headers/18/node_revert.h +0 -82
- package/src/headers/18/node_root_certs.h +0 -3246
- package/src/headers/18/node_snapshot_builder.h +0 -43
- package/src/headers/18/node_snapshotable.h +0 -130
- package/src/headers/18/node_stat_watcher.h +0 -72
- package/src/headers/18/node_union_bytes.h +0 -103
- package/src/headers/18/node_url.h +0 -205
- package/src/headers/18/node_v8.h +0 -41
- package/src/headers/18/node_v8_platform-inl.h +0 -194
- package/src/headers/18/node_wasi.h +0 -108
- package/src/headers/18/node_watchdog.h +0 -152
- package/src/headers/18/node_win32_etw_provider-inl.h +0 -288
- package/src/headers/18/node_win32_etw_provider.h +0 -99
- package/src/headers/18/pipe_wrap.h +0 -80
- package/src/headers/18/req_wrap-inl.h +0 -170
- package/src/headers/18/spawn_sync.h +0 -242
- package/src/headers/18/stream_wrap.h +0 -133
- package/src/headers/18/string_decoder-inl.h +0 -37
- package/src/headers/18/string_decoder.h +0 -50
- package/src/headers/18/string_search.h +0 -638
- package/src/headers/18/tracing/node_trace_buffer.h +0 -83
- package/src/headers/18/tracing/node_trace_writer.h +0 -75
- package/src/headers/18/tracing/trace_event_common.h +0 -1109
- package/src/headers/18/tracing/traced_value.h +0 -70
- package/src/headers/18/udp_wrap.h +0 -227
- package/src/headers/18/v8abbr.h +0 -123
- /package/src/headers/{14 → 22}/aliased_struct-inl.h +0 -0
- /package/src/headers/{14 → 22}/aliased_struct.h +0 -0
- /package/src/headers/{16 → 22}/callback_queue-inl.h +0 -0
- /package/src/headers/{14 → 22}/connect_wrap.h +0 -0
- /package/src/headers/{14 → 22}/connection_wrap.h +0 -0
- /package/src/headers/{14 → 22}/diagnosticfilename-inl.h +0 -0
- /package/src/headers/{18 → 22}/histogram-inl.h +0 -0
- /package/src/headers/{14 → 22}/inspector_io.h +0 -0
- /package/src/headers/{14 → 22}/inspector_socket.h +0 -0
- /package/src/headers/{14 → 22}/inspector_socket_server.h +0 -0
- /package/src/headers/{14 → 22}/js_stream.h +0 -0
- /package/src/headers/{14 → 22}/node_dir.h +0 -0
- /package/src/headers/{14 → 22}/node_mem-inl.h +0 -0
- /package/src/headers/{16 → 22}/node_mem.h +0 -0
- /package/src/headers/{16 → 22}/node_mutex.h +0 -0
- /package/src/headers/{14 → 22}/node_object_wrap.h +0 -0
- /package/src/headers/{16 → 22}/node_process-inl.h +0 -0
- /package/src/headers/{18 → 22}/node_sockaddr-inl.h +0 -0
- /package/src/headers/{18 → 22}/node_wasm_web_api.h +0 -0
- /package/src/headers/{16 → 22}/pipe_wrap.h +0 -0
- /package/src/headers/{18 → 22}/req_wrap.h +0 -0
- /package/src/headers/{18 → 22}/timer_wrap-inl.h +0 -0
- /package/src/headers/{18 → 22}/timer_wrap.h +0 -0
- /package/src/headers/{18 → 22}/tracing/agent.h +0 -0
- /package/src/headers/{14 → 22}/tracing/trace_event_common.h +0 -0
- /package/src/headers/{18 → 22}/tty_wrap.h +0 -0
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
#ifndef SRC_NODE_WORKER_H_
|
|
2
|
-
#define SRC_NODE_WORKER_H_
|
|
3
|
-
|
|
4
|
-
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
5
|
-
|
|
6
|
-
#include <unordered_map>
|
|
7
|
-
#include "node_messaging.h"
|
|
8
|
-
#include "uv.h"
|
|
9
|
-
|
|
10
|
-
namespace node {
|
|
11
|
-
namespace worker {
|
|
12
|
-
|
|
13
|
-
class WorkerThreadData;
|
|
14
|
-
|
|
15
|
-
enum ResourceLimits {
|
|
16
|
-
kMaxYoungGenerationSizeMb,
|
|
17
|
-
kMaxOldGenerationSizeMb,
|
|
18
|
-
kCodeRangeSizeMb,
|
|
19
|
-
kStackSizeMb,
|
|
20
|
-
kTotalResourceLimitCount
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// A worker thread, as represented in its parent thread.
|
|
24
|
-
class Worker : public AsyncWrap {
|
|
25
|
-
public:
|
|
26
|
-
Worker(Environment* env,
|
|
27
|
-
v8::Local<v8::Object> wrap,
|
|
28
|
-
const std::string& url,
|
|
29
|
-
std::shared_ptr<PerIsolateOptions> per_isolate_opts,
|
|
30
|
-
std::vector<std::string>&& exec_argv,
|
|
31
|
-
std::shared_ptr<KVStore> env_vars);
|
|
32
|
-
~Worker() override;
|
|
33
|
-
|
|
34
|
-
// Run the worker. This is only called from the worker thread.
|
|
35
|
-
void Run();
|
|
36
|
-
|
|
37
|
-
// Forcibly exit the thread with a specified exit code. This may be called
|
|
38
|
-
// from any thread. `error_code` and `error_message` can be used to create
|
|
39
|
-
// a custom `'error'` event before emitting `'exit'`.
|
|
40
|
-
void Exit(int code,
|
|
41
|
-
const char* error_code = nullptr,
|
|
42
|
-
const char* error_message = nullptr);
|
|
43
|
-
|
|
44
|
-
// Wait for the worker thread to stop (in a blocking manner).
|
|
45
|
-
void JoinThread();
|
|
46
|
-
|
|
47
|
-
template <typename Fn>
|
|
48
|
-
inline bool RequestInterrupt(Fn&& cb);
|
|
49
|
-
|
|
50
|
-
void MemoryInfo(MemoryTracker* tracker) const override;
|
|
51
|
-
SET_MEMORY_INFO_NAME(Worker)
|
|
52
|
-
SET_SELF_SIZE(Worker)
|
|
53
|
-
bool IsNotIndicativeOfMemoryLeakAtExit() const override;
|
|
54
|
-
|
|
55
|
-
bool is_stopped() const;
|
|
56
|
-
|
|
57
|
-
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
58
|
-
static void CloneParentEnvVars(
|
|
59
|
-
const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
60
|
-
static void SetEnvVars(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
61
|
-
static void StartThread(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
62
|
-
static void StopThread(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
63
|
-
static void Ref(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
64
|
-
static void Unref(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
65
|
-
static void GetResourceLimits(
|
|
66
|
-
const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
67
|
-
v8::Local<v8::Float64Array> GetResourceLimits(v8::Isolate* isolate) const;
|
|
68
|
-
static void TakeHeapSnapshot(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
69
|
-
static void LoopIdleTime(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
70
|
-
static void LoopStartTime(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
71
|
-
|
|
72
|
-
private:
|
|
73
|
-
bool CreateEnvMessagePort(Environment* env);
|
|
74
|
-
static size_t NearHeapLimit(void* data, size_t current_heap_limit,
|
|
75
|
-
size_t initial_heap_limit);
|
|
76
|
-
|
|
77
|
-
std::shared_ptr<PerIsolateOptions> per_isolate_opts_;
|
|
78
|
-
std::vector<std::string> exec_argv_;
|
|
79
|
-
std::vector<std::string> argv_;
|
|
80
|
-
|
|
81
|
-
MultiIsolatePlatform* platform_;
|
|
82
|
-
v8::Isolate* isolate_ = nullptr;
|
|
83
|
-
uv_thread_t tid_;
|
|
84
|
-
|
|
85
|
-
std::unique_ptr<InspectorParentHandle> inspector_parent_handle_;
|
|
86
|
-
|
|
87
|
-
// This mutex protects access to all variables listed below it.
|
|
88
|
-
mutable Mutex mutex_;
|
|
89
|
-
|
|
90
|
-
bool thread_joined_ = true;
|
|
91
|
-
const char* custom_error_ = nullptr;
|
|
92
|
-
std::string custom_error_str_;
|
|
93
|
-
int exit_code_ = 0;
|
|
94
|
-
ThreadId thread_id_;
|
|
95
|
-
uintptr_t stack_base_ = 0;
|
|
96
|
-
|
|
97
|
-
// Custom resource constraints:
|
|
98
|
-
double resource_limits_[kTotalResourceLimitCount];
|
|
99
|
-
void UpdateResourceConstraints(v8::ResourceConstraints* constraints);
|
|
100
|
-
|
|
101
|
-
// Full size of the thread's stack.
|
|
102
|
-
size_t stack_size_ = 4 * 1024 * 1024;
|
|
103
|
-
// Stack buffer size that is not available to the JS engine.
|
|
104
|
-
static constexpr size_t kStackBufferSize = 192 * 1024;
|
|
105
|
-
|
|
106
|
-
std::unique_ptr<MessagePortData> child_port_data_;
|
|
107
|
-
std::shared_ptr<KVStore> env_vars_;
|
|
108
|
-
|
|
109
|
-
// This is always kept alive because the JS object associated with the Worker
|
|
110
|
-
// instance refers to it via its [kPort] property.
|
|
111
|
-
MessagePort* parent_port_ = nullptr;
|
|
112
|
-
|
|
113
|
-
// A raw flag that is used by creator and worker threads to
|
|
114
|
-
// sync up on pre-mature termination of worker - while in the
|
|
115
|
-
// warmup phase. Once the worker is fully warmed up, use the
|
|
116
|
-
// async handle of the worker's Environment for the same purpose.
|
|
117
|
-
bool stopped_ = true;
|
|
118
|
-
|
|
119
|
-
bool has_ref_ = true;
|
|
120
|
-
uint64_t environment_flags_ = EnvironmentFlags::kNoFlags;
|
|
121
|
-
|
|
122
|
-
// The real Environment of the worker object. It has a lesser
|
|
123
|
-
// lifespan than the worker object itself - comes to life
|
|
124
|
-
// when the worker thread creates a new Environment, and gets
|
|
125
|
-
// destroyed alongwith the worker thread.
|
|
126
|
-
Environment* env_ = nullptr;
|
|
127
|
-
|
|
128
|
-
friend class WorkerThreadData;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
template <typename Fn>
|
|
132
|
-
bool Worker::RequestInterrupt(Fn&& cb) {
|
|
133
|
-
Mutex::ScopedLock lock(mutex_);
|
|
134
|
-
if (env_ == nullptr) return false;
|
|
135
|
-
env_->RequestInterrupt(std::move(cb));
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
} // namespace worker
|
|
140
|
-
} // namespace node
|
|
141
|
-
|
|
142
|
-
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
#endif // SRC_NODE_WORKER_H_
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
#ifndef SRC_REQ_WRAP_H_
|
|
2
|
-
#define SRC_REQ_WRAP_H_
|
|
3
|
-
|
|
4
|
-
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
5
|
-
|
|
6
|
-
#include "async_wrap.h"
|
|
7
|
-
#include "util.h"
|
|
8
|
-
#include "v8.h"
|
|
9
|
-
|
|
10
|
-
namespace node {
|
|
11
|
-
|
|
12
|
-
class Environment;
|
|
13
|
-
|
|
14
|
-
class ReqWrapBase {
|
|
15
|
-
public:
|
|
16
|
-
explicit inline ReqWrapBase(Environment* env);
|
|
17
|
-
|
|
18
|
-
virtual ~ReqWrapBase() = default;
|
|
19
|
-
|
|
20
|
-
virtual void Cancel() = 0;
|
|
21
|
-
virtual AsyncWrap* GetAsyncWrap() = 0;
|
|
22
|
-
|
|
23
|
-
private:
|
|
24
|
-
friend int GenDebugSymbols();
|
|
25
|
-
friend class Environment;
|
|
26
|
-
|
|
27
|
-
ListNode<ReqWrapBase> req_wrap_queue_;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
template <typename T>
|
|
31
|
-
class ReqWrap : public AsyncWrap, public ReqWrapBase {
|
|
32
|
-
public:
|
|
33
|
-
inline ReqWrap(Environment* env,
|
|
34
|
-
v8::Local<v8::Object> object,
|
|
35
|
-
AsyncWrap::ProviderType provider);
|
|
36
|
-
inline ~ReqWrap() override;
|
|
37
|
-
// Call this after the req has been dispatched, if that did not already
|
|
38
|
-
// happen by using Dispatch().
|
|
39
|
-
inline void Dispatched();
|
|
40
|
-
// Call this after a request has finished, if re-using this object is planned.
|
|
41
|
-
inline void Reset();
|
|
42
|
-
T* req() { return &req_; }
|
|
43
|
-
inline void Cancel() final;
|
|
44
|
-
inline AsyncWrap* GetAsyncWrap() override;
|
|
45
|
-
|
|
46
|
-
static ReqWrap* from_req(T* req);
|
|
47
|
-
|
|
48
|
-
template <typename LibuvFunction, typename... Args>
|
|
49
|
-
inline int Dispatch(LibuvFunction fn, Args... args);
|
|
50
|
-
|
|
51
|
-
private:
|
|
52
|
-
friend int GenDebugSymbols();
|
|
53
|
-
|
|
54
|
-
// Adding `friend struct MakeLibuvRequestCallback` is not enough anymore
|
|
55
|
-
// for some reason. Consider this private.
|
|
56
|
-
public:
|
|
57
|
-
typedef void (*callback_t)();
|
|
58
|
-
callback_t original_callback_ = nullptr;
|
|
59
|
-
|
|
60
|
-
protected:
|
|
61
|
-
// req_wrap_queue_ needs to be at a fixed offset from the start of the class
|
|
62
|
-
// because it is used by ContainerOf to calculate the address of the embedding
|
|
63
|
-
// ReqWrap. ContainerOf compiles down to simple, fixed pointer arithmetic. It
|
|
64
|
-
// is also used by src/node_postmortem_metadata.cc to calculate offsets and
|
|
65
|
-
// generate debug symbols for ReqWrap, which assumes that the position of
|
|
66
|
-
// members in memory are predictable. sizeof(req_) depends on the type of T,
|
|
67
|
-
// so req_wrap_queue_ would no longer be at a fixed offset if it came after
|
|
68
|
-
// req_. For more information please refer to
|
|
69
|
-
// `doc/guides/node-postmortem-support.md`
|
|
70
|
-
T req_;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
} // namespace node
|
|
74
|
-
|
|
75
|
-
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
76
|
-
|
|
77
|
-
#endif // SRC_REQ_WRAP_H_
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
2
|
-
//
|
|
3
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
4
|
-
// copy of this software and associated documentation files (the
|
|
5
|
-
// "Software"), to deal in the Software without restriction, including
|
|
6
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
8
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
9
|
-
// following conditions:
|
|
10
|
-
//
|
|
11
|
-
// The above copyright notice and this permission notice shall be included
|
|
12
|
-
// in all copies or substantial portions of the Software.
|
|
13
|
-
//
|
|
14
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
15
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
17
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
18
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
19
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
20
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
21
|
-
|
|
22
|
-
#ifndef SRC_SPAWN_SYNC_H_
|
|
23
|
-
#define SRC_SPAWN_SYNC_H_
|
|
24
|
-
|
|
25
|
-
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
26
|
-
|
|
27
|
-
#include "node_buffer.h"
|
|
28
|
-
#include "uv.h"
|
|
29
|
-
#include "v8.h"
|
|
30
|
-
|
|
31
|
-
namespace node {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class SyncProcessOutputBuffer;
|
|
36
|
-
class SyncProcessStdioPipe;
|
|
37
|
-
class SyncProcessRunner;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class SyncProcessOutputBuffer {
|
|
41
|
-
static const unsigned int kBufferSize = 65536;
|
|
42
|
-
|
|
43
|
-
public:
|
|
44
|
-
inline SyncProcessOutputBuffer() = default;
|
|
45
|
-
|
|
46
|
-
inline void OnAlloc(size_t suggested_size, uv_buf_t* buf) const;
|
|
47
|
-
inline void OnRead(const uv_buf_t* buf, size_t nread);
|
|
48
|
-
|
|
49
|
-
inline size_t Copy(char* dest) const;
|
|
50
|
-
|
|
51
|
-
inline unsigned int available() const;
|
|
52
|
-
inline unsigned int used() const;
|
|
53
|
-
|
|
54
|
-
inline SyncProcessOutputBuffer* next() const;
|
|
55
|
-
inline void set_next(SyncProcessOutputBuffer* next);
|
|
56
|
-
|
|
57
|
-
private:
|
|
58
|
-
// Use unsigned int because that's what `uv_buf_init` takes.
|
|
59
|
-
mutable char data_[kBufferSize];
|
|
60
|
-
unsigned int used_ = 0;
|
|
61
|
-
|
|
62
|
-
SyncProcessOutputBuffer* next_ = nullptr;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
class SyncProcessStdioPipe {
|
|
67
|
-
enum Lifecycle {
|
|
68
|
-
kUninitialized = 0,
|
|
69
|
-
kInitialized,
|
|
70
|
-
kStarted,
|
|
71
|
-
kClosing,
|
|
72
|
-
kClosed
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
public:
|
|
76
|
-
SyncProcessStdioPipe(SyncProcessRunner* process_handler,
|
|
77
|
-
bool readable,
|
|
78
|
-
bool writable,
|
|
79
|
-
uv_buf_t input_buffer);
|
|
80
|
-
~SyncProcessStdioPipe();
|
|
81
|
-
|
|
82
|
-
int Initialize(uv_loop_t* loop);
|
|
83
|
-
int Start();
|
|
84
|
-
void Close();
|
|
85
|
-
|
|
86
|
-
v8::Local<v8::Object> GetOutputAsBuffer(Environment* env) const;
|
|
87
|
-
|
|
88
|
-
inline bool readable() const;
|
|
89
|
-
inline bool writable() const;
|
|
90
|
-
inline uv_stdio_flags uv_flags() const;
|
|
91
|
-
|
|
92
|
-
inline uv_pipe_t* uv_pipe() const;
|
|
93
|
-
inline uv_stream_t* uv_stream() const;
|
|
94
|
-
inline uv_handle_t* uv_handle() const;
|
|
95
|
-
|
|
96
|
-
private:
|
|
97
|
-
inline size_t OutputLength() const;
|
|
98
|
-
inline void CopyOutput(char* dest) const;
|
|
99
|
-
|
|
100
|
-
inline void OnAlloc(size_t suggested_size, uv_buf_t* buf);
|
|
101
|
-
inline void OnRead(const uv_buf_t* buf, ssize_t nread);
|
|
102
|
-
inline void OnWriteDone(int result);
|
|
103
|
-
inline void OnShutdownDone(int result);
|
|
104
|
-
inline void OnClose();
|
|
105
|
-
|
|
106
|
-
inline void SetError(int error);
|
|
107
|
-
|
|
108
|
-
static void AllocCallback(uv_handle_t* handle,
|
|
109
|
-
size_t suggested_size,
|
|
110
|
-
uv_buf_t* buf);
|
|
111
|
-
static void ReadCallback(uv_stream_t* stream,
|
|
112
|
-
ssize_t nread,
|
|
113
|
-
const uv_buf_t* buf);
|
|
114
|
-
static void WriteCallback(uv_write_t* req, int result);
|
|
115
|
-
static void ShutdownCallback(uv_shutdown_t* req, int result);
|
|
116
|
-
static void CloseCallback(uv_handle_t* handle);
|
|
117
|
-
|
|
118
|
-
SyncProcessRunner* process_handler_;
|
|
119
|
-
|
|
120
|
-
bool readable_;
|
|
121
|
-
bool writable_;
|
|
122
|
-
uv_buf_t input_buffer_;
|
|
123
|
-
|
|
124
|
-
SyncProcessOutputBuffer* first_output_buffer_;
|
|
125
|
-
SyncProcessOutputBuffer* last_output_buffer_;
|
|
126
|
-
|
|
127
|
-
mutable uv_pipe_t uv_pipe_;
|
|
128
|
-
uv_write_t write_req_;
|
|
129
|
-
uv_shutdown_t shutdown_req_;
|
|
130
|
-
|
|
131
|
-
Lifecycle lifecycle_;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
class SyncProcessRunner {
|
|
136
|
-
enum Lifecycle {
|
|
137
|
-
kUninitialized = 0,
|
|
138
|
-
kInitialized,
|
|
139
|
-
kHandlesClosed
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
public:
|
|
143
|
-
static void Initialize(v8::Local<v8::Object> target,
|
|
144
|
-
v8::Local<v8::Value> unused,
|
|
145
|
-
v8::Local<v8::Context> context,
|
|
146
|
-
void* priv);
|
|
147
|
-
static void Spawn(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
148
|
-
|
|
149
|
-
private:
|
|
150
|
-
friend class SyncProcessStdioPipe;
|
|
151
|
-
|
|
152
|
-
explicit SyncProcessRunner(Environment* env_);
|
|
153
|
-
~SyncProcessRunner();
|
|
154
|
-
|
|
155
|
-
inline Environment* env() const;
|
|
156
|
-
|
|
157
|
-
v8::MaybeLocal<v8::Object> Run(v8::Local<v8::Value> options);
|
|
158
|
-
v8::Maybe<bool> TryInitializeAndRunLoop(v8::Local<v8::Value> options);
|
|
159
|
-
void CloseHandlesAndDeleteLoop();
|
|
160
|
-
|
|
161
|
-
void CloseStdioPipes();
|
|
162
|
-
void CloseKillTimer();
|
|
163
|
-
|
|
164
|
-
void Kill();
|
|
165
|
-
void IncrementBufferSizeAndCheckOverflow(ssize_t length);
|
|
166
|
-
|
|
167
|
-
void OnExit(int64_t exit_status, int term_signal);
|
|
168
|
-
void OnKillTimerTimeout();
|
|
169
|
-
|
|
170
|
-
int GetError();
|
|
171
|
-
void SetError(int error);
|
|
172
|
-
void SetPipeError(int pipe_error);
|
|
173
|
-
|
|
174
|
-
v8::Local<v8::Object> BuildResultObject();
|
|
175
|
-
v8::Local<v8::Array> BuildOutputArray();
|
|
176
|
-
|
|
177
|
-
v8::Maybe<int> ParseOptions(v8::Local<v8::Value> js_value);
|
|
178
|
-
int ParseStdioOptions(v8::Local<v8::Value> js_value);
|
|
179
|
-
int ParseStdioOption(int child_fd, v8::Local<v8::Object> js_stdio_option);
|
|
180
|
-
|
|
181
|
-
inline int AddStdioIgnore(uint32_t child_fd);
|
|
182
|
-
inline int AddStdioPipe(uint32_t child_fd,
|
|
183
|
-
bool readable,
|
|
184
|
-
bool writable,
|
|
185
|
-
uv_buf_t input_buffer);
|
|
186
|
-
inline int AddStdioInheritFD(uint32_t child_fd, int inherit_fd);
|
|
187
|
-
|
|
188
|
-
static bool IsSet(v8::Local<v8::Value> value);
|
|
189
|
-
v8::Maybe<int> CopyJsString(v8::Local<v8::Value> js_value,
|
|
190
|
-
const char** target);
|
|
191
|
-
v8::Maybe<int> CopyJsStringArray(v8::Local<v8::Value> js_value,
|
|
192
|
-
char** target);
|
|
193
|
-
|
|
194
|
-
static void ExitCallback(uv_process_t* handle,
|
|
195
|
-
int64_t exit_status,
|
|
196
|
-
int term_signal);
|
|
197
|
-
static void KillTimerCallback(uv_timer_t* handle);
|
|
198
|
-
static void KillTimerCloseCallback(uv_handle_t* handle);
|
|
199
|
-
|
|
200
|
-
double max_buffer_;
|
|
201
|
-
uint64_t timeout_;
|
|
202
|
-
int kill_signal_;
|
|
203
|
-
|
|
204
|
-
uv_loop_t* uv_loop_;
|
|
205
|
-
|
|
206
|
-
uint32_t stdio_count_;
|
|
207
|
-
uv_stdio_container_t* uv_stdio_containers_;
|
|
208
|
-
std::vector<std::unique_ptr<SyncProcessStdioPipe>> stdio_pipes_;
|
|
209
|
-
bool stdio_pipes_initialized_;
|
|
210
|
-
|
|
211
|
-
uv_process_options_t uv_process_options_;
|
|
212
|
-
const char* file_buffer_;
|
|
213
|
-
char* args_buffer_;
|
|
214
|
-
char* env_buffer_;
|
|
215
|
-
const char* cwd_buffer_;
|
|
216
|
-
|
|
217
|
-
uv_process_t uv_process_;
|
|
218
|
-
bool killed_;
|
|
219
|
-
|
|
220
|
-
size_t buffered_output_size_;
|
|
221
|
-
int64_t exit_status_;
|
|
222
|
-
int term_signal_;
|
|
223
|
-
|
|
224
|
-
uv_timer_t uv_timer_;
|
|
225
|
-
bool kill_timer_initialized_;
|
|
226
|
-
|
|
227
|
-
// Errors that happen in one of the pipe handlers are stored in the
|
|
228
|
-
// `pipe_error` field. They are treated as "low-priority", only to be
|
|
229
|
-
// reported if no more serious errors happened.
|
|
230
|
-
int error_;
|
|
231
|
-
int pipe_error_;
|
|
232
|
-
|
|
233
|
-
Lifecycle lifecycle_;
|
|
234
|
-
|
|
235
|
-
Environment* env_;
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
} // namespace node
|
|
239
|
-
|
|
240
|
-
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
241
|
-
|
|
242
|
-
#endif // SRC_SPAWN_SYNC_H_
|