Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 08726cd

Browse filesBrowse files
mcollinaaduh95
authored andcommitted
quic: move quic behind compile time flag
Move node:quic behind a compile-time flag, disabled by default. Use --experimental-quic at configure time to enable. - Add --experimental-quic flag to configure.py - Add node_use_quic variable and HAVE_QUIC define - Make QUIC sources conditional in node.gyp - Move ngtcp2/nghttp3 deps under QUIC condition in node.gypi - Update C++ guards to check HAVE_QUIC - Update process.features.quic to check node_use_quic PR-URL: #61444 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent ea4f19a commit 08726cd
Copy full SHA for 08726cd

24 files changed

+103-59Lines changed: 103 additions & 59 deletions
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎configure.py‎

Copy file name to clipboardExpand all lines: configure.py
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,12 @@
967967
default=None,
968968
help='build without SQLite (disables SQLite and Web Storage API)')
969969

970+
parser.add_argument('--experimental-quic',
971+
action='store_true',
972+
dest='experimental_quic',
973+
default=None,
974+
help='build with experimental QUIC support')
975+
970976
parser.add_argument('--ninja',
971977
action='store_true',
972978
dest='use_ninja',
@@ -2009,6 +2015,10 @@ def without_sqlite_error(option):
20092015

20102016
configure_library('sqlite', o, pkgname='sqlite3')
20112017

2018+
def configure_quic(o):
2019+
o['variables']['node_use_quic'] = b(options.experimental_quic and
2020+
not options.without_ssl)
2021+
20122022
def configure_static(o):
20132023
if options.fully_static or options.partly_static:
20142024
if flavor == 'mac':
@@ -2460,6 +2470,7 @@ def make_bin_override():
24602470
configure_library('zstd', output, pkgname='libzstd')
24612471
configure_v8(output, configurations)
24622472
configure_openssl(output)
2473+
configure_quic(output)
24632474
configure_intl(output)
24642475
configure_static(output)
24652476
configure_inspector(output)
Collapse file

‎lib/internal/bootstrap/node.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ const features = {
288288
get quic() {
289289
// TODO(@jasnell): When the implementation is updated to support Boring,
290290
// then this should be refactored to depend not only on the OpenSSL version.
291-
return !openSSLIsBoringSSL &&
291+
return process.config.variables.node_use_quic &&
292+
!openSSLIsBoringSSL &&
292293
getOptionValue('--experimental-quic') &&
293294
process.config.variables.openssl_version >= 810549279; // >= 3.5.1
294295
},
Collapse file

‎node.gyp‎

Copy file name to clipboardExpand all lines: node.gyp
+33-16Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
'node_use_bundled_v8%': 'true',
3333
'node_use_node_snapshot%': 'false',
3434
'node_use_openssl%': 'true',
35+
'node_use_quic%': 'false',
3536
'node_use_sqlite%': 'true',
3637
'node_use_v8_platform%': 'true',
3738
'node_v8_options%': '',
@@ -192,22 +193,6 @@
192193
'src/udp_wrap.cc',
193194
'src/util.cc',
194195
'src/uv.cc',
195-
'src/quic/bindingdata.cc',
196-
'src/quic/cid.cc',
197-
'src/quic/data.cc',
198-
'src/quic/logstream.cc',
199-
'src/quic/packet.cc',
200-
'src/quic/preferredaddress.cc',
201-
'src/quic/sessionticket.cc',
202-
'src/quic/tokens.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',
211196
# headers to make for a more pleasant IDE experience
212197
'src/aliased_buffer.h',
213198
'src/aliased_buffer-inl.h',
@@ -345,6 +330,24 @@
345330
'src/udp_wrap.h',
346331
'src/util.h',
347332
'src/util-inl.h',
333+
],
334+
'node_quic_sources': [
335+
'src/quic/bindingdata.cc',
336+
'src/quic/cid.cc',
337+
'src/quic/data.cc',
338+
'src/quic/logstream.cc',
339+
'src/quic/packet.cc',
340+
'src/quic/preferredaddress.cc',
341+
'src/quic/sessionticket.cc',
342+
'src/quic/tokens.cc',
343+
'src/quic/application.cc',
344+
'src/quic/endpoint.cc',
345+
'src/quic/http3.cc',
346+
'src/quic/session.cc',
347+
'src/quic/streams.cc',
348+
'src/quic/tlscontext.cc',
349+
'src/quic/transportparams.cc',
350+
'src/quic/quic.cc',
348351
'src/quic/arena.h',
349352
'src/quic/bindingdata.h',
350353
'src/quic/cid.h',
@@ -428,6 +431,8 @@
428431
'test/cctest/test_crypto_clienthello.cc',
429432
'test/cctest/test_node_crypto.cc',
430433
'test/cctest/test_node_crypto_env.cc',
434+
],
435+
'node_cctest_quic_sources': [
431436
'test/cctest/test_quic_arena.cc',
432437
'test/cctest/test_quic_cid.cc',
433438
'test/cctest/test_quic_error.cc',
@@ -1008,6 +1013,11 @@
10081013
'<@(node_sqlite_sources)',
10091014
],
10101015
}],
1016+
[ 'node_use_quic=="true"', {
1017+
'sources': [
1018+
'<@(node_quic_sources)',
1019+
],
1020+
}],
10111021
[ 'OS in "linux freebsd mac solaris openharmony" and '
10121022
'target_arch=="x64" and '
10131023
'node_target_type=="executable"', {
@@ -1312,6 +1322,13 @@
13121322
}, {
13131323
'sources!': [ '<@(node_cctest_openssl_sources)' ],
13141324
}],
1325+
[ 'node_use_quic=="true"', {
1326+
'defines': [
1327+
'HAVE_QUIC=1',
1328+
],
1329+
}, {
1330+
'sources!': [ '<@(node_cctest_quic_sources)' ],
1331+
}],
13151332
['v8_enable_inspector==1', {
13161333
'defines': [
13171334
'HAVE_INSPECTOR=1',
Collapse file

‎node.gypi‎

Copy file name to clipboardExpand all lines: node.gypi
+17-2Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,6 @@
390390
'defines': [ 'OPENSSL_API_COMPAT=0x10100000L', ],
391391
'dependencies': [
392392
'./deps/openssl/openssl.gyp:openssl',
393-
'./deps/ngtcp2/ngtcp2.gyp:ngtcp2',
394-
'./deps/ngtcp2/ngtcp2.gyp:nghttp3',
395393

396394
# For tests
397395
'./deps/openssl/openssl.gyp:openssl-cli',
@@ -446,5 +444,22 @@
446444
}, {
447445
'defines': [ 'HAVE_SQLITE=0' ]
448446
}],
447+
[ 'node_use_quic=="true"', {
448+
'defines': [ 'HAVE_QUIC=1' ],
449+
'conditions': [
450+
[ 'node_shared_openssl=="false"', {
451+
'dependencies': [
452+
'./deps/ngtcp2/ngtcp2.gyp:ngtcp2',
453+
'./deps/ngtcp2/ngtcp2.gyp:nghttp3',
454+
455+
# For tests
456+
'./deps/ngtcp2/ngtcp2.gyp:ngtcp2_test_server',
457+
'./deps/ngtcp2/ngtcp2.gyp:ngtcp2_test_client',
458+
],
459+
}],
460+
],
461+
}, {
462+
'defines': [ 'HAVE_QUIC=0' ]
463+
}],
449464
],
450465
}
Collapse file

‎src/quic/application.cc‎

Copy file name to clipboardExpand all lines: src/quic/application.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if HAVE_OPENSSL
1+
#if HAVE_OPENSSL && HAVE_QUIC
22
#include "guard.h"
33
#ifndef OPENSSL_NO_QUIC
44
#include <async_wrap-inl.h>
@@ -615,4 +615,4 @@ std::unique_ptr<Session::Application> Session::SelectApplication(
615615
} // namespace node
616616

617617
#endif // OPENSSL_NO_QUIC
618-
#endif // HAVE_OPENSSL
618+
#endif // HAVE_OPENSSL && HAVE_QUIC
Collapse file

‎src/quic/bindingdata.cc‎

Copy file name to clipboardExpand all lines: src/quic/bindingdata.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if HAVE_OPENSSL
1+
#if HAVE_OPENSSL && HAVE_QUIC
22
#include "guard.h"
33
#ifndef OPENSSL_NO_QUIC
44
#include <base_object-inl.h>
@@ -215,4 +215,4 @@ JS_METHOD_IMPL(IllegalConstructor) {
215215
} // namespace node
216216

217217
#endif // OPENSSL_NO_QUIC
218-
#endif // HAVE_OPENSSL
218+
#endif // HAVE_OPENSSL && HAVE_QUIC
Collapse file

‎src/quic/cid.cc‎

Copy file name to clipboardExpand all lines: src/quic/cid.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if HAVE_OPENSSL
1+
#if HAVE_OPENSSL && HAVE_QUIC
22
#include "guard.h"
33
#ifndef OPENSSL_NO_QUIC
44
#include <crypto/crypto_util.h>
@@ -155,4 +155,4 @@ const CID::Factory& CID::Factory::random() {
155155

156156
} // namespace node::quic
157157
#endif // OPENSSL_NO_QUIC
158-
#endif // HAVE_OPENSS
158+
#endif // HAVE_OPENSSL && HAVE_QUIC
Collapse file

‎src/quic/data.cc‎

Copy file name to clipboardExpand all lines: src/quic/data.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if HAVE_OPENSSL
1+
#if HAVE_OPENSSL && HAVE_QUIC
22
#include "guard.h"
33
#ifndef OPENSSL_NO_QUIC
44
#include "data.h"
@@ -417,4 +417,4 @@ const QuicError QuicError::INTERNAL_ERROR = ForNgtcp2Error(NGTCP2_ERR_INTERNAL);
417417
} // namespace node
418418

419419
#endif // OPENSSL_NO_QUIC
420-
#endif // HAVE_OPENSSL
420+
#endif // HAVE_OPENSSL && HAVE_QUIC
Collapse file

‎src/quic/endpoint.cc‎

Copy file name to clipboardExpand all lines: src/quic/endpoint.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if HAVE_OPENSSL
1+
#if HAVE_OPENSSL && HAVE_QUIC
22
#include "guard.h"
33
#ifndef OPENSSL_NO_QUIC
44
#include <aliased_struct-inl.h>
@@ -1756,4 +1756,4 @@ JS_METHOD_IMPL(Endpoint::Ref) {
17561756
} // namespace quic
17571757
} // namespace node
17581758
#endif // OPENSSL_NO_QUIC
1759-
#endif // HAVE_OPENSSL
1759+
#endif // HAVE_OPENSSL && HAVE_QUIC
Collapse file

‎src/quic/http3.cc‎

Copy file name to clipboardExpand all lines: src/quic/http3.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if HAVE_OPENSSL
1+
#if HAVE_OPENSSL && HAVE_QUIC
22
#include "guard.h"
33
#ifndef OPENSSL_NO_QUIC
44
#include "http3.h"
@@ -1071,4 +1071,4 @@ std::unique_ptr<Session::Application> Http3Application::Create(
10711071
} // namespace quic
10721072
} // namespace node
10731073
#endif // OPENSSL_NO_QUIC
1074-
#endif // HAVE_OPENSSL
1074+
#endif // HAVE_OPENSSL && HAVE_QUIC

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.