Skip to content

Commit dab25f9

Browse files
committed
deps: add ngtcp2 test binaries
The goal here is to add the ngtcp2 client and server samples so that we can use them in CI to test our QUIC implementation.
1 parent 3625623 commit dab25f9

File tree

215 files changed

+133793
-33
lines changed

Some content is hidden

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

215 files changed

+133793
-33
lines changed

deps/nghttp2/nghttp2.gyp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@
6767
'sources': [
6868
'<@(nghttp2_sources)',
6969
]
70+
},
71+
{
72+
'target_name': 'sfparse',
73+
'type': 'static_library',
74+
'include_dirs': ['lib'],
75+
'sources': [
76+
'lib/sfparse.c',
77+
],
78+
'direct_dependent_settings': {
79+
'include_dirs': [ 'lib/includes' ]
80+
}
7081
}
7182
]
7283
}

deps/ngtcp2/ngtcp2.gyp

Lines changed: 148 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,36 @@
8787
'nghttp3/lib/nghttp3_unreachable.c',
8888
'nghttp3/lib/nghttp3_vec.c',
8989
'nghttp3/lib/nghttp3_version.c',
90+
],
91+
'ngtcp2_test_server_sources': [
92+
'ngtcp2/examples/tls_server_session_ossl.cc',
93+
'ngtcp2/examples/tls_server_context_ossl.cc',
94+
'ngtcp2/examples/tls_session_base_ossl.cc',
95+
'ngtcp2/examples/util_openssl.cc',
96+
'ngtcp2/examples/http.cc',
97+
'ngtcp2/examples/server_base.cc',
98+
'ngtcp2/examples/shared.cc',
99+
'ngtcp2/examples/server.cc',
100+
'ngtcp2/examples/util.cc',
101+
'ngtcp2/examples/debug.cc',
102+
'ngtcp2/examples/siphash.cc',
103+
'ngtcp2/third-party/urlparse/urlparse.c',
104+
'ngtcp2/third-party/libev/ev.c',
105+
],
106+
'ngtcp2_test_client_sources': [
107+
'ngtcp2/examples/tls_client_session_ossl.cc',
108+
'ngtcp2/examples/tls_client_context_ossl.cc',
109+
'ngtcp2/examples/tls_session_base_ossl.cc',
110+
'ngtcp2/examples/util_openssl.cc',
111+
'ngtcp2/examples/http.cc',
112+
'ngtcp2/examples/client_base.cc',
113+
'ngtcp2/examples/shared.cc',
114+
'ngtcp2/examples/client.cc',
115+
'ngtcp2/examples/util.cc',
116+
'ngtcp2/examples/debug.cc',
117+
'ngtcp2/examples/siphash.cc',
118+
'ngtcp2/third-party/urlparse/urlparse.c',
119+
'ngtcp2/third-party/libev/ev.c',
90120
]
91121
},
92122
'targets': [
@@ -131,19 +161,6 @@
131161
'HAVE_NETINET_IN_H',
132162
],
133163
}],
134-
# TODO: Support OpenSSL 3.5 shared library builds.
135-
# The complexity here is that we need to use the ngtcp2 ossl
136-
# adapter, which does not include any conditional checks to
137-
# see if the version of OpenSSL used has the necessary QUIC
138-
# APIs, so we need to ensure that we conditionally enable use
139-
# of the adapter only when we know that the OpenSSL version we
140-
# are compiling against has the necessary APIs. We can do that
141-
# by checkig the OpenSSL version number but, currently, the
142-
# code that does so checks only the VERSION.dat file that is
143-
# bundled with the openssl dependency. We'll need to update
144-
# that to support the shared library case, where the version
145-
# of the shared library needs to be determined.
146-
#
147164
# TODO: Support Boringssl here also. ngtcp2 provides an adapter
148165
# for Boringssl. If we can detect that boringssl is being used
149166
# here then we can use that adapter and also set the
@@ -225,6 +242,124 @@
225242
'sources': [
226243
'<@(nghttp3_sources)'
227244
]
245+
},
246+
{
247+
'target_name': 'ngtcp2_test_server',
248+
'type': 'executable',
249+
'cflags': [ '-Wno-everything' ],
250+
'include_dirs': [
251+
'',
252+
'ngtcp2/examples/',
253+
'ngtcp2/lib/includes/',
254+
'ngtcp2/crypto/includes/',
255+
'ngtcp2/third-party/urlparse/',
256+
'ngtcp2/third-party/libev/',
257+
'../../nghttp2/lib',
258+
],
259+
'dependencies': [
260+
'ngtcp2',
261+
'nghttp3',
262+
'../openssl/openssl.gyp:openssl',
263+
'../nghttp2/nghttp2.gyp:sfparse',
264+
],
265+
'defines': [
266+
'HAVE_CONFIG_H',
267+
'WITH_EXAMPLE_OSSL',
268+
'EV_STANDALONE=1',
269+
],
270+
'conditions': [
271+
['OS=="mac"', {
272+
'defines': [
273+
'__APPLE_USE_RFC_3542',
274+
]
275+
}],
276+
['OS=="win"', {
277+
'defines': [
278+
'WIN32',
279+
'_WINDOWS',
280+
],
281+
'msvs_settings': {
282+
'VCCLCompilerTool': {
283+
'CompileAs': '1'
284+
},
285+
},
286+
}],
287+
['OS!="win"', {
288+
'defines': [
289+
'HAVE_UNISTD_H',
290+
'HAVE_ARPA_INET_H',
291+
'HAVE_NETINET_IN_H',
292+
'HAVE_NETINET_IP_H',
293+
],
294+
}],
295+
[ 'OS=="linux" or OS=="openharmony"', {
296+
'link_settings': {
297+
'libraries': [ '-ldl', '-lrt' ],
298+
},
299+
}],
300+
],
301+
'sources': [
302+
'<@(ngtcp2_test_server_sources)'
303+
]
304+
},
305+
{
306+
'target_name': 'ngtcp2_test_client',
307+
'type': 'executable',
308+
'cflags': [ '-Wno-everything' ],
309+
'include_dirs': [
310+
'',
311+
'ngtcp2/examples/',
312+
'ngtcp2/lib/includes/',
313+
'ngtcp2/crypto/includes/',
314+
'ngtcp2/third-party/urlparse/',
315+
'ngtcp2/third-party/libev/',
316+
'../../nghttp2/lib',
317+
],
318+
'dependencies': [
319+
'ngtcp2',
320+
'nghttp3',
321+
'../openssl/openssl.gyp:openssl',
322+
'../nghttp2/nghttp2.gyp:sfparse',
323+
],
324+
'defines': [
325+
'HAVE_CONFIG_H',
326+
'WITH_EXAMPLE_OSSL',
327+
'EV_STANDALONE=1',
328+
],
329+
'conditions': [
330+
['OS=="mac"', {
331+
'defines': [
332+
'__APPLE_USE_RFC_3542',
333+
]
334+
}],
335+
['OS=="win"', {
336+
'defines': [
337+
'WIN32',
338+
'_WINDOWS',
339+
],
340+
'msvs_settings': {
341+
'VCCLCompilerTool': {
342+
'CompileAs': '1'
343+
},
344+
},
345+
}],
346+
['OS!="win"', {
347+
'defines': [
348+
'HAVE_UNISTD_H',
349+
'HAVE_ARPA_INET_H',
350+
'HAVE_NETINET_IN_H',
351+
'HAVE_NETINET_IP_H',
352+
],
353+
}],
354+
[ 'OS=="linux" or OS=="openharmony"', {
355+
'link_settings': {
356+
'libraries': [ '-ldl', '-lrt' ],
357+
},
358+
}],
359+
],
360+
'sources': [
361+
'<@(ngtcp2_test_client_sources)'
362+
]
228363
}
229364
]
230365
}

0 commit comments

Comments
 (0)