Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

quic: ensure callbacks of QuicSocket.connect() get called #198

Open
wants to merge 119 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
2303d02
src: introduce custom smart pointers for `BaseObject`s
addaleax Sep 28, 2019
ba1c9a3
http2: use custom BaseObject smart pointers
addaleax Sep 28, 2019
84d86f3
quic: initial protocol implementation
danbev Jan 31, 2019
b2d2ca4
http2: use shared memory tracking implementation
addaleax Sep 21, 2019
170c5d0
deps: Add interface required to implement QUIC draft-17
jasnell Feb 1, 2019
ecda77c
deps: Remove EOED when SSL_MODE_QUIC_HACK is enabled
jasnell Feb 1, 2019
963d54c
src: allow unique_ptrs with custom deleter in memory tracker
addaleax Oct 1, 2019
4835a89
quic: support memory tracking
addaleax Oct 1, 2019
c9388c9
doc: fix lint issues in quic.md
danbev Oct 3, 2019
07bdfdf
src: fix BaseObject Detach for GC’ed objects
addaleax Oct 3, 2019
b587abb
lib: fix typo in stream_base_commons.js
addaleax Oct 3, 2019
40e5be0
test: fix test-process-versions for QUIC
addaleax Oct 3, 2019
1cae853
quic: test client connect invalid options
trivikr Oct 6, 2019
746a888
quic: test invalid createSocket
trivikr Oct 5, 2019
92c25a6
quic: default options parameter in constructor
trivikr Oct 5, 2019
70a65d3
quic: compute retransmission timeout correctly
addaleax Oct 8, 2019
d9ee6ab
quic: client should work when receives invalid preferred address
oyyd Oct 7, 2019
81e9492
test: add tests for quic `idleTimeout`
oyyd Oct 9, 2019
777d93f
test: make test-quic-process-cleanup work with --worker
addaleax Oct 8, 2019
da3a546
deps: cherry-pick "unix,udp: ensure addr is non-null"
vtjnash Jun 11, 2019
5e76d74
deps: cherry-pick "unix: set sin_len and sin6_len"
oyyd Sep 27, 2019
08479f4
Revert "deps: Add interface required to implement QUIC draft-17"
jasnell Oct 7, 2019
c37c251
Revert "deps: Remove EOED when SSL_MODE_QUIC_HACK is enabled"
jasnell Oct 7, 2019
fe3b34c
deps: Port BoringSSL QUIC APIs
jasnell Oct 7, 2019
53f668e
deps: update OpenSSL config
jasnell Oct 7, 2019
59d96d1
deps: update ngtcp2
jasnell Sep 16, 2019
abd456b
[Upstream] deps: add handling for x509 and client hello cb
jasnell Oct 8, 2019
1734bd0
quic: move to ngtcp2_crypto
jasnell Sep 27, 2019
968a23c
quic: fix build and tests
addaleax Oct 9, 2019
6b97000
quic: fix idle timeout
oyyd Oct 10, 2019
e2fd30e
fs: introduce `opendir()` and `fs.Dir`
Fishrock123 Aug 28, 2019
4965428
http2: allow passing FileHandle to respondWithFD
addaleax Oct 4, 2019
27cfb37
src: enable `StreamPipe` for generic `StreamBase`s
addaleax Mar 12, 2018
a19682e
quic: implement sendFD() support
addaleax Oct 3, 2019
b224c03
test: add tests for quic
oyyd Oct 12, 2019
328ee27
quic: simplify alpn selection callback
jasnell Oct 10, 2019
369e67d
quic: extract tls handshake to QuicCryptoContext object
jasnell Oct 11, 2019
bea002a
quic: coalesce QuicClientSession and QuicServerSession
jasnell Oct 11, 2019
eeb942c
src: fix lint issue in node_quic_session.cc
danbev Oct 16, 2019
1ff05f4
dgram: use `uv_udp_try_send()`
addaleax Oct 2, 2019
107b141
src: remove HandleWrap instances from list once closed
addaleax Oct 11, 2019
517d09d
dgram: make UDPWrap more reusable
addaleax Oct 9, 2019
243f756
quic: use UDP code from dgram
addaleax Oct 9, 2019
7aaa244
quic: remove CleanupHook from Timer
addaleax Oct 11, 2019
47b02d4
quic: use BaseObjectPtr to keep WriteWrap alive
addaleax Oct 11, 2019
8ba48fa
quic: allow `.connect()` when socket is already bound
addaleax Oct 16, 2019
a76f40a
quic: allow testing QUIC without real UDP handle
addaleax Oct 12, 2019
ac7e2e6
deps: update nghttp3
jasnell Oct 11, 2019
f563a38
quic: initial addition of QuicApplication
jasnell Oct 11, 2019
750f6e6
deps: update ngtcp2
jasnell Oct 11, 2019
c670b08
quic: continued implementation of http/3
jasnell Oct 12, 2019
822f1b9
quic: implement memory tracking for QuicApplication
addaleax Oct 16, 2019
46730e8
test: enable test_quic_verifyhostnameidentity.cc
danbev Oct 16, 2019
b2197b5
quic: allow multiple independent .connect() calls
addaleax Oct 16, 2019
340d6a4
quic: fix linting and tests
addaleax Oct 16, 2019
0e9b721
quic: rename shutdown to reset for RESET_STREAM methods
addaleax Oct 16, 2019
32954ff
quic: make `maxConnectionsPerHost` works
oyyd Oct 26, 2019
0e86369
quic: add pending state for streams
addaleax Oct 26, 2019
2f1cfe8
quic: remove unused vector include
danbev Nov 4, 2019
324cebf
quic: fix override warnings
danbev Nov 4, 2019
f2a3a1d
quic: include limits in node_quic_util.h
danbev Nov 5, 2019
70ffbd0
quic: remove unused functional include in session
danbev Nov 6, 2019
f0b2d20
quic: fix typo on setServerBusy on quic socket
juanarbol Nov 8, 2019
cb8c0b7
quic: remove algorithm include
danbev Nov 8, 2019
da5d7ba
quic: replace unused includes in node_quic.cc
danbev Nov 7, 2019
ac8834d
build: fail when quic is enabled with shared_openssl in configure
lundibundi Nov 12, 2019
0ffa2ea
test: improve code coverage on quic implementation
juanarbol Nov 8, 2019
ef2584b
test: improves quic tests
juanarbol Nov 21, 2019
a0f2124
quic: http3 work in progress
jasnell Oct 16, 2019
8ac8e33
deps: update ngtcp2, ngtcp2-crypto, nghttp3
jasnell Nov 21, 2019
de35acc
quic: fixups after dep update
jasnell Nov 21, 2019
15ae185
quic: additional progress on http3
jasnell Nov 21, 2019
9d09bb9
test: temporarily remove updateKey from test-quic-client-server
jasnell Nov 26, 2019
929611a
quic: show alpn identifier in debug output
jasnell Nov 26, 2019
34ee0bc
quic: http3 configuration options
jasnell Nov 26, 2019
0139d59
quic: add qlog support
addaleax Nov 22, 2019
e160cfd
test: close method should throws on closed session
juanarbol Nov 26, 2019
be2fd1f
test: throws on ping closed quic session
juanarbol Nov 26, 2019
750feec
test: throws ping and openStream on closed session
juanarbol Nov 26, 2019
809d2fb
test: valid halfOpen param in quic session
juanarbol Nov 26, 2019
6bd81bb
test: can't updateKey when quic session is closed
juanarbol Nov 26, 2019
3b6f1f6
quic: additional sendretry tweaks + bug fix
jasnell Dec 1, 2019
4423d80
quic: use const references for QuicCID
jasnell Dec 4, 2019
d94ef55
quic: miscelaneous http3 notes
jasnell Nov 27, 2019
1c28e4d
quic: use const refs for QuicCID passing
jasnell Nov 27, 2019
a010abe
quic: minor additional improvements to QuicCID
jasnell Nov 27, 2019
05ac2a1
quic: move common crypto functions to node_crypto_common.h
jasnell Nov 27, 2019
3af363b
src: use node_crypto_common for node_crypto
jasnell Nov 27, 2019
10f41b8
src: move node_crypto_common-inl to cc
jasnell Dec 4, 2019
c79cfa2
quic: use ngtcp2_path_storage and ngtcp2_path structs
jasnell Dec 1, 2019
81c7b17
quic: refine QuicError
jasnell Dec 1, 2019
66ea869
quic: refactoring node_quic_util to inline
jasnell Dec 1, 2019
cddebf3
src: move SocketAddress into separate header
jasnell Dec 2, 2019
8c8b1ce
quic: add QuicSocketListener
jasnell Dec 3, 2019
9206951
quic: minor refactor for QuicStream::Header
jasnell Dec 3, 2019
603f151
quic: add QuicSessionListener
jasnell Dec 3, 2019
7736100
quic: capture received connection_close details
jasnell Dec 3, 2019
3eaf043
quic: additional session stats
jasnell Dec 3, 2019
a35323d
quic: expose retransmit counts to JS
jasnell Dec 3, 2019
ac49529
quic: record pkt_num_exhausted error
jasnell Dec 3, 2019
0cce929
quic: update docs
jasnell Dec 3, 2019
3d5a7ad
quic: address multiple nits
jasnell Dec 4, 2019
30b3c6a
quic: additional suggested updates
jasnell Dec 4, 2019
5296085
quic: address build issues on linux
jasnell Dec 4, 2019
2a3a9f7
src: fix compiler warnings
jasnell Dec 4, 2019
096f2da
quic: add connection id strategy
jasnell Dec 4, 2019
55236e0
quic: add blockCount statistic
jasnell Dec 4, 2019
be64159
quic: add max offset statistic, expose stream stats to js
jasnell Dec 4, 2019
0dbc14a
quic: use constants for QuicSocket stats
jasnell Dec 4, 2019
27357d5
quic: fix lint issues
jasnell Dec 4, 2019
4e9a96e
quic: additional doc updates
jasnell Dec 4, 2019
02e5389
quic: use const refs
jasnell Dec 5, 2019
08bb8c9
quic: more idiomatic operators
jasnell Dec 5, 2019
f5ae4f7
quic: stateless reset generate strategy
jasnell Dec 4, 2019
23675f2
quic: simplify and condense
jasnell Dec 5, 2019
700ab33
quic: minor cleanups
jasnell Dec 5, 2019
5500d55
quic: get name and value as std::string option
jasnell Dec 5, 2019
1c316ac
doc,tools: fix make doc target for quic.md
danbev Dec 6, 2019
431bce9
quic: ensure callbacks of QuicSocket.connect() get called
oyyd Dec 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,32 @@ The externally maintained libraries used by Node.js are:
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

- ngtcp2, located at deps/ngtcp2, is licensed as follows:
"""
The MIT License

Copyright (c) 2016 ngtcp2 contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

- node-inspect, located at deps/node-inspect, is licensed as follows:
"""
Copyright Node.js contributors. All rights reserved.
Expand Down
20 changes: 14 additions & 6 deletions benchmark/dgram/array-vs-concat.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,25 @@ function main({ dur, len, num, type, chunks }) {

function onsendConcat() {
if (sent++ % num === 0) {
for (var i = 0; i < num; i++) {
socket.send(Buffer.concat(chunk), PORT, '127.0.0.1', onsend);
}
// The setImmediate() is necessary to have event loop progress on OSes
// that only perform synchronous I/O on nonblocking UDP sockets.
setImmediate(() => {
for (var i = 0; i < num; i++) {
socket.send(Buffer.concat(chunk), PORT, '127.0.0.1', onsend);
}
});
}
}

function onsendMulti() {
if (sent++ % num === 0) {
for (var i = 0; i < num; i++) {
socket.send(chunk, PORT, '127.0.0.1', onsend);
}
// The setImmediate() is necessary to have event loop progress on OSes
// that only perform synchronous I/O on nonblocking UDP sockets.
setImmediate(() => {
for (var i = 0; i < num; i++) {
socket.send(chunk, PORT, '127.0.0.1', onsend);
}
});
}
}

Expand Down
10 changes: 7 additions & 3 deletions benchmark/dgram/multi-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ function main({ dur, len, num, type, chunks }) {

function onsend() {
if (sent++ % num === 0) {
for (var i = 0; i < num; i++) {
socket.send(chunk, PORT, '127.0.0.1', onsend);
}
// The setImmediate() is necessary to have event loop progress on OSes
// that only perform synchronous I/O on nonblocking UDP sockets.
setImmediate(() => {
for (var i = 0; i < num; i++) {
socket.send(chunk, PORT, '127.0.0.1', onsend);
}
});
}
}

Expand Down
10 changes: 7 additions & 3 deletions benchmark/dgram/offset-length.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ function main({ dur, len, num, type }) {

function onsend() {
if (sent++ % num === 0) {
for (var i = 0; i < num; i++) {
socket.send(chunk, 0, chunk.length, PORT, '127.0.0.1', onsend);
}
// The setImmediate() is necessary to have event loop progress on OSes
// that only perform synchronous I/O on nonblocking UDP sockets.
setImmediate(() => {
for (var i = 0; i < num; i++) {
socket.send(chunk, 0, chunk.length, PORT, '127.0.0.1', onsend);
}
});
}
}

Expand Down
10 changes: 7 additions & 3 deletions benchmark/dgram/single-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ function main({ dur, len, num, type }) {

function onsend() {
if (sent++ % num === 0) {
for (var i = 0; i < num; i++) {
socket.send(chunk, PORT, '127.0.0.1', onsend);
}
// The setImmediate() is necessary to have event loop progress on OSes
// that only perform synchronous I/O on nonblocking UDP sockets.
setImmediate(() => {
for (var i = 0; i < num; i++) {
socket.send(chunk, PORT, '127.0.0.1', onsend);
}
});
}
}

Expand Down
36 changes: 36 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
choices=valid_os,
help='operating system to build for ({0})'.format(', '.join(valid_os)))

parser.add_option('--experimental-quic',
action='store_true',
dest='experimental_quic',
help='enable experimental quic support')

parser.add_option('--gdb',
action='store_true',
dest='gdb',
Expand Down Expand Up @@ -250,6 +255,27 @@
dest='shared_nghttp2_libpath',
help='a directory to search for the shared nghttp2 DLLs')

shared_optgroup.add_option('--shared-ngtcp2',
action='store_true',
dest='shared_ngtcp2',
help='link to a shared ngtcp2 DLL instead of static linking')

shared_optgroup.add_option('--shared-ngtcp2-includes',
action='store',
dest='shared_ngtcp2_includes',
help='directory containing ngtcp2 header files')

shared_optgroup.add_option('--shared-ngtcp2-libname',
action='store',
dest='shared_ngtcp2_libname',
default='ngtcp2',
help='alternative lib name to link to [default: %default]')

shared_optgroup.add_option('--shared-ngtcp2-libpath',
action='store',
dest='shared_ngctp2_libpath',
help='a directory to search for the shared ngtcp2 DLLs')

shared_optgroup.add_option('--shared-openssl',
action='store_true',
dest='shared_openssl',
Expand Down Expand Up @@ -1093,6 +1119,14 @@ def configure_node(o):
else:
o['variables']['debug_nghttp2'] = 'false'

if options.experimental_quic:
if options.shared_openssl:
raise Exception('QUIC requires modified version of OpenSSL and cannot be'
' enabled with --shared-openssl.')
o['variables']['experimental_quic'] = 1
else:
o['variables']['experimental_quic'] = 'false'

o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)
# TODO(refack): fix this when implementing embedded code-cache when cross-compiling.
if o['variables']['want_separate_host_toolset'] == 0:
Expand Down Expand Up @@ -1213,6 +1247,8 @@ def without_ssl_error(option):
without_ssl_error('--openssl-no-asm')
if options.openssl_fips:
without_ssl_error('--openssl-fips')
if options.experimental_quic:
without_ssl_error('--experimental-quic')
return

if options.use_openssl_ca_store:
Expand Down
22 changes: 22 additions & 0 deletions deps/nghttp3/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License

Copyright (c) 2019 nghttp3 contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39 changes: 39 additions & 0 deletions deps/nghttp3/lib/includes/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

/* Edited to match src/node.h. */
#include <stdint.h>

#ifdef _WIN32
#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
typedef intptr_t ssize_t;
# define _SSIZE_T_
# define _SSIZE_T_DEFINED
#endif
#else // !_WIN32
# include <sys/types.h> // size_t, ssize_t
#endif // _WIN32

#ifdef _MSC_VER
# include <intrin.h>
# define __builtin_popcount __popcnt
#endif

/* Define to 1 to enable debug output. */
/* #undef DEBUGBUILD */

/* Define to 1 if you have the <arpa/inet.h> header file. */
/* #undef HAVE_ARPA_INET_H */

/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the <unistd.h> header file. */
/* #undef HAVE_UNISTD_H */
Loading