Commit Graph

41 Commits

Author SHA1 Message Date
Luigi Pinca
e6d5af3c95 doc: fix typos in quic.md
PR-URL: https://github.com/nodejs/node/pull/35444
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-10-04 07:58:45 +02:00
Antoine du Hamel
57f1e3224e doc: sort md references in ASCII order
Refs: https://github.com/nodejs/node/pull/35244

PR-URL: https://github.com/nodejs/node/pull/35191
Fixes: https://github.com/nodejs/node/issues/35189
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-01 06:19:25 -07:00
Antoine du Hamel
ecf5060a42 doc: use .md extension for internal links
This helps catch broken links as part of the test suite. This also
improves the user experience when browsing the markdown files.

PR-URL: https://github.com/nodejs/node/pull/35191
Fixes: https://github.com/nodejs/node/issues/35189
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-01 06:19:12 -07:00
Rich Trott
ccdd1bd82a doc: fix incorrectly marked Buffer in quic.md
Angle brackets are being used where curly brackets are intended.

PR-URL: https://github.com/nodejs/node/pull/35075
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-09-08 06:11:12 -07:00
Rich Trott
496c174d14 doc,quic: simplify "make use of" to "use" in quic.md
PR-URL: https://github.com/nodejs/node/pull/34861
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-08-28 07:11:12 -07:00
James M Snell
c855c3e8ca quic: use net.BlockList for limiting access to a QuicSocket
PR-URL: https://github.com/nodejs/node/pull/34741
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-08-17 11:31:28 -07:00
James M Snell
c17eaa3f3f quic: add natRebinding argument to docs
PR-URL: https://github.com/nodejs/node/pull/34669
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-08-17 11:27:34 -07:00
Anna Henningsen
7a1220a1d7 doc: fix headings in quic.md
PR-URL: https://github.com/nodejs/node/pull/34717
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-08-12 17:13:28 -07:00
James M Snell
5b6cd6fa1a quic: use the SocketAddressLRU to track validation status
PR-URL: https://github.com/nodejs/node/pull/34618
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-08-10 07:52:09 -07:00
Rich Trott
d5c7aec3cb doc: use _can_ to describe actions in quic.md
Per Microsoft style guide:

> When ability is what you need to express, it's OK to use _can_ to
> describe actions or tasks that the reader or program is able to do.
> Use _might_ to express possibility. Don't use _may_, which might be
> interpreted as providing permission.

Refs: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/c/can-may
Refs: https://github.com/nodejs/node/pull/34353#issuecomment-659169228

PR-URL: https://github.com/nodejs/node/pull/34613
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-08-04 16:27:22 -07:00
Rich Trott
319c275b26 doc: use _can_ to describe actions in quic.md
Per Microsoft style guide:

> When ability is what you need to express, it's OK to use _can_ to
> describe actions or tasks that the reader or program is able to do.
> Use _might_ to express possibility. Don't use _may_, which might be
> interpreted as providing permission.

Refs: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/c/can-may
Refs: https://github.com/nodejs/node/pull/34353#issuecomment-659169228

PR-URL: https://github.com/nodejs/node/pull/34613
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2020-08-04 16:27:20 -07:00
James M Snell
4b0275ab87 quic: refactor clientHello
Refactor the `'clientHello'` event into a `clientHelloHandler`
configuration option and async function. Remove the addContext
API as it's not needed.

PR-URL: https://github.com/nodejs/node/pull/34541
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-08-03 12:03:00 +00:00
James M Snell
1f94b89309 quic: refactor ocsp to use async function rather than event/callback
PR-URL: https://github.com/nodejs/node/pull/34498
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-27 13:33:14 -07:00
James M Snell
b06fe33de1 quic: use async _construct for QuicStream
PR-URL: https://github.com/nodejs/node/pull/34351
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-23 06:52:59 -07:00
James M Snell
8bd61d4c38 quic: documentation updates
PR-URL: https://github.com/nodejs/node/pull/34351
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-23 06:52:56 -07:00
James M Snell
086c916997 quic: extensive refactoring of QuicStream lifecycle
This one was a bit of a rabbit hole... but, with this set of
changes, `QuicStream` should now work with autoDestroy, supports
a promisified `close()`, and fixes a number of other internal
bugs that were spotted trying to get it to work.

PR-URL: https://github.com/nodejs/node/pull/34351
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-23 06:52:53 -07:00
James M Snell
83bf0d7e8c quic: remove unneeded quicstream.aborted and fixup docs
PR-URL: https://github.com/nodejs/node/pull/34351
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-23 06:52:47 -07:00
Rich Trott
2c30920886 doc: use sentence-case in quic.md headers
For consistency with the rest of our docs and our style guide, use
sentence-case rather than headline-case in the headers in quic.md.

PR-URL: https://github.com/nodejs/node/pull/34453
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-07-22 17:49:09 -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
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
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
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
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
James M Snell
86e67aaa69
quic: updates to implement for h3-29
PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-06-24 12:33:11 -07:00
Rich Trott
db52ae8b7f doc: use a single space between sentences
We mostly have a single space between the punctuation that ends a
sentence and the start of the next sentence. Change instances with two
spaces to one.

PR-URL: https://github.com/nodejs/node/pull/33995
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-22 19:29:18 -07:00
James M Snell
c7d859e756
quic: refactor and improve ipv6Only
Ignore `ipv6Only: true` when binding to `'udp4'` (this differs from
dgram which will still attempt to apply the flag and will fail during
bind). Improve the test so that it should work consistently.

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/33935
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-22 10:58:20 -07:00
James M Snell
55360443ce
quic: initial QUIC implementation
Co-authored-by: Anna Henningsen <anna@addaleax.net>
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
Co-authored-by: gengjiawen <technicalcute@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
Co-authored-by: Lucas Pardue <lucaspardue.24.7@gmail.com>
Co-authored-by: Ouyang Yadong <oyydoibh@gmail.com>
Co-authored-by: Juan Jos<C3><A9> Arboleda <soyjuanarbol@gmail.com>
Co-authored-by: Trivikram Kamat <trivikr.dev@gmail.com>
Co-authored-by: Denys Otrishko <shishugi@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32379
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-16 09:23:34 -07:00