Skip to content

Commit 3c719e9

Browse files
committed
deps: add ngtcp2 and nghttp3
Reintroduces the ngtcp2 and nghttp3 dependencies, building those by default if the vendored-in openssl (with QUIC support) is used or the shared openssl defines `OPENSSL_INFO_QUIC`. Upates the version metadata to reflect whether ngtcp2 and nghttp3 are present. ngtcp2 as of ngtcp2/ngtcp2@2381f7f nghttp3 as of ngtcp2/nghttp3@66ad30f Signed-off-by: James M Snell <[email protected]>
1 parent a52e95f commit 3c719e9

File tree

131 files changed

+61475
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+61475
-3
lines changed

LICENSE

+52
Original file line numberDiff line numberDiff line change
@@ -1578,3 +1578,55 @@ The externally maintained libraries used by Node.js are:
15781578
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
15791579
SOFTWARE.
15801580
"""
1581+
1582+
- ngtcp2, located at deps/ngtcp2/ngtcp2/, is licensed as follows:
1583+
"""
1584+
The MIT License
1585+
1586+
Copyright (c) 2016 ngtcp2 contributors
1587+
1588+
Permission is hereby granted, free of charge, to any person obtaining
1589+
a copy of this software and associated documentation files (the
1590+
"Software"), to deal in the Software without restriction, including
1591+
without limitation the rights to use, copy, modify, merge, publish,
1592+
distribute, sublicense, and/or sell copies of the Software, and to
1593+
permit persons to whom the Software is furnished to do so, subject to
1594+
the following conditions:
1595+
1596+
The above copyright notice and this permission notice shall be
1597+
included in all copies or substantial portions of the Software.
1598+
1599+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1600+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1601+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1602+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1603+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1604+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1605+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1606+
"""
1607+
1608+
- nghttp3, located at deps/ngtcp2/nghttp3/, is licensed as follows:
1609+
"""
1610+
The MIT License
1611+
1612+
Copyright (c) 2019 nghttp3 contributors
1613+
1614+
Permission is hereby granted, free of charge, to any person obtaining
1615+
a copy of this software and associated documentation files (the
1616+
"Software"), to deal in the Software without restriction, including
1617+
without limitation the rights to use, copy, modify, merge, publish,
1618+
distribute, sublicense, and/or sell copies of the Software, and to
1619+
permit persons to whom the Software is furnished to do so, subject to
1620+
the following conditions:
1621+
1622+
The above copyright notice and this permission notice shall be
1623+
included in all copies or substantial portions of the Software.
1624+
1625+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1626+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1627+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1628+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1629+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1630+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1631+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1632+
"""

configure.py

+48
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,50 @@
284284
dest='shared_nghttp2_libpath',
285285
help='a directory to search for the shared nghttp2 DLLs')
286286

287+
shared_optgroup.add_argument('--shared-nghttp3',
288+
action='store_true',
289+
dest='shared_nghttp3',
290+
default=None,
291+
help='link to a shared nghttp3 DLL instead of static linking')
292+
293+
shared_optgroup.add_argument('--shared-nghttp3-includes',
294+
action='store',
295+
dest='shared_nghttp3_includes',
296+
help='directory containing nghttp3 header files')
297+
298+
shared_optgroup.add_argument('--shared-nghttp3-libname',
299+
action='store',
300+
dest='shared_nghttp3_libname',
301+
default='nghttp3',
302+
help='alternative lib name to link to [default: %(default)s]')
303+
304+
shared_optgroup.add_argument('--shared-nghttp3-libpath',
305+
action='store',
306+
dest='shared_nghttp3_libpath',
307+
help='a directory to search for the shared nghttp3 DLLs')
308+
309+
shared_optgroup.add_argument('--shared-ngtcp2',
310+
action='store_true',
311+
dest='shared_ngtcp2',
312+
default=None,
313+
help='link to a shared ngtcp2 DLL instead of static linking')
314+
315+
shared_optgroup.add_argument('--shared-ngtcp2-includes',
316+
action='store',
317+
dest='shared_ngtcp2_includes',
318+
help='directory containing ngtcp2 header files')
319+
320+
shared_optgroup.add_argument('--shared-ngtcp2-libname',
321+
action='store',
322+
dest='shared_ngtcp2_libname',
323+
default='ngtcp2',
324+
help='alternative lib name to link to [default: %(default)s]')
325+
326+
shared_optgroup.add_argument('--shared-ngtcp2-libpath',
327+
action='store',
328+
dest='shared_ngtcp2_libpath',
329+
help='a directory to search for the shared tcp2 DLLs')
330+
287331
shared_optgroup.add_argument('--shared-openssl',
288332
action='store_true',
289333
dest='shared_openssl',
@@ -1347,6 +1391,8 @@ def configure_openssl(o):
13471391
variables = o['variables']
13481392
variables['node_use_openssl'] = b(not options.without_ssl)
13491393
variables['node_shared_openssl'] = b(options.shared_openssl)
1394+
variables['node_shared_ngtcp2'] = b(options.shared_ngtcp2)
1395+
variables['node_shared_nghttp3'] = b(options.shared_nghttp3)
13501396
variables['openssl_is_fips'] = b(options.openssl_is_fips)
13511397
variables['openssl_fips'] = ''
13521398
variables['openssl_quic'] = b(True)
@@ -1836,6 +1882,8 @@ def make_bin_override():
18361882
configure_library('brotli', output, pkgname=['libbrotlidec', 'libbrotlienc'])
18371883
configure_library('cares', output, pkgname='libcares')
18381884
configure_library('nghttp2', output, pkgname='libnghttp2')
1885+
configure_library('nghttp3', output, pkgname='libnghttp3')
1886+
configure_library('ngtcp2', output, pkgname='libngtcp2')
18391887
configure_v8(output)
18401888
configure_openssl(output)
18411889
configure_intl(output)

deps/ngtcp2/.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.in
2+
*.am
3+
*.txt
4+
*.pc
5+
Makefile
6+
*gnutls*
7+
ngtcp2/**/.gitignore
8+
ngtcp2/**/.deps

deps/ngtcp2/LICENSE_nghttp3

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License
2+
3+
Copyright (c) 2019 nghttp3 contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

deps/ngtcp2/LICENSE_ngtcp2

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License
2+
3+
Copyright (c) 2016 ngtcp2 contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

deps/ngtcp2/README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# ngtcp2 and nghttp3
2+
3+
The ngtcp2 and nghttp3 dependencies provide the core functionality for
4+
QUIC and HTTP/3.
5+
6+
The sources are pulled from:
7+
8+
* ngtcp2: https://github.com/ngtcp2/ngtcp2
9+
* nghttp3: https://github.com/ngtcp2/nghttp3
10+
11+
In both the `ngtcp2` and `nghttp3` git repos, the active development occurs
12+
in the default branch (currently named `master` in each).
13+
14+
We only use a subset of the sources for each.
15+
16+
## Updating
17+
18+
The `nghttp3` library depends on `ngtcp2`. Both should always be updated
19+
together. From `ngtcp2` we only want the contents of the `lib` and `crypto`
20+
directories; from `nghttp3` we only want the contents o the `lib`.
21+
22+
### Updating ngtcp2
23+
24+
To update ngtcp2:
25+
26+
```sh
27+
$ git clone https://github.com/ngtcp2/ngtcp2
28+
$ cd ngtcp2
29+
$ autoreconf -i
30+
$ ./configure --prefix=$PWD/build --enable-lib-only
31+
$ cp -R lib/* ../node/deps/ngtcp2/ngtcp2/lib/
32+
$ cp -R crypto/* ../node/deps/ngtcp2/ngtcp2/crypto/
33+
```
34+
35+
### Updating nghttp3
36+
37+
To update ngtcp2:
38+
39+
```sh
40+
$ git clone https://github.com/ngtcp2/nghttp3
41+
$ cd nghttp3
42+
$ autoreconf -i
43+
$ ./configure --prefix=$PWD/build --enable-lib-only
44+
$ cp -R lib/* ../node/deps/ngtcp2/nghttp3/lib/
45+
```

deps/ngtcp2/config.h

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* Edited to match src/node.h. */
2+
#include <stdint.h>
3+
4+
#ifdef _WIN32
5+
#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
6+
typedef intptr_t ssize_t;
7+
# define _SSIZE_T_
8+
# define _SSIZE_T_DEFINED
9+
#endif
10+
#else // !_WIN32
11+
# include <sys/types.h> // size_t, ssize_t
12+
#endif // _WIN32
13+
14+
#ifdef _MSC_VER
15+
# include <intrin.h>
16+
# define __builtin_popcount __popcnt
17+
#endif
18+
19+
/* Define to 1 to enable debug output. */
20+
/* #undef DEBUGBUILD */
21+
22+
/* Define to 1 if you have the <arpa/inet.h> header file. */
23+
/* #undef HAVE_ARPA_INET_H */
24+
25+
/* Define to 1 if you have the <stddef.h> header file. */
26+
#define HAVE_STDDEF_H 1
27+
28+
/* Define to 1 if you have the <stdint.h> header file. */
29+
#define HAVE_STDINT_H 1
30+
31+
/* Define to 1 if you have the <stdlib.h> header file. */
32+
#define HAVE_STDLIB_H 1
33+
34+
/* Define to 1 if you have the <string.h> header file. */
35+
#define HAVE_STRING_H 1
36+
37+
/* Define to 1 if you have the <unistd.h> header file. */
38+
/* #undef HAVE_UNISTD_H */

0 commit comments

Comments
 (0)