Commit Graph

5366 Commits

Author SHA1 Message Date
Rich Trott
a02de1bc35 doc: use correct identifier for callback argument
In one place, the fs docs use `previousStat` for an argument that is
identified as `previous` everywhere else. Use `previous` for
consistency.

PR-URL: https://github.com/nodejs/node/pull/34405
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-07-19 07:16:21 -07:00
Tobias Nießen
9cbfabac25
doc: add changes metadata to TLS newSession event
Refs: https://github.com/nodejs/node/issues/33715

PR-URL: https://github.com/nodejs/node/pull/34294
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-07-19 12:26:32 +02:00
Rich Trott
0c81cadec6 doc: strengthen suggestion in errors.md
Sure, I'm advocating for permitting second-person pronouns in a current
PR, but the use in errors.md is superfluous and weakens the sentence.
Remove it.

PR-URL: https://github.com/nodejs/node/pull/34390
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-07-18 14:41:24 -07:00
Rich Trott
d46fc91be4 doc: strengthen wording about fs.access() misuse
PR-URL: https://github.com/nodejs/node/pull/34352
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-07-15 22:47:55 -07:00
James M Snell
89453cfc08 quic: fixup quic.md
PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:17:08 -07:00
James M Snell
57c1129508 quic: implement QuicSession close as promise
PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:17:01 -07:00
James M Snell
8e5c5b16ab quic: cleanup QuicClientSession constructor
PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:16:59 -07:00
James M Snell
fe4e7e4598 quic: use promisified dns lookup
PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:16:57 -07:00
James M Snell
346aeaf874 quic: eliminate "ready"/"not ready" states for QuicSession
QuicClientSession and QuicServerSessions are now always immediately
ready for use when they are created, so no more need to track
ready state.

PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:16:55 -07:00
James M Snell
6665dda9f6 quic: implement QuicSocket Promise API, part 2
PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:16:52 -07:00
James M Snell
79c0e892dd quic: implement QuicSocket Promise API, part 1
PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:16:50 -07:00
James M Snell
53b12f0c7b quic: implement QuicEndpoint Promise API
This is the start of a conversion over to a fully Promise-centric API
for the QUIC implementation.

PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:16:48 -07:00
James M Snell
9f552df5b4 quic: fix endpointClose error handling, document
PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:16:41 -07:00
James M Snell
b80108c033 quic: restrict addEndpoint to before QuicSocket bind
Restricting this to pre-bind keeps things simple

PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:16:39 -07:00
James M Snell
429ab1dce6 quic: minor reduction in code duplication
PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:16:32 -07:00
James M Snell
aafdc2fcad quic: replace ipv6Only option with 'udp6-only' type
Since the `ipv6Only` option was mutually exclusive with
using `'udp6'`, making it it's own type simplifies things
a bit.

PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:16:30 -07:00
Ye-hyoung Kang
9fc877890f
doc: fix typo in assert.md
PR-URL: https://github.com/nodejs/node/pull/34316
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-07-16 00:26:26 +02:00
Anna Henningsen
e876c0c308
http2: add support for sensitive headers
Add support for “sensitive”/“never-indexed” HTTP2 headers.

Fixes: https://github.com/nodejs/node/issues/34091

PR-URL: https://github.com/nodejs/node/pull/34145
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-07-16 00:25:47 +02:00
Beth Griggs
218381213b
doc: sync deprecation numbers with v14.x
Syncs master and v14.x for DEP0143 - `Transform._transformState`.
Bumps `module.parent` from DEP0143 to DEP0144 on master. Adds
missing DEP number and  metadata for DEP0145: `socket.bufferSize`.

PR-URL: https://github.com/nodejs/node/pull/34368
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-07-15 11:37:37 -04:00
Guy Bedford
e212955e8a doc: clarify conditional exports guidance
PR-URL: https://github.com/nodejs/node/pull/34306
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
2020-07-14 08:04:49 -07:00
Anna Henningsen
a038199265
src,doc,test: remove String::New default parameter
`kNormal` has been the implicit default for a while now (since V8 7.6).

Refs: e0d7f81699

PR-URL: https://github.com/nodejs/node/pull/34248
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-07-14 15:13:34 +02:00
James M Snell
f1dc5cd614
doc: buffer documentation improvements
PR-URL: https://github.com/nodejs/node/pull/34230
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-14 15:11:31 +02:00
Anna Henningsen
725cf4764a
worker: add option to track unmanaged file descriptors
Add a public option for Workers which adds tracking for raw
file descriptors, as currently, those resources are not cleaned
up, unlike e.g. `FileHandle`s.

PR-URL: https://github.com/nodejs/node/pull/34303
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-07-14 15:07:20 +02:00
Rich Trott
f902170af6 doc: improve text in fs docs about omitting callbacks
Repair misplaced colon and condense text.

PR-URL: https://github.com/nodejs/node/pull/34307
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-07-13 15:35:39 -07:00
Mateusz Krawczuk
2e6c3e2301 tls: make 'createSecureContext' honor more options
Added options: `ticketKeys` and `sessionTimeout`, that are honored by
`createServer`, that calls `createSecureContext`.

This also introduces a minor code simplification.

PR-URL: https://github.com/nodejs/node/pull/33974
Fixes: https://github.com/nodejs/node/issues/20908
Reviewed-By: Alba Mendez <me@alba.sh>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
2020-07-13 10:48:32 +02:00
Rich Trott
ac6ecd6b7f doc: reword warnings about sockets passed to subprocesses
Make the docs more concise. Make warnings direct ("do not use" and
"should") rather than "is not recommended" or "is recommended".

PR-URL: https://github.com/nodejs/node/pull/34273
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-07-11 21:03:03 -07:00
James M Snell
48a349efd9 quic: use Number instead of BigInt for more stats
PR-URL: https://github.com/nodejs/node/pull/34262
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-10 13:51:16 -07:00
James M Snell
5e769b2eaf quic: use less specific error codes
Stop the madness. Only you can prevent excessive error code
proliferation.

PR-URL: https://github.com/nodejs/node/pull/34262
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-10 13:51:13 -07:00
Guy Bedford
1237955d41 module: package "imports" field
PR-URL: https://github.com/nodejs/node/pull/34117
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2020-07-09 19:19:35 -07:00
James M Snell
99f0404646 doc: specify encoding in text/html examples
Fixes: https://github.com/nodejs/node/issues/29739

PR-URL: https://github.com/nodejs/node/pull/34222
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-07-09 08:49:50 -07:00
James M Snell
f98a441bf7 doc: document the ready event for Http2Stream
Fixes: https://github.com/nodejs/node/issues/22804

PR-URL: https://github.com/nodejs/node/pull/34221
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-07-09 07:36:34 -07:00
James M Snell
a720c0edcc doc: add comment to example about 2xx status codes
Fixes: https://github.com/nodejs/node/issues/29714

PR-URL: https://github.com/nodejs/node/pull/34223
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-07-09 07:35:37 -07:00
James M Snell
14ac6e4226 doc: document that whitespace is ignored in base64 decoding
Fixes: https://github.com/nodejs/node/issues/8569

PR-URL: https://github.com/nodejs/node/pull/34227
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-07-09 07:34:30 -07:00
James M Snell
62bdb7e801 doc: add note about multiple sync events and once
Fixes: https://github.com/nodejs/node/issues/32431

PR-URL: https://github.com/nodejs/node/pull/34220
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-07-09 07:31:54 -07:00
James M Snell
949d1c1f0c doc: document behavior for once(ee, 'error')
Fixes: https://github.com/nodejs/node/issues/31244

PR-URL: https://github.com/nodejs/node/pull/34225
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-09 07:25:08 -07:00
James M Snell
a95fb930d0 doc: document security issues with url.parse()
Fixes: https://github.com/nodejs/node/issues/31279

PR-URL: https://github.com/nodejs/node/pull/34226
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-07-09 07:21:04 -07:00
James M Snell
fe11f6bf7c quic: cleanup QuicSocketFlags, used shared state struct
Some of the flags were no longer being used.

Switched to use an AliasedStruct for shared state to avoid
extraneous expensive JS=>C++ calls.

Removed unused QuicSocket option

PR-URL: https://github.com/nodejs/node/pull/34247
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-09 07:15:43 -07:00
James M Snell
71236097d0 quic: use Number() instead of bigint for QuicSocket stats
PR-URL: https://github.com/nodejs/node/pull/34247
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-09 07:14:17 -07:00
James M Snell
94372b124a quic: refactor/improve/document QuicSocket listening event
PR-URL: https://github.com/nodejs/node/pull/34247
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-09 07:14:14 -07:00
James M Snell
cc89aac5f7 quic: refactor/improve error handling for busy event
Also, change setServerBusy into a setter

PR-URL: https://github.com/nodejs/node/pull/34247
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-09 07:14:07 -07:00
James M Snell
edc71ef008 quic: handle errors thrown / rejections in the session event
Errors thrown within the session event handler will be handled
by destroying the session (allowing a proper connection close
to be sent to the client peer). They will not crash the parent
QuicSocket by default. Instead, a `'sessionError'` event will
be emitted, allowing the error to be logged or handled.

PR-URL: https://github.com/nodejs/node/pull/34247
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-09 07:14:05 -07:00
rickyes
527e2147af stream: add promises version to utility functions
PR-URL: https://github.com/nodejs/node/pull/33991
Fixes: https://github.com/nodejs/node/issues/33582
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2020-07-09 09:12:19 +02:00
sapics
3975799f26 doc: replace http to https of link urls
PR-URL: https://github.com/nodejs/node/pull/34158
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-07-06 07:03:05 -07:00
Rich Trott
bf772896fe doc: remove errors that were never released
Refs: https://github.com/nodejs/node/pull/33764#issuecomment-653667275

PR-URL: https://github.com/nodejs/node/pull/34197
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-07-06 07:02:17 -07:00
Rich Trott
654df09ae0 doc: move ERR_FEATURE_UNAVAILABLE_ON_PLATFORM to current errors
ERR_FEATURE_UNAVAILABLE_ON_PLATFORM is incorrectly included in the list
of errors that have never been released. It was added in
67e067eb06 and included in every release
in the 14.x line.

PR-URL: https://github.com/nodejs/node/pull/34196
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-07-05 15:05:43 -07:00
James M Snell
e7dadd376e doc: specify how fs.WriteStream/ReadStreams are created
Alternative to https://github.com/nodejs/node/pull/33841

Co-authored-by: zombieleet <zombieleetnca@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/34188
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-07-05 14:19:42 -07:00
James M Snell
7b062ca015 quic: refactor qlog handling
Because of the timing of qlog events emitted by ngtcp2, it
becomes difficult to handle those as events on the QuicSession
object because the final qlog entry is not emitted until the
ngtcp2_conn is freed, which can occur when the object is being
garbage collected (meaning, we a: can't call out to javascript
and b: don't have an object we can use to emit the event).

This refactors it into a QLogStream object that allows the
qlog data to be piped out using a separate Readable stream.

PR-URL: https://github.com/nodejs/node/pull/34160
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-05 14:17:33 -07:00
Rich Trott
56dbe466fd doc: remove parenthetical \r\n comment in http and http2 docs
The explanation that the HTTP requests include `\r\n` is true but not
important or relevant in these two specific contexts.

PR-URL: https://github.com/nodejs/node/pull/34178
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-07-04 16:46:26 -07:00
Rich Trott
21005c3b44 doc: remove stability from unreleased errors
Remove stability indicators from errors that only existed on the master
branch and are not in the release.

PR-URL: https://github.com/nodejs/node/pull/33764
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-04 05:51:42 -07:00
Bradley Farias
16f3b6a01b doc: util.debuglog callback
PR-URL: https://github.com/nodejs/node/pull/33856
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-07-03 15:01:10 -07:00