Skip to content

Commit 8fb7439

Browse files
Merge pull request #1031 from nodejs/main
Create a new pull request by comparing changes across two branches
2 parents 98a7b74 + ee46d22 commit 8fb7439

File tree

103 files changed

+2069
-1876
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+2069
-1876
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
/lib/tls.js @nodejs/crypto @nodejs/net
6969
/src/crypto/* @nodejs/crypto
7070
/src/node_crypto* @nodejs/crypto
71+
/deps/ncrypto/* @nodejs/crypto
7172

7273
# http
7374

.github/workflows/notify-on-review-wanted.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Slack Notification
3333
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907 # 2.3.0
3434
env:
35-
SLACK_COLOR: '#DE512A'
35+
SLACK_COLOR: '#3d85c6'
3636
SLACK_ICON: https://github.com/nodejs.png?size=48
3737
SLACK_TITLE: ${{ steps.define-message.outputs.title }}
3838
SLACK_MESSAGE: ${{ steps.define-message.outputs.message }}

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -770,12 +770,6 @@ Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys):
770770

771771
* **Antoine du Hamel** <<[email protected]>>
772772
`C0D6248439F1D5604AAFFB4021D900FFDB233756`
773-
* **Beth Griggs** <<[email protected]>>
774-
`4ED778F539E3634C779C87C6D7062848A1AB005C`
775-
* **Bryan English** <<[email protected]>>
776-
`141F07595B7B3FFE74309A937405533BE57C7D57`
777-
* **Danielle Adams** <<[email protected]>>
778-
`74F12602B6F1C4E913FAA37AD3A89613643B6201`
779773
* **Juan José Arboleda** <<[email protected]>>
780774
`DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7`
781775
* **Marco Ippolito** <<[email protected]>>
@@ -796,9 +790,6 @@ to sign releases):
796790

797791
```bash
798792
gpg --keyserver hkps://keys.openpgp.org --recv-keys C0D6248439F1D5604AAFFB4021D900FFDB233756 # Antoine du Hamel
799-
gpg --keyserver hkps://keys.openpgp.org --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C # Beth Griggs
800-
gpg --keyserver hkps://keys.openpgp.org --recv-keys 141F07595B7B3FFE74309A937405533BE57C7D57 # Bryan English
801-
gpg --keyserver hkps://keys.openpgp.org --recv-keys 74F12602B6F1C4E913FAA37AD3A89613643B6201 # Danielle Adams
802793
gpg --keyserver hkps://keys.openpgp.org --recv-keys DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 # Juan José Arboleda
803794
gpg --keyserver hkps://keys.openpgp.org --recv-keys CC68F5A3106FF448322E48ED27F5E38D5B0A215F # Marco Ippolito
804795
gpg --keyserver hkps://keys.openpgp.org --recv-keys 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 # Michaël Zasso
@@ -815,12 +806,17 @@ verify a downloaded file.
815806

816807
<summary>Other keys used to sign some previous releases</summary>
817808

809+
* **Beth Griggs** <<[email protected]>>
810+
`4ED778F539E3634C779C87C6D7062848A1AB005C`
811+
* **Bryan English** <<[email protected]>>
812+
`141F07595B7B3FFE74309A937405533BE57C7D57`
818813
* **Chris Dickinson** <<[email protected]>>
819814
`9554F04D7259F04124DE6B476D5A82AC7E37093B`
820815
* **Colin Ihrig** <<[email protected]>>
821816
`94AE36675C464D64BAFA68DD7434390BDBE9B9C5`
822817
* **Danielle Adams** <<[email protected]>>
823818
`1C050899334244A8AF75E53792EF661D867B9DFA`
819+
`74F12602B6F1C4E913FAA37AD3A89613643B6201`
824820
* **Evan Lucas** <<[email protected]>>
825821
`B9AE9905FFD7803F25714661B63B535A4C206CA9`
826822
* **Gibson Fahnestock** <<[email protected]>>

benchmark/run.js

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ const cli = new CLI(`usage: ./node run.js [options] [--] <category> ...
1212
(can be repeated)
1313
--exclude pattern excludes scripts matching <pattern> (can be
1414
repeated)
15+
--runs variable=value set the amount of benchmark suite execution.
16+
Default: 1
1517
--set variable=value set benchmark variable (can be repeated)
1618
--format [simple|csv] optional value that specifies the output format
1719
test only run a single configuration from the options
@@ -45,8 +47,7 @@ if (format === 'csv') {
4547
console.log('"filename", "configuration", "rate", "time"');
4648
}
4749

48-
(function recursive(i) {
49-
const filename = benchmarks[i];
50+
function runBenchmark(filename) {
5051
const scriptPath = path.resolve(__dirname, filename);
5152

5253
const args = cli.test ? ['--test'] : cli.optional.set;
@@ -63,42 +64,52 @@ if (format === 'csv') {
6364
);
6465
}
6566

66-
if (format !== 'csv') {
67-
console.log();
68-
console.log(filename);
69-
}
70-
71-
child.on('message', (data) => {
72-
if (data.type !== 'report') {
73-
return;
74-
}
75-
// Construct configuration string, " A=a, B=b, ..."
76-
let conf = '';
77-
for (const key of Object.keys(data.conf)) {
78-
if (conf !== '')
79-
conf += ' ';
80-
conf += `${key}=${JSON.stringify(data.conf[key])}`;
81-
}
82-
if (format === 'csv') {
83-
// Escape quotes (") for correct csv formatting
84-
conf = conf.replace(/"/g, '""');
85-
console.log(`"${data.name}", "${conf}", ${data.rate}, ${data.time}`);
86-
} else {
87-
let rate = data.rate.toString().split('.');
88-
rate[0] = rate[0].replace(/(\d)(?=(?:\d\d\d)+(?!\d))/g, '$1,');
89-
rate = (rate[1] ? rate.join('.') : rate[0]);
90-
console.log(`${data.name} ${conf}: ${rate}`);
91-
}
67+
return new Promise((resolve, reject) => {
68+
child.on('message', (data) => {
69+
if (data.type !== 'report') {
70+
return;
71+
}
72+
// Construct configuration string, " A=a, B=b, ..."
73+
let conf = '';
74+
for (const key of Object.keys(data.conf)) {
75+
if (conf !== '')
76+
conf += ' ';
77+
conf += `${key}=${JSON.stringify(data.conf[key])}`;
78+
}
79+
if (format === 'csv') {
80+
// Escape quotes (") for correct csv formatting
81+
conf = conf.replace(/"/g, '""');
82+
console.log(`"${data.name}", "${conf}", ${data.rate}, ${data.time}`);
83+
} else {
84+
let rate = data.rate.toString().split('.');
85+
rate[0] = rate[0].replace(/(\d)(?=(?:\d\d\d)+(?!\d))/g, '$1,');
86+
rate = (rate[1] ? rate.join('.') : rate[0]);
87+
console.log(`${data.name} ${conf}: ${rate}`);
88+
}
89+
});
90+
child.once('close', (code) => {
91+
if (code) {
92+
reject(code);
93+
} else {
94+
resolve(code);
95+
}
96+
});
9297
});
98+
}
9399

94-
child.once('close', (code) => {
95-
if (code) {
96-
process.exit(code);
100+
async function run() {
101+
for (let i = 0; i < benchmarks.length; ++i) {
102+
let runs = cli.optional.runs ?? 1;
103+
const filename = benchmarks[i];
104+
if (format !== 'csv') {
105+
console.log();
106+
console.log(filename);
97107
}
98108

99-
// If there are more benchmarks execute the next
100-
if (i + 1 < benchmarks.length) {
101-
recursive(i + 1);
109+
while (runs-- > 0) {
110+
await runBenchmark(filename);
102111
}
103-
});
104-
})(0);
112+
}
113+
}
114+
115+
run();

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ def configure_zos(o):
13561356
o['variables']['node_static_zoslib'] = b(True)
13571357
if options.static_zoslib_gyp:
13581358
# Apply to all Node.js components for now
1359-
o['variables']['zoslib_include_dir'] = Path(options.static_zoslib_gyp).parent + '/include'
1359+
o['variables']['zoslib_include_dir'] = Path(options.static_zoslib_gyp).parent / 'include'
13601360
o['include_dirs'] += [o['variables']['zoslib_include_dir']]
13611361
else:
13621362
raise Exception('--static-zoslib-gyp=<path to zoslib.gyp file> is required.')

deps/cares/cares.gyp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
'variables': {
3+
# This list is generated by `tools/dep_updaters/update-c-ares.mjs`.
34
'cares_sources_common': [
45
'include/ares.h',
6+
'include/ares_build.h',
57
'include/ares_dns.h',
68
'include/ares_dns_record.h',
79
'include/ares_nameser.h',
@@ -49,6 +51,8 @@
4951
'src/lib/ares_strerror.c',
5052
'src/lib/ares_sysconfig.c',
5153
'src/lib/ares_sysconfig_files.c',
54+
'src/lib/ares_sysconfig_mac.c',
55+
'src/lib/ares_sysconfig_win.c',
5256
'src/lib/ares_timeout.c',
5357
'src/lib/ares_update_servers.c',
5458
'src/lib/ares_version.c',
@@ -111,11 +115,11 @@
111115
'src/lib/record/ares_dns_private.h',
112116
'src/lib/record/ares_dns_record.c',
113117
'src/lib/record/ares_dns_write.c',
114-
'src/lib/str/ares__buf.h',
115118
'src/lib/str/ares_buf.c',
116119
'src/lib/str/ares_str.c',
117120
'src/lib/str/ares_strsplit.c',
118121
'src/lib/str/ares_strsplit.h',
122+
'src/lib/thirdparty/apple/dnsinfo.h',
119123
'src/lib/util/ares_iface_ips.c',
120124
'src/lib/util/ares_iface_ips.h',
121125
'src/lib/util/ares_math.c',
@@ -128,18 +132,10 @@
128132
'src/lib/util/ares_timeval.c',
129133
'src/lib/util/ares_uri.c',
130134
'src/lib/util/ares_uri.h',
131-
'src/tools/ares_getopt.c',
132-
'src/tools/ares_getopt.h',
135+
'src/lib/windows_port.c',
133136
],
134137
'cares_sources_mac': [
135138
'config/darwin/ares_config.h',
136-
'src/lib/ares_sysconfig_mac.c',
137-
'src/lib/thirdparty/apple/dnsinfo.h',
138-
],
139-
'cares_sources_win': [
140-
'src/lib/ares_sysconfig_win.c',
141-
'src/lib/config-win32.h',
142-
'src/lib/windows_port.c',
143139
],
144140
},
145141

@@ -201,9 +197,6 @@
201197
'_WINSOCK_DEPRECATED_NO_WARNINGS',
202198
],
203199
'include_dirs': [ 'config/win32' ],
204-
'sources': [
205-
'<@(cares_sources_win)',
206-
],
207200
'libraries': [
208201
'-lws2_32.lib',
209202
'-liphlpapi.lib'

deps/ncrypto/ncrypto.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <openssl/bn.h>
66
#include <openssl/evp.h>
77
#include <openssl/hmac.h>
8+
#include <openssl/rand.h>
89
#include <openssl/pkcs12.h>
910
#include <openssl/x509v3.h>
1011
#if OPENSSL_VERSION_MAJOR >= 3

doc/api/cli.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3076,6 +3076,10 @@ one is included in the list below.
30763076
* `--force-fips`
30773077
* `--force-node-api-uncaught-exceptions-policy`
30783078
* `--frozen-intrinsics`
3079+
* `--heap-prof-dir`
3080+
* `--heap-prof-interval`
3081+
* `--heap-prof-name`
3082+
* `--heap-prof`
30793083
* `--heapsnapshot-near-heap-limit`
30803084
* `--heapsnapshot-signal`
30813085
* `--http-parser`

doc/api/deprecations.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3453,6 +3453,10 @@ Node-API callbacks.
34533453

34543454
<!-- YAML
34553455
changes:
3456+
- version:
3457+
- REPLACEME
3458+
pr-url: https://github.com/nodejs/node/pull/55017
3459+
description: Application deprecation.
34563460
- version:
34573461
- v19.9.0
34583462
- v18.17.0
@@ -3465,7 +3469,7 @@ changes:
34653469
description: Documentation-only deprecation.
34663470
-->
34673471

3468-
Type: Documentation-only (supports [`--pending-deprecation`][])
3472+
Type: Application (non-`node_modules` code only)
34693473

34703474
[`url.parse()`][] behavior is not standardized and prone to errors that
34713475
have security implications. Use the [WHATWG URL API][] instead. CVEs are not

doc/api/net.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,12 +603,25 @@ changes:
603603

604604
* {integer}
605605

606-
Set this property to reject connections when the server's connection count gets
607-
high.
606+
When the number of connections reaches the `server.maxConnections` threshold:
607+
608+
1. If the process is not running in cluster mode, Node.js will close the connection.
609+
610+
2. If the process is running in cluster mode, Node.js will, by default, route the connection to another worker process. To close the connection instead, set \[`server.dropMaxConnection`]\[] to `true`.
608611

609612
It is not recommended to use this option once a socket has been sent to a child
610613
with [`child_process.fork()`][].
611614

615+
### `server.dropMaxConnection`
616+
617+
<!-- YAML
618+
added: REPLACEME
619+
-->
620+
621+
* {boolean}
622+
623+
Set this property to `true` to begin closing connections once the number of connections reaches the \[`server.maxConnections`]\[] threshold. This setting is only effective in cluster mode.
624+
612625
### `server.ref()`
613626

614627
<!-- YAML

0 commit comments

Comments
 (0)