Skip to content

Commit 876e0ff

Browse files
committed
quic: multiple fixups and updates
Signed-off-by: James M Snell <[email protected]>
1 parent e92044c commit 876e0ff

Some content is hidden

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

46 files changed

+664
-370
lines changed

configure.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -846,12 +846,6 @@
846846

847847
# End dummy list.
848848

849-
parser.add_argument('--with-quic',
850-
action='store_true',
851-
dest='quic',
852-
default=None,
853-
help='build with QUIC support')
854-
855849
parser.add_argument('--without-ssl',
856850
action='store_true',
857851
dest='without_ssl',
@@ -1821,7 +1815,6 @@ def configure_openssl(o):
18211815
variables['node_shared_ngtcp2'] = b(options.shared_ngtcp2)
18221816
variables['node_shared_nghttp3'] = b(options.shared_nghttp3)
18231817
variables['openssl_is_fips'] = b(options.openssl_is_fips)
1824-
variables['node_quic'] = b(options.quic)
18251818
variables['node_fipsinstall'] = b(False)
18261819

18271820
if options.openssl_no_asm:
@@ -1883,10 +1876,6 @@ def without_ssl_error(option):
18831876
if options.openssl_is_fips and not options.shared_openssl:
18841877
variables['node_fipsinstall'] = b(True)
18851878

1886-
variables['openssl_quic'] = b(options.quic)
1887-
if options.quic:
1888-
o['defines'] += ['NODE_OPENSSL_HAS_QUIC']
1889-
18901879
o['variables']['openssl_version'] = get_openssl_version()
18911880

18921881
configure_library('openssl', o)

doc/api/cli.md

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

1137+
### `--experimental-quic`
1138+
1139+
<!-- YAML
1140+
added: REPLACEME
1141+
-->
1142+
1143+
> Stability: 1.1 - Active development
1144+
1145+
Enable experimental support for the QUIC protocol.
1146+
11371147
### `--experimental-require-module`
11381148

11391149
<!-- YAML
@@ -1815,6 +1825,16 @@ added: v21.2.0
18151825
18161826
Disable exposition of [Navigator API][] on the global scope.
18171827

1828+
### `--no-experimental-quic`
1829+
1830+
<!-- YAML
1831+
added: REPLACEME
1832+
-->
1833+
1834+
> Stability: 1.1 - Active Development
1835+
1836+
Use this flag to disable QUIC.
1837+
18181838
### `--no-experimental-repl-await`
18191839

18201840
<!-- 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
@@ -226,6 +226,9 @@ flag is no longer required as WASI is enabled by default.
226226
.It Fl -experimental-quic
227227
Enable the experimental QUIC support.
228228
.
229+
.It Fl -no-experimental-quic
230+
Disable the experimental QUIC support.
231+
.
229232
.It Fl -experimental-inspector-network-resource
230233
Enable experimental support for inspector network resources.
231234
.

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('--experimental-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
@@ -195,7 +195,14 @@
195195
'src/quic/preferredaddress.cc',
196196
'src/quic/sessionticket.cc',
197197
'src/quic/tokens.cc',
198-
# 'src/quic/transportparams.cc',
198+
'src/quic/application.cc',
199+
'src/quic/endpoint.cc',
200+
'src/quic/http3.cc',
201+
'src/quic/session.cc',
202+
'src/quic/streams.cc',
203+
'src/quic/tlscontext.cc',
204+
'src/quic/transportparams.cc',
205+
'src/quic/quic.cc',
199206
# headers to make for a more pleasant IDE experience
200207
'src/aliased_buffer.h',
201208
'src/aliased_buffer-inl.h',
@@ -341,7 +348,13 @@
341348
'src/quic/preferredaddress.h',
342349
'src/quic/sessionticket.h',
343350
'src/quic/tokens.h',
344-
# 'src/quic/transportparams.h',
351+
'src/quic/transportparams.h',
352+
'src/quic/application.h',
353+
'src/quic/endpoint.h',
354+
'src/quic/http3.h',
355+
'src/quic/session.h',
356+
'src/quic/streams.h',
357+
'src/quic/tlscontext.h',
345358
'src/quic/guard.h',
346359
],
347360
'node_crypto_sources': [
@@ -396,21 +409,6 @@
396409
'src/node_crypto.cc',
397410
'src/node_crypto.h',
398411
],
399-
'node_quic_sources': [
400-
'src/quic/application.cc',
401-
'src/quic/endpoint.cc',
402-
'src/quic/http3.cc',
403-
'src/quic/session.cc',
404-
'src/quic/streams.cc',
405-
'src/quic/tlscontext.cc',
406-
'src/quic/application.h',
407-
'src/quic/endpoint.h',
408-
'src/quic/http3.h',
409-
'src/quic/session.h',
410-
'src/quic/streams.h',
411-
'src/quic/tlscontext.h',
412-
'src/quic/quic.cc',
413-
],
414412
'node_cctest_openssl_sources': [
415413
'test/cctest/test_crypto_clienthello.cc',
416414
'test/cctest/test_node_crypto.cc',
@@ -954,11 +952,6 @@
954952
'deps/ncrypto/ncrypto.gyp:ncrypto',
955953
],
956954
}],
957-
[ 'node_quic=="true"', {
958-
'sources': [
959-
'<@(node_quic_sources)',
960-
],
961-
}],
962955
[ 'node_use_sqlite=="true"', {
963956
'sources': [
964957
'<@(node_sqlite_sources)',

node.gypi

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,12 +422,6 @@
422422
}],
423423
]
424424
}],
425-
[ 'openssl_quic=="true" and node_shared_ngtcp2=="false"', {
426-
'dependencies': [ './deps/ngtcp2/ngtcp2.gyp:ngtcp2' ]
427-
}],
428-
[ 'openssl_quic=="true" and node_shared_nghttp3=="false"', {
429-
'dependencies': [ './deps/ngtcp2/ngtcp2.gyp:nghttp3' ]
430-
}]
431425
]
432426
}, {
433427
'defines': [ 'HAVE_OPENSSL=0' ]

src/node_binding.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "node.h"
1111
#define NAPI_EXPERIMENTAL
1212
#include "node_api.h"
13+
#include "quic/guard.h"
1314
#include "uv.h"
1415

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

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

src/node_builtins.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "node_external_reference.h"
55
#include "node_internals.h"
66
#include "node_threadsafe_cow-inl.h"
7+
#include "quic/guard.h"
78
#include "simdutf.h"
89
#include "util-inl.h"
910

@@ -137,10 +138,10 @@ BuiltinLoader::BuiltinCategories BuiltinLoader::GetBuiltinCategories() const {
137138
"internal/http2/core", "internal/http2/compat",
138139
"internal/streams/lazy_transform",
139140
#endif // !HAVE_OPENSSL
140-
#if !NODE_OPENSSL_HAS_QUIC
141+
#ifndef OPENSSL_NO_QUIC
141142
"internal/quic/quic", "internal/quic/symbols", "internal/quic/stats",
142143
"internal/quic/state",
143-
#endif // !NODE_OPENSSL_HAS_QUIC
144+
#endif // !OPENSSL_NO_QUIC
144145
"quic", // Experimental.
145146
"sqlite", // Experimental.
146147
"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

@@ -135,7 +136,7 @@ class ExternalReferenceRegistry {
135136
#define EXTERNAL_REFERENCE_BINDING_LIST_CRYPTO(V)
136137
#endif // HAVE_OPENSSL
137138

138-
#if HAVE_OPENSSL && NODE_OPENSSL_HAS_QUIC
139+
#if HAVE_OPENSSL && OPENSSL_NO_QUIC != 1
139140
#define EXTERNAL_REFERENCE_BINDING_LIST_QUIC(V) V(quic)
140141
#else
141142
#define EXTERNAL_REFERENCE_BINDING_LIST_QUIC(V)

0 commit comments

Comments
 (0)