Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,12 @@
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',
Expand Down Expand Up @@ -2035,6 +2041,10 @@ def without_sqlite_error(option):

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':
Expand Down Expand Up @@ -2487,6 +2497,7 @@ def make_bin_override():
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)
Expand Down
3 changes: 2 additions & 1 deletion lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
49 changes: 33 additions & 16 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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%': '',
Expand Down Expand Up @@ -190,22 +191,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',
Expand Down Expand Up @@ -343,6 +328,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/bindingdata.h',
'src/quic/cid.h',
'src/quic/data.h',
Expand Down Expand Up @@ -425,6 +428,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_cid.cc',
'test/cctest/test_quic_error.cc',
'test/cctest/test_quic_preferredaddress.cc',
Expand Down Expand Up @@ -998,6 +1003,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"', {
Expand Down Expand Up @@ -1292,6 +1302,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',
Expand Down
21 changes: 17 additions & 4 deletions node.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,9 @@
'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',
'./deps/ngtcp2/ngtcp2.gyp:ngtcp2_test_server',
'./deps/ngtcp2/ngtcp2.gyp:ngtcp2_test_client',
],
'conditions': [
# -force_load or --whole-archive are not applicable for
Expand Down Expand Up @@ -443,5 +439,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' ]
}],
],
}
4 changes: 2 additions & 2 deletions src/quic/application.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include "application.h"
Expand Down Expand Up @@ -639,4 +639,4 @@ std::unique_ptr<Session::Application> Session::SelectApplication(
} // namespace node

#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/bindingdata.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include "bindingdata.h"
Expand Down Expand Up @@ -224,4 +224,4 @@ JS_METHOD_IMPL(IllegalConstructor) {
} // namespace node

#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/cid.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include <crypto/crypto_util.h>
Expand Down Expand Up @@ -151,4 +151,4 @@ const CID::Factory& CID::Factory::random() {

} // namespace node::quic
#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSS
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/data.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include "data.h"
Expand Down Expand Up @@ -394,4 +394,4 @@ const QuicError QuicError::INTERNAL_ERROR = ForNgtcp2Error(NGTCP2_ERR_INTERNAL);
} // namespace node

#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/endpoint.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include "endpoint.h"
Expand Down Expand Up @@ -1740,4 +1740,4 @@ JS_METHOD_IMPL(Endpoint::Ref) {
} // namespace quic
} // namespace node
#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/http3.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include "http3.h"
Expand Down Expand Up @@ -996,4 +996,4 @@ std::unique_ptr<Session::Application> Http3Application::Create(
} // namespace quic
} // namespace node
#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/logstream.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include "logstream.h"
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/quic/packet.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include "packet.h"
Expand Down Expand Up @@ -405,4 +405,4 @@ BaseObjectPtr<Packet> Packet::CreateVersionNegotiationPacket(
} // namespace node

#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/preferredaddress.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include <env-inl.h>
Expand Down Expand Up @@ -156,4 +156,4 @@ const CID PreferredAddress::cid() const {
} // namespace node

#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/quic.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC

Expand Down Expand Up @@ -56,4 +56,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
4 changes: 2 additions & 2 deletions src/quic/session.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include "session.h"
Expand Down Expand Up @@ -2876,4 +2876,4 @@ void Session::InitPerContext(Realm* realm, Local<Object> target) {
} // namespace node

#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/sessionticket.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include "sessionticket.h"
Expand Down Expand Up @@ -182,4 +182,4 @@ SessionTicket::AppData::Status SessionTicket::AppData::Extract(SSL* ssl) {
} // namespace node

#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/streams.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include "streams.h"
Expand Down Expand Up @@ -1322,4 +1322,4 @@ void Stream::Unschedule() {
} // namespace node

#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/tlscontext.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include <async_wrap-inl.h>
Expand Down Expand Up @@ -834,4 +834,4 @@ void TLSSession::MemoryInfo(MemoryTracker* tracker) const {
} // namespace quic
} // namespace node
#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/tokens.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include "tokens.h"
Expand Down Expand Up @@ -303,4 +303,4 @@ RegularToken::operator const char*() const {
} // namespace node::quic

#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions src/quic/transportparams.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "guard.h"
#ifndef OPENSSL_NO_QUIC
#include "transportparams.h"
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions test/cctest/test_quic_cid.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "quic/guard.h"
#ifndef OPENSSL_NO_QUIC
#include <env-inl.h>
Expand Down Expand Up @@ -117,4 +117,4 @@ TEST(CID, Basic) {
}
}
#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions test/cctest/test_quic_error.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "quic/guard.h"
#ifndef OPENSSL_NO_QUIC
#include <env-inl.h>
Expand Down Expand Up @@ -126,4 +126,4 @@ TEST(QuicError, TlsAlert) {
}

#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
4 changes: 2 additions & 2 deletions test/cctest/test_quic_preferredaddress.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if HAVE_OPENSSL
#if HAVE_OPENSSL && HAVE_QUIC
#include "quic/guard.h"
#ifndef OPENSSL_NO_QUIC
#include <env-inl.h>
Expand Down Expand Up @@ -81,4 +81,4 @@ TEST(PreferredAddress, SetTransportParams) {
CHECK_EQ(ipv4_2.address, "123.123.123.123");
}
#endif // OPENSSL_NO_QUIC
#endif // HAVE_OPENSSL
#endif // HAVE_OPENSSL && HAVE_QUIC
Loading
Loading