Skip to content

Commit 3be70ff

Browse files
jasnelladuh95
authored andcommitted
quic: multiple fixups and updates
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #59342 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
1 parent b91a934 commit 3be70ff

44 files changed

Lines changed: 649 additions & 363 deletions

Some content is hidden

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

configure.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -949,12 +949,6 @@
949949

950950
# End dummy list.
951951

952-
parser.add_argument('--with-quic',
953-
action='store_true',
954-
dest='quic',
955-
default=None,
956-
help='build with QUIC support')
957-
958952
parser.add_argument('--without-ssl',
959953
action='store_true',
960954
dest='without_ssl',
@@ -1941,7 +1935,6 @@ def configure_openssl(o):
19411935
variables['node_shared_ngtcp2'] = b(options.shared_ngtcp2)
19421936
variables['node_shared_nghttp3'] = b(options.shared_nghttp3)
19431937
variables['openssl_is_fips'] = b(options.openssl_is_fips)
1944-
variables['node_quic'] = b(options.quic)
19451938
variables['node_fipsinstall'] = b(False)
19461939

19471940
if options.openssl_no_asm:
@@ -2003,12 +1996,6 @@ def without_ssl_error(option):
20031996
if options.openssl_is_fips and not options.shared_openssl:
20041997
variables['node_fipsinstall'] = b(True)
20051998

2006-
variables['openssl_quic'] = b(options.quic)
2007-
if options.quic:
2008-
o['defines'] += ['NODE_OPENSSL_HAS_QUIC']
2009-
2010-
o['variables']['openssl_version'] = get_openssl_version()
2011-
20121999
configure_library('openssl', o)
20132000

20142001
def configure_sqlite(o):

doc/api/cli.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,16 @@ If the ES module being `require()`'d contains top-level `await`, this flag
11401140
allows Node.js to evaluate the module, try to locate the
11411141
top-level awaits, and print their location to help users find them.
11421142

1143+
### `--experimental-quic`
1144+
1145+
<!-- YAML
1146+
added: REPLACEME
1147+
-->
1148+
1149+
> Stability: 1.1 - Active development
1150+
1151+
Enable experimental support for the QUIC protocol.
1152+
11431153
### `--experimental-sea-config`
11441154

11451155
<!-- YAML
@@ -1812,6 +1822,16 @@ added: v21.2.0
18121822
18131823
Disable exposition of [Navigator API][] on the global scope.
18141824

1825+
### `--no-experimental-quic`
1826+
1827+
<!-- YAML
1828+
added: REPLACEME
1829+
-->
1830+
1831+
> Stability: 1.1 - Active Development
1832+
1833+
Use this flag to disable QUIC.
1834+
18151835
### `--no-experimental-repl-await`
18161836

18171837
<!-- YAML

doc/node-config-schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@
159159
"experimental-print-required-tla": {
160160
"type": "boolean"
161161
},
162+
"experimental-quic": {
163+
"type": "boolean"
164+
},
162165
"experimental-repl-await": {
163166
"type": "boolean"
164167
},

doc/node.1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ flag is no longer required as WASI is enabled by default.
229229
.It Fl -experimental-quic
230230
Enable the experimental QUIC support.
231231
.
232+
.It Fl -no-experimental-quic
233+
Disable the experimental QUIC support.
234+
.
232235
.It Fl -experimental-inspector-network-resource
233236
Enable experimental support for inspector network resources.
234237
.

lib/internal/bootstrap/node.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,13 @@ const features = {
285285
get require_module() {
286286
return getOptionValue('--require-module');
287287
},
288+
get quic() {
289+
// TODO(@jasnell): When the implementation is updated to support Boring,
290+
// then this should be refactored to depend not only on the OpenSSL version.
291+
return !openSSLIsBoringSSL &&
292+
getOptionValue('--experimental-quic') &&
293+
process.config.variables.openssl_version >= 810549279; // >= 3.5.1
294+
},
288295
};
289296

290297
ObjectDefineProperty(process, 'features', {

node.gyp

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,14 @@
200200
'src/quic/preferredaddress.cc',
201201
'src/quic/sessionticket.cc',
202202
'src/quic/tokens.cc',
203-
# 'src/quic/transportparams.cc',
203+
'src/quic/application.cc',
204+
'src/quic/endpoint.cc',
205+
'src/quic/http3.cc',
206+
'src/quic/session.cc',
207+
'src/quic/streams.cc',
208+
'src/quic/tlscontext.cc',
209+
'src/quic/transportparams.cc',
210+
'src/quic/quic.cc',
204211
# headers to make for a more pleasant IDE experience
205212
'src/aliased_buffer.h',
206213
'src/aliased_buffer-inl.h',
@@ -347,7 +354,13 @@
347354
'src/quic/preferredaddress.h',
348355
'src/quic/sessionticket.h',
349356
'src/quic/tokens.h',
350-
# 'src/quic/transportparams.h',
357+
'src/quic/transportparams.h',
358+
'src/quic/application.h',
359+
'src/quic/endpoint.h',
360+
'src/quic/http3.h',
361+
'src/quic/session.h',
362+
'src/quic/streams.h',
363+
'src/quic/tlscontext.h',
351364
'src/quic/guard.h',
352365
],
353366
'node_crypto_sources': [
@@ -410,21 +423,6 @@
410423
'src/node_crypto.cc',
411424
'src/node_crypto.h',
412425
],
413-
'node_quic_sources': [
414-
'src/quic/application.cc',
415-
'src/quic/endpoint.cc',
416-
'src/quic/http3.cc',
417-
'src/quic/session.cc',
418-
'src/quic/streams.cc',
419-
'src/quic/tlscontext.cc',
420-
'src/quic/application.h',
421-
'src/quic/endpoint.h',
422-
'src/quic/http3.h',
423-
'src/quic/session.h',
424-
'src/quic/streams.h',
425-
'src/quic/tlscontext.h',
426-
'src/quic/quic.cc',
427-
],
428426
'node_cctest_openssl_sources': [
429427
'test/cctest/test_crypto_clienthello.cc',
430428
'test/cctest/test_node_crypto.cc',
@@ -1003,11 +1001,6 @@
10031001
'deps/ncrypto/ncrypto.gyp:ncrypto',
10041002
],
10051003
}],
1006-
[ 'node_quic=="true"', {
1007-
'sources': [
1008-
'<@(node_quic_sources)',
1009-
],
1010-
}],
10111004
[ 'node_use_sqlite=="true"', {
10121005
'sources': [
10131006
'<@(node_sqlite_sources)',

node.gypi

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,6 @@
432432
}],
433433
]
434434
}],
435-
[ 'openssl_quic=="true" and node_shared_ngtcp2=="false"', {
436-
'dependencies': [ './deps/ngtcp2/ngtcp2.gyp:ngtcp2' ]
437-
}],
438-
[ 'openssl_quic=="true" and node_shared_nghttp3=="false"', {
439-
'dependencies': [ './deps/ngtcp2/ngtcp2.gyp:nghttp3' ]
440-
}]
441435
]
442436
}, {
443437
'defines': [ 'HAVE_OPENSSL=0' ]

src/node_binding.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "node.h"
1111
#include "node_api.h"
12+
#include "quic/guard.h"
1213
#include "uv.h"
1314

1415
enum {
@@ -29,7 +30,7 @@ static_assert(static_cast<int>(NM_F_LINKED) ==
2930
#define NODE_BUILTIN_ICU_BINDINGS(V)
3031
#endif
3132

32-
#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
33+
#if HAVE_OPENSSL && OPENSSL_NO_QUIC != 1
3334
#define NODE_BUILTIN_QUIC_BINDINGS(V) V(quic)
3435
#else
3536
#define NODE_BUILTIN_QUIC_BINDINGS(V)

src/node_builtins.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "node_external_reference.h"
77
#include "node_internals.h"
88
#include "node_threadsafe_cow-inl.h"
9+
#include "quic/guard.h"
910
#include "simdutf.h"
1011
#include "util-inl.h"
1112
#include "v8-value.h"
@@ -134,10 +135,10 @@ BuiltinLoader::BuiltinCategories BuiltinLoader::GetBuiltinCategories() const {
134135
"internal/http2/core", "internal/http2/compat",
135136
"internal/streams/lazy_transform",
136137
#endif // !HAVE_OPENSSL
137-
#if !NODE_OPENSSL_HAS_QUIC
138+
#ifndef OPENSSL_NO_QUIC
138139
"internal/quic/quic", "internal/quic/symbols", "internal/quic/stats",
139140
"internal/quic/state",
140-
#endif // !NODE_OPENSSL_HAS_QUIC
141+
#endif // !OPENSSL_NO_QUIC
141142
"quic", // Experimental.
142143
"sqlite", // Experimental.
143144
"sys", // Deprecated.

src/node_external_reference.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <cinttypes>
77
#include <vector>
8+
#include "quic/guard.h"
89
#include "v8-fast-api-calls.h"
910
#include "v8.h"
1011

@@ -137,7 +138,7 @@ class ExternalReferenceRegistry {
137138
#define EXTERNAL_REFERENCE_BINDING_LIST_CRYPTO(V)
138139
#endif // HAVE_OPENSSL
139140

140-
#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
141+
#if HAVE_OPENSSL && OPENSSL_NO_QUIC != 1
141142
#define EXTERNAL_REFERENCE_BINDING_LIST_QUIC(V) V(quic)
142143
#else
143144
#define EXTERNAL_REFERENCE_BINDING_LIST_QUIC(V)

0 commit comments

Comments
 (0)