GeezerVison is showing github.com — quic: move quic behind compile time flag · nodejs/node@4bbbe75
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: configure.py +11Lines changed: 11 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 948 | 948 | default=None, | 949 | 949 | help='build without SQLite (disables SQLite and Web Storage API)') | 950 | 950 |
| | 951 | +parser.add_argument('--experimental-quic', | | 952 | + action='store_true', | | 953 | + dest='experimental_quic', | | 954 | + default=None, | | 955 | + help='build with experimental QUIC support') | | 956 | + | 951 | 957 | parser.add_argument('--ninja', | 952 | 958 | action='store_true', | 953 | 959 | dest='use_ninja', | @@ -2007,6 +2013,10 @@ def without_sqlite_error(option): | 2007 | 2013 |
| 2008 | 2014 | configure_library('sqlite', o, pkgname='sqlite3') | 2009 | 2015 |
| | 2016 | +def configure_quic(o): | | 2017 | + o['variables']['node_use_quic'] = b(options.experimental_quic and | | 2018 | + not options.without_ssl) | | 2019 | + | 2010 | 2020 | def configure_static(o): | 2011 | 2021 | if options.fully_static or options.partly_static: | 2012 | 2022 | if flavor == 'mac': | @@ -2458,6 +2468,7 @@ def make_bin_override(): | 2458 | 2468 | configure_library('zstd', output, pkgname='libzstd') | 2459 | 2469 | configure_v8(output, configurations) | 2460 | 2470 | configure_openssl(output) | | 2471 | +configure_quic(output) | 2461 | 2472 | configure_intl(output) | 2462 | 2473 | configure_static(output) | 2463 | 2474 | configure_inspector(output) | |
Collapse file Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -288,7 +288,8 @@ const features = { | 288 | 288 | get quic() { | 289 | 289 | // TODO(@jasnell): When the implementation is updated to support Boring, | 290 | 290 | // 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 && | 292 | 293 | getOptionValue('--experimental-quic') && | 293 | 294 | process.config.variables.openssl_version >= 810549279; // >= 3.5.1 | 294 | 295 | }, | |
Collapse file Copy file name to clipboardExpand all lines: node.gyp +33-16Lines changed: 33 additions & 16 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 31 | 31 | 'node_use_bundled_v8%': 'true', | 32 | 32 | 'node_use_node_snapshot%': 'false', | 33 | 33 | 'node_use_openssl%': 'true', | | 34 | + 'node_use_quic%': 'false', | 34 | 35 | 'node_use_sqlite%': 'true', | 35 | 36 | 'node_use_v8_platform%': 'true', | 36 | 37 | 'node_v8_options%': '', | | 189 | 190 | 'src/udp_wrap.cc', | 190 | 191 | 'src/util.cc', | 191 | 192 | 'src/uv.cc', | 192 | | - 'src/quic/bindingdata.cc', | 193 | | - 'src/quic/cid.cc', | 194 | | - 'src/quic/data.cc', | 195 | | - 'src/quic/logstream.cc', | 196 | | - 'src/quic/packet.cc', | 197 | | - 'src/quic/preferredaddress.cc', | 198 | | - 'src/quic/sessionticket.cc', | 199 | | - 'src/quic/tokens.cc', | 200 | | - 'src/quic/application.cc', | 201 | | - 'src/quic/endpoint.cc', | 202 | | - 'src/quic/http3.cc', | 203 | | - 'src/quic/session.cc', | 204 | | - 'src/quic/streams.cc', | 205 | | - 'src/quic/tlscontext.cc', | 206 | | - 'src/quic/transportparams.cc', | 207 | | - 'src/quic/quic.cc', | 208 | 193 | # headers to make for a more pleasant IDE experience | 209 | 194 | 'src/aliased_buffer.h', | 210 | 195 | 'src/aliased_buffer-inl.h', | | 342 | 327 | 'src/udp_wrap.h', | 343 | 328 | 'src/util.h', | 344 | 329 | 'src/util-inl.h', | | 330 | + ], | | 331 | + 'node_quic_sources': [ | | 332 | + 'src/quic/bindingdata.cc', | | 333 | + 'src/quic/cid.cc', | | 334 | + 'src/quic/data.cc', | | 335 | + 'src/quic/logstream.cc', | | 336 | + 'src/quic/packet.cc', | | 337 | + 'src/quic/preferredaddress.cc', | | 338 | + 'src/quic/sessionticket.cc', | | 339 | + 'src/quic/tokens.cc', | | 340 | + 'src/quic/application.cc', | | 341 | + 'src/quic/endpoint.cc', | | 342 | + 'src/quic/http3.cc', | | 343 | + 'src/quic/session.cc', | | 344 | + 'src/quic/streams.cc', | | 345 | + 'src/quic/tlscontext.cc', | | 346 | + 'src/quic/transportparams.cc', | | 347 | + 'src/quic/quic.cc', | 345 | 348 | 'src/quic/bindingdata.h', | 346 | 349 | 'src/quic/cid.h', | 347 | 350 | 'src/quic/data.h', | | 424 | 427 | 'test/cctest/test_crypto_clienthello.cc', | 425 | 428 | 'test/cctest/test_node_crypto.cc', | 426 | 429 | 'test/cctest/test_node_crypto_env.cc', | | 430 | + ], | | 431 | + 'node_cctest_quic_sources': [ | 427 | 432 | 'test/cctest/test_quic_cid.cc', | 428 | 433 | 'test/cctest/test_quic_error.cc', | 429 | 434 | 'test/cctest/test_quic_preferredaddress.cc', | | 993 | 998 | '<@(node_sqlite_sources)', | 994 | 999 | ], | 995 | 1000 | }], | | 1001 | + [ 'node_use_quic=="true"', { | | 1002 | + 'sources': [ | | 1003 | + '<@(node_quic_sources)', | | 1004 | + ], | | 1005 | + }], | 996 | 1006 | [ 'OS in "linux freebsd mac solaris openharmony" and ' | 997 | 1007 | 'target_arch=="x64" and ' | 998 | 1008 | 'node_target_type=="executable"', { | | 1279 | 1289 | }, { | 1280 | 1290 | 'sources!': [ '<@(node_cctest_openssl_sources)' ], | 1281 | 1291 | }], | | 1292 | + [ 'node_use_quic=="true"', { | | 1293 | + 'defines': [ | | 1294 | + 'HAVE_QUIC=1', | | 1295 | + ], | | 1296 | + }, { | | 1297 | + 'sources!': [ '<@(node_cctest_quic_sources)' ], | | 1298 | + }], | 1282 | 1299 | ['v8_enable_inspector==1', { | 1283 | 1300 | 'defines': [ | 1284 | 1301 | 'HAVE_INSPECTOR=1', | |
Collapse file Copy file name to clipboardExpand all lines: node.gypi +17-4Lines changed: 17 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 385 | 385 | 'defines': [ 'OPENSSL_API_COMPAT=0x10100000L', ], | 386 | 386 | 'dependencies': [ | 387 | 387 | './deps/openssl/openssl.gyp:openssl', | 388 | | - './deps/ngtcp2/ngtcp2.gyp:ngtcp2', | 389 | | - './deps/ngtcp2/ngtcp2.gyp:nghttp3', | 390 | 388 |
| 391 | 389 | # For tests | 392 | 390 | './deps/openssl/openssl.gyp:openssl-cli', | 393 | | - './deps/ngtcp2/ngtcp2.gyp:ngtcp2_test_server', | 394 | | - './deps/ngtcp2/ngtcp2.gyp:ngtcp2_test_client', | 395 | 391 | ], | 396 | 392 | 'conditions': [ | 397 | 393 | # -force_load or --whole-archive are not applicable for | | 443 | 439 | }, { | 444 | 440 | 'defines': [ 'HAVE_SQLITE=0' ] | 445 | 441 | }], | | 442 | + [ 'node_use_quic=="true"', { | | 443 | + 'defines': [ 'HAVE_QUIC=1' ], | | 444 | + 'conditions': [ | | 445 | + [ 'node_shared_openssl=="false"', { | | 446 | + 'dependencies': [ | | 447 | + './deps/ngtcp2/ngtcp2.gyp:ngtcp2', | | 448 | + './deps/ngtcp2/ngtcp2.gyp:nghttp3', | | 449 | + | | 450 | + # For tests | | 451 | + './deps/ngtcp2/ngtcp2.gyp:ngtcp2_test_server', | | 452 | + './deps/ngtcp2/ngtcp2.gyp:ngtcp2_test_client', | | 453 | + ], | | 454 | + }], | | 455 | + ], | | 456 | + }, { | | 457 | + 'defines': [ 'HAVE_QUIC=0' ] | | 458 | + }], | 446 | 459 | ], | 447 | 460 | } |
Collapse file Copy file name to clipboardExpand all lines: src/quic/application.cc +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -#if HAVE_OPENSSL | | 1 | +#if HAVE_OPENSSL && HAVE_QUIC | 2 | 2 | #include "guard.h" | 3 | 3 | #ifndef OPENSSL_NO_QUIC | 4 | 4 | #include "application.h" | @@ -639,4 +639,4 @@ std::unique_ptr<Session::Application> Session::SelectApplication( | 639 | 639 | } // namespace node | 640 | 640 |
| 641 | 641 | #endif // OPENSSL_NO_QUIC | 642 | | -#endif // HAVE_OPENSSL | | 642 | +#endif // HAVE_OPENSSL && HAVE_QUIC |
Collapse file Copy file name to clipboardExpand all lines: src/quic/bindingdata.cc +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -#if HAVE_OPENSSL | | 1 | +#if HAVE_OPENSSL && HAVE_QUIC | 2 | 2 | #include "guard.h" | 3 | 3 | #ifndef OPENSSL_NO_QUIC | 4 | 4 | #include "bindingdata.h" | @@ -224,4 +224,4 @@ JS_METHOD_IMPL(IllegalConstructor) { | 224 | 224 | } // namespace node | 225 | 225 |
| 226 | 226 | #endif // OPENSSL_NO_QUIC | 227 | | -#endif // HAVE_OPENSSL | | 227 | +#endif // HAVE_OPENSSL && HAVE_QUIC |
Collapse file Copy file name to clipboardExpand all lines: src/quic/cid.cc +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -#if HAVE_OPENSSL | | 1 | +#if HAVE_OPENSSL && HAVE_QUIC | 2 | 2 | #include "guard.h" | 3 | 3 | #ifndef OPENSSL_NO_QUIC | 4 | 4 | #include <crypto/crypto_util.h> | @@ -151,4 +151,4 @@ const CID::Factory& CID::Factory::random() { | 151 | 151 |
| 152 | 152 | } // namespace node::quic | 153 | 153 | #endif // OPENSSL_NO_QUIC | 154 | | -#endif // HAVE_OPENSS | | 154 | +#endif // HAVE_OPENSSL && HAVE_QUIC |
Collapse file Copy file name to clipboardExpand all lines: src/quic/data.cc +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -#if HAVE_OPENSSL | | 1 | +#if HAVE_OPENSSL && HAVE_QUIC | 2 | 2 | #include "guard.h" | 3 | 3 | #ifndef OPENSSL_NO_QUIC | 4 | 4 | #include "data.h" | @@ -394,4 +394,4 @@ const QuicError QuicError::INTERNAL_ERROR = ForNgtcp2Error(NGTCP2_ERR_INTERNAL); | 394 | 394 | } // namespace node | 395 | 395 |
| 396 | 396 | #endif // OPENSSL_NO_QUIC | 397 | | -#endif // HAVE_OPENSSL | | 397 | +#endif // HAVE_OPENSSL && HAVE_QUIC |
Collapse file Copy file name to clipboardExpand all lines: src/quic/endpoint.cc +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -#if HAVE_OPENSSL | | 1 | +#if HAVE_OPENSSL && HAVE_QUIC | 2 | 2 | #include "guard.h" | 3 | 3 | #ifndef OPENSSL_NO_QUIC | 4 | 4 | #include "endpoint.h" | @@ -1740,4 +1740,4 @@ JS_METHOD_IMPL(Endpoint::Ref) { | 1740 | 1740 | } // namespace quic | 1741 | 1741 | } // namespace node | 1742 | 1742 | #endif // OPENSSL_NO_QUIC | 1743 | | -#endif // HAVE_OPENSSL | | 1743 | +#endif // HAVE_OPENSSL && HAVE_QUIC |
Collapse file Copy file name to clipboardExpand all lines: src/quic/http3.cc +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -#if HAVE_OPENSSL | | 1 | +#if HAVE_OPENSSL && HAVE_QUIC | 2 | 2 | #include "guard.h" | 3 | 3 | #ifndef OPENSSL_NO_QUIC | 4 | 4 | #include "http3.h" | @@ -996,4 +996,4 @@ std::unique_ptr<Session::Application> Http3Application::Create( | 996 | 996 | } // namespace quic | 997 | 997 | } // namespace node | 998 | 998 | #endif // OPENSSL_NO_QUIC | 999 | | -#endif // HAVE_OPENSSL | | 999 | +#endif // HAVE_OPENSSL && HAVE_QUIC |
|