mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
ea4f19aaa7
commit
08726cd43d
24 files changed
+103
-59
No files matched your search
@@ -967,6 +967,12 @@ parser.add_argument('--without-sqlite',
|
||||
default=None,
|
||||
help='build without SQLite (disables SQLite and Web Storage API)')
|
||||
|
||||
parser.add_argument('--experimental-quic',
|
||||
action='store_true',
|
||||
dest='experimental_quic',
|
||||
default=None,
|
||||
help='build with experimental QUIC support')
|
||||
|
||||
parser.add_argument('--ninja',
|
||||
action='store_true',
|
||||
dest='use_ninja',
|
||||
@@ -2009,6 +2015,10 @@ def configure_sqlite(o):
|
||||
|
||||
configure_library('sqlite', o, pkgname='sqlite3')
|
||||
|
||||
def configure_quic(o):
|
||||
o['variables']['node_use_quic'] = b(options.experimental_quic and
|
||||
not options.without_ssl)
|
||||
|
||||
def configure_static(o):
|
||||
if options.fully_static or options.partly_static:
|
||||
if flavor == 'mac':
|
||||
@@ -2460,6 +2470,7 @@ configure_library('uvwasi', output)
|
||||
configure_library('zstd', output, pkgname='libzstd')
|
||||
configure_v8(output, configurations)
|
||||
configure_openssl(output)
|
||||
configure_quic(output)
|
||||
configure_intl(output)
|
||||
configure_static(output)
|
||||
configure_inspector(output)
|
||||
|
||||
@@ -288,7 +288,8 @@ const features = {
|
||||
get quic() {
|
||||
// TODO(@jasnell): When the implementation is updated to support Boring,
|
||||
// then this should be refactored to depend not only on the OpenSSL version.
|
||||
return !openSSLIsBoringSSL &&
|
||||
return process.config.variables.node_use_quic &&
|
||||
!openSSLIsBoringSSL &&
|
||||
getOptionValue('--experimental-quic') &&
|
||||
process.config.variables.openssl_version >= 810549279; // >= 3.5.1
|
||||
},
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
'node_use_bundled_v8%': 'true',
|
||||
'node_use_node_snapshot%': 'false',
|
||||
'node_use_openssl%': 'true',
|
||||
'node_use_quic%': 'false',
|
||||
'node_use_sqlite%': 'true',
|
||||
'node_use_v8_platform%': 'true',
|
||||
'node_v8_options%': '',
|
||||
@@ -192,22 +193,6 @@
|
||||
'src/udp_wrap.cc',
|
||||
'src/util.cc',
|
||||
'src/uv.cc',
|
||||
'src/quic/bindingdata.cc',
|
||||
'src/quic/cid.cc',
|
||||
'src/quic/data.cc',
|
||||
'src/quic/logstream.cc',
|
||||
'src/quic/packet.cc',
|
||||
'src/quic/preferredaddress.cc',
|
||||
'src/quic/sessionticket.cc',
|
||||
'src/quic/tokens.cc',
|
||||
'src/quic/application.cc',
|
||||
'src/quic/endpoint.cc',
|
||||
'src/quic/http3.cc',
|
||||
'src/quic/session.cc',
|
||||
'src/quic/streams.cc',
|
||||
'src/quic/tlscontext.cc',
|
||||
'src/quic/transportparams.cc',
|
||||
'src/quic/quic.cc',
|
||||
# headers to make for a more pleasant IDE experience
|
||||
'src/aliased_buffer.h',
|
||||
'src/aliased_buffer-inl.h',
|
||||
@@ -345,6 +330,24 @@
|
||||
'src/udp_wrap.h',
|
||||
'src/util.h',
|
||||
'src/util-inl.h',
|
||||
],
|
||||
'node_quic_sources': [
|
||||
'src/quic/bindingdata.cc',
|
||||
'src/quic/cid.cc',
|
||||
'src/quic/data.cc',
|
||||
'src/quic/logstream.cc',
|
||||
'src/quic/packet.cc',
|
||||
'src/quic/preferredaddress.cc',
|
||||
'src/quic/sessionticket.cc',
|
||||
'src/quic/tokens.cc',
|
||||
'src/quic/application.cc',
|
||||
'src/quic/endpoint.cc',
|
||||
'src/quic/http3.cc',
|
||||
'src/quic/session.cc',
|
||||
'src/quic/streams.cc',
|
||||
'src/quic/tlscontext.cc',
|
||||
'src/quic/transportparams.cc',
|
||||
'src/quic/quic.cc',
|
||||
'src/quic/arena.h',
|
||||
'src/quic/bindingdata.h',
|
||||
'src/quic/cid.h',
|
||||
@@ -428,6 +431,8 @@
|
||||
'test/cctest/test_crypto_clienthello.cc',
|
||||
'test/cctest/test_node_crypto.cc',
|
||||
'test/cctest/test_node_crypto_env.cc',
|
||||
],
|
||||
'node_cctest_quic_sources': [
|
||||
'test/cctest/test_quic_arena.cc',
|
||||
'test/cctest/test_quic_cid.cc',
|
||||
'test/cctest/test_quic_error.cc',
|
||||
@@ -1008,6 +1013,11 @@
|
||||
'<@(node_sqlite_sources)',
|
||||
],
|
||||
}],
|
||||
[ 'node_use_quic=="true"', {
|
||||
'sources': [
|
||||
'<@(node_quic_sources)',
|
||||
],
|
||||
}],
|
||||
[ 'OS in "linux freebsd mac solaris openharmony" and '
|
||||
'target_arch=="x64" and '
|
||||
'node_target_type=="executable"', {
|
||||
@@ -1312,6 +1322,13 @@
|
||||
}, {
|
||||
'sources!': [ '<@(node_cctest_openssl_sources)' ],
|
||||
}],
|
||||
[ 'node_use_quic=="true"', {
|
||||
'defines': [
|
||||
'HAVE_QUIC=1',
|
||||
],
|
||||
}, {
|
||||
'sources!': [ '<@(node_cctest_quic_sources)' ],
|
||||
}],
|
||||
['v8_enable_inspector==1', {
|
||||
'defines': [
|
||||
'HAVE_INSPECTOR=1',
|
||||
|
||||
@@ -390,8 +390,6 @@
|
||||
'defines': [ 'OPENSSL_API_COMPAT=0x10100000L', ],
|
||||
'dependencies': [
|
||||
'./deps/openssl/openssl.gyp:openssl',
|
||||
'./deps/ngtcp2/ngtcp2.gyp:ngtcp2',
|
||||
'./deps/ngtcp2/ngtcp2.gyp:nghttp3',
|
||||
|
||||
# For tests
|
||||
'./deps/openssl/openssl.gyp:openssl-cli',
|
||||
@@ -446,5 +444,22 @@
|
||||
}, {
|
||||
'defines': [ 'HAVE_SQLITE=0' ]
|
||||
}],
|
||||
[ 'node_use_quic=="true"', {
|
||||
'defines': [ 'HAVE_QUIC=1' ],
|
||||
'conditions': [
|
||||
[ 'node_shared_openssl=="false"', {
|
||||
'dependencies': [
|
||||
'./deps/ngtcp2/ngtcp2.gyp:ngtcp2',
|
||||
'./deps/ngtcp2/ngtcp2.gyp:nghttp3',
|
||||
|
||||
# For tests
|
||||
'./deps/ngtcp2/ngtcp2.gyp:ngtcp2_test_server',
|
||||
'./deps/ngtcp2/ngtcp2.gyp:ngtcp2_test_client',
|
||||
],
|
||||
}],
|
||||
],
|
||||
}, {
|
||||
'defines': [ 'HAVE_QUIC=0' ]
|
||||
}],
|
||||
],
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <async_wrap-inl.h>
|
||||
@@ -615,4 +615,4 @@ std::unique_ptr<Session::Application> Session::SelectApplication(
|
||||
} // namespace node
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <base_object-inl.h>
|
||||
@@ -215,4 +215,4 @@ JS_METHOD_IMPL(IllegalConstructor) {
|
||||
} // namespace node
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <crypto/crypto_util.h>
|
||||
@@ -155,4 +155,4 @@ const CID::Factory& CID::Factory::random() {
|
||||
|
||||
} // namespace node::quic
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSS
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include "data.h"
|
||||
@@ -417,4 +417,4 @@ const QuicError QuicError::INTERNAL_ERROR = ForNgtcp2Error(NGTCP2_ERR_INTERNAL);
|
||||
} // namespace node
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <aliased_struct-inl.h>
|
||||
@@ -1756,4 +1756,4 @@ JS_METHOD_IMPL(Endpoint::Ref) {
|
||||
} // namespace quic
|
||||
} // namespace node
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include "http3.h"
|
||||
@@ -1071,4 +1071,4 @@ std::unique_ptr<Session::Application> Http3Application::Create(
|
||||
} // namespace quic
|
||||
} // namespace node
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include "logstream.h"
|
||||
@@ -137,4 +137,4 @@ void LogStream::ensure_space(size_t amt) {
|
||||
} // namespace node
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <crypto/crypto_util.h>
|
||||
@@ -221,4 +221,4 @@ Packet::Ptr Packet::CreateVersionNegotiationPacket(
|
||||
} // namespace node::quic
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <env-inl.h>
|
||||
@@ -154,4 +154,4 @@ const CID PreferredAddress::cid() const {
|
||||
} // namespace node
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
|
||||
@@ -63,4 +63,4 @@ NODE_BINDING_PER_ISOLATE_INIT(quic, node::quic::CreatePerIsolateProperties)
|
||||
NODE_BINDING_EXTERNAL_REFERENCE(quic, node::quic::RegisterExternalReferences)
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <aliased_struct-inl.h>
|
||||
@@ -2907,4 +2907,4 @@ void Session::InitPerContext(Realm* realm, Local<Object> target) {
|
||||
} // namespace node
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <env-inl.h>
|
||||
@@ -181,4 +181,4 @@ SessionTicket::AppData::Status SessionTicket::AppData::Extract(SSL* ssl) {
|
||||
} // namespace node
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include "streams.h"
|
||||
@@ -1462,4 +1462,4 @@ void Stream::Schedule(Queue* queue) {
|
||||
} // namespace node
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <async_wrap-inl.h>
|
||||
@@ -857,4 +857,4 @@ void TLSSession::MemoryInfo(MemoryTracker* tracker) const {
|
||||
} // namespace quic
|
||||
} // namespace node
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <crypto/crypto_util.h>
|
||||
@@ -307,4 +307,4 @@ RegularToken::operator const char*() const {
|
||||
} // namespace node::quic
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include "transportparams.h"
|
||||
@@ -304,4 +304,4 @@ void TransportParams::Initialize(Environment* env, Local<Object> target) {
|
||||
} // namespace node
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "quic/guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <env-inl.h>
|
||||
@@ -117,4 +117,4 @@ TEST(CID, Basic) {
|
||||
}
|
||||
}
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "quic/guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <env-inl.h>
|
||||
@@ -126,4 +126,4 @@ TEST(QuicError, TlsAlert) {
|
||||
}
|
||||
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "quic/guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <env-inl.h>
|
||||
@@ -81,4 +81,4 @@ TEST(PreferredAddress, SetTransportParams) {
|
||||
CHECK_EQ(std::string(ipv4_2.host), "123.123.123.123");
|
||||
}
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
@@ -1,4 +1,4 @@
|
||||
#if HAVE_OPENSSL
|
||||
#if HAVE_OPENSSL && HAVE_QUIC
|
||||
#include "quic/guard.h"
|
||||
#ifndef OPENSSL_NO_QUIC
|
||||
#include <gtest/gtest.h>
|
||||
@@ -169,4 +169,4 @@ TEST(RegularToken, Basic) {
|
||||
CHECK(!token.Validate(NGTCP2_PROTO_VER_MAX, address, secret, 10000000000));
|
||||
}
|
||||
#endif // OPENSSL_NO_QUIC
|
||||
#endif // HAVE_OPENSSL
|
||||
#endif // HAVE_OPENSSL && HAVE_QUIC
|
||||
Reference in new issue
Block a user