-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Import current snapshot of QUICHE as an external dependency. #5548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6bf9590
Import current snapshot of QUICHE as an external dependency.
mpwarres 1d45255
Address htuch@ review comments.
mpwarres fcdd491
Merge branch 'master' into import_quiche
mpwarres 8587991
Apply fix_format changes.
mpwarres afde556
Fix clang-tidy errors.
mpwarres 02219ba
Fix mac ci failure caused by differences in OS X version of sed.
mpwarres 11522d6
Merge branch 'master' into import_quiche
mpwarres 90a5c01
Add explanatory comments to quiche.BUILD, along with misc TODOs.
mpwarres 09a72b8
Flesh out QUICHE http2 platform impls.
mpwarres 736e15c
Merge branch 'master' into import_quiche
mpwarres d011bcb
Resolve ODR violations by removing dependency on Envoy assert_lib.
mpwarres ef361ef
Tweak quiche.BUILD deps clause to allow QUICHE dependency on Envoy bu…
mpwarres b27d83a
Remove QUICHE dependency on Envoy build target until Bazel fix is rel…
mpwarres 713eb9f
Add comments that QUICHE platform files should not be used directly b…
mpwarres bc88212
Merge branch 'master' into import_quiche
mpwarres File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Transformations to QUICHE tarball: | ||
| # - Move subtree under quiche/ base dir, for clarity in #include statements. | ||
| # - Rewrite include directives for platform/impl files. | ||
| # | ||
| # The mechanics of this are likely to change as QUICHE evolves, supplies its own | ||
| # Bazel buildfiles, and perhaps provides a more graceful way to override | ||
| # platform impl directory location. However, the end result (QUICHE files placed | ||
| # under quiche/{http2,quic,spdy}/, with the Envoy-specific implementation of the | ||
| # QUICHE platform APIs in //source/extensions/quic_listeners/quiche/platform/, | ||
| # should remain the same. | ||
|
|
||
| src_files = glob(["**/*.h", "**/*.c", "**/*.cc", "**/*.inc", "**/*.proto"]) | ||
|
|
||
| genrule( | ||
| name = "quiche_files", | ||
| srcs = src_files, | ||
| outs = ["quiche/" + f for f in src_files], | ||
| cmd = "\n".join( | ||
| ["sed -e '/^#include/ s!net/\(http2\|quic\|spdy\)/platform/impl/!extensions/quic_listeners/quiche/platform/!' $(location %s) > $(location :%s)" % (f, "quiche/" + f) for f in src_files], | ||
| ), | ||
| visibility = ["//visibility:private"], | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "http2_platform", | ||
| hdrs = [ | ||
| "quiche/http2/platform/api/http2_arraysize.h", | ||
| "quiche/http2/platform/api/http2_bug_tracker.h", | ||
| "quiche/http2/platform/api/http2_containers.h", | ||
| "quiche/http2/platform/api/http2_estimate_memory_usage.h", | ||
| "quiche/http2/platform/api/http2_export.h", | ||
| "quiche/http2/platform/api/http2_flags.h", | ||
| "quiche/http2/platform/api/http2_flag_utils.h", | ||
| "quiche/http2/platform/api/http2_macros.h", | ||
| "quiche/http2/platform/api/http2_mock_log.h", | ||
| "quiche/http2/platform/api/http2_optional.h", | ||
| "quiche/http2/platform/api/http2_ptr_util.h", | ||
| "quiche/http2/platform/api/http2_reconstruct_object.h", | ||
| "quiche/http2/platform/api/http2_string.h", | ||
| "quiche/http2/platform/api/http2_string_piece.h", | ||
| "quiche/http2/platform/api/http2_string_utils.h", | ||
| "quiche/http2/platform/api/http2_test_helpers.h", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| "@envoy//source/extensions/quic_listeners/quiche/platform:http2_platform_impl_lib", | ||
| ], | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| load( | ||
| "//bazel:envoy_build_system.bzl", | ||
| "envoy_cc_library", | ||
| "envoy_package", | ||
| ) | ||
|
|
||
| envoy_package() | ||
|
|
||
| envoy_cc_library( | ||
| name = "dummy_lib", | ||
|
mpwarres marked this conversation as resolved.
|
||
| srcs = ["dummy.cc"], | ||
| hdrs = ["dummy.h"], | ||
| external_deps = ["quiche_http2_platform"], | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #include "extensions/quic_listeners/quiche/dummy.h" | ||
|
|
||
| using http2::Http2String; | ||
|
|
||
| namespace Envoy { | ||
| namespace Extensions { | ||
| namespace QuicListeners { | ||
| namespace Quiche { | ||
|
|
||
| Http2String moreCowbell(const Http2String& s) { | ||
| return s + " cowbell"; | ||
| } | ||
|
|
||
| } // namespace Quiche | ||
| } // namespace QuicListeners | ||
| } // namespace Extensions | ||
| } // namespace Envoy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #pragma once | ||
|
|
||
| #include "quiche/http2/platform/api/http2_string.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace Extensions { | ||
| namespace QuicListeners { | ||
| namespace Quiche { | ||
|
|
||
| http2::Http2String moreCowbell(const http2::Http2String& s); | ||
|
|
||
| } // namespace Quiche | ||
| } // namespace QuicListeners | ||
| } // namespace Extensions | ||
| } // namespace Envoy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| load( | ||
| "//bazel:envoy_build_system.bzl", | ||
| "envoy_cc_library", | ||
| "envoy_package", | ||
| ) | ||
|
|
||
| envoy_package() | ||
|
|
||
| envoy_cc_library( | ||
| name = "http2_platform_impl_lib", | ||
| hdrs = [ | ||
| "http2_arraysize_impl.h", | ||
|
mpwarres marked this conversation as resolved.
|
||
| "http2_bug_tracker_impl.h", | ||
| "http2_containers_impl.h", | ||
| "http2_estimate_memory_usage_impl.h", | ||
| "http2_export_impl.h", | ||
| "http2_flag_utils_impl.h", | ||
| "http2_flags_impl.h", | ||
| "http2_macros_impl.h", | ||
| "http2_mock_log_impl.h", | ||
| "http2_optional_impl.h", | ||
| "http2_ptr_util_impl.h", | ||
| "http2_reconstruct_object_impl.h", | ||
| "http2_string_impl.h", | ||
| "http2_string_piece_impl.h", | ||
| "http2_string_utils_impl.h", | ||
| "http2_test_helpers_impl.h", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
3 changes: 3 additions & 0 deletions
3
source/extensions/quic_listeners/quiche/platform/http2_arraysize_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #pragma once | ||
|
|
||
| #define HTTP2_ARRAYSIZE_IMPL(x) 0 |
5 changes: 5 additions & 0 deletions
5
source/extensions/quic_listeners/quiche/platform/http2_bug_tracker_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #pragma once | ||
|
|
||
| #define HTTP2_BUG_IMPL 0 | ||
| #define HTTP2_BUG_IF_IMPL 0 | ||
| #define FLAGS_http2_always_log_bugs_for_tests_IMPL 0 |
8 changes: 8 additions & 0 deletions
8
source/extensions/quic_listeners/quiche/platform/http2_containers_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #pragma once | ||
|
|
||
| namespace http2 { | ||
|
|
||
| template <typename T> | ||
| class Http2DequeImpl {}; | ||
|
|
||
| } // namespace http2 |
10 changes: 10 additions & 0 deletions
10
source/extensions/quic_listeners/quiche/platform/http2_estimate_memory_usage_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #pragma once | ||
|
|
||
| namespace http2 { | ||
|
|
||
| template <class T> | ||
| size_t Http2EstimateMemoryUsageImpl(const T& object) { | ||
| return 0; | ||
| } | ||
|
|
||
| } // namespace http2 |
4 changes: 4 additions & 0 deletions
4
source/extensions/quic_listeners/quiche/platform/http2_export_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #pragma once | ||
|
|
||
| #define HTTP2_EXPORT | ||
| #define HTTP2_EXPORT_PRIVATE |
3 changes: 3 additions & 0 deletions
3
source/extensions/quic_listeners/quiche/platform/http2_flag_utils_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #pragma once | ||
|
|
||
| #define HTTP2_RELOADABLE_FLAG_COUNT_IMPL(flag) 0 |
4 changes: 4 additions & 0 deletions
4
source/extensions/quic_listeners/quiche/platform/http2_flags_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #pragma once | ||
|
|
||
| #define GetHttp2ReloadableFlagImpl(flag) 0 | ||
| #define SetHttp2ReloadableFlagImpl(flag, value) 0 |
5 changes: 5 additions & 0 deletions
5
source/extensions/quic_listeners/quiche/platform/http2_macros_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #pragma once | ||
|
|
||
| #define HTTP2_FALLTHROUGH_IMPL 0 | ||
| #define HTTP2_UNREACHABLE_IMPL() 0 | ||
| #define HTTP2_DIE_IF_NULL_IMPL(ptr) 0 |
5 changes: 5 additions & 0 deletions
5
source/extensions/quic_listeners/quiche/platform/http2_mock_log_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #pragma once | ||
|
|
||
| #define CREATE_HTTP2_MOCK_LOG_IMPL(log) 0 | ||
| #define EXPECT_HTTP2_LOG_CALL_IMPL(log) 0 | ||
| #define EXPECT_HTTP2_LOG_CALL_CONTAINS_IMPL(log, level, content) 0 |
8 changes: 8 additions & 0 deletions
8
source/extensions/quic_listeners/quiche/platform/http2_optional_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #pragma once | ||
|
|
||
| namespace http2 { | ||
|
|
||
| template <typename T> | ||
| class Http2OptionalImpl {}; | ||
|
|
||
| } // namespace http2 |
10 changes: 10 additions & 0 deletions
10
source/extensions/quic_listeners/quiche/platform/http2_ptr_util_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #pragma once | ||
|
|
||
| namespace http2 { | ||
|
|
||
| template <typename T, typename... Args> | ||
| std::unique_ptr<T> Http2MakeUniqueImpl(Args&&... args) { | ||
| return nullptr; | ||
| } | ||
|
|
||
| } // namespace http2 |
25 changes: 25 additions & 0 deletions
25
source/extensions/quic_listeners/quiche/platform/http2_reconstruct_object_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #pragma once | ||
|
|
||
| namespace http2 { | ||
|
mpwarres marked this conversation as resolved.
|
||
| namespace test { | ||
|
|
||
| void MarkMemoryUninitialized(void* ptr, size_t num_bytes) {} | ||
| void MarkMemoryUninitialized(void* ptr, size_t num_bytes, Http2Random* rng) {} | ||
|
|
||
| template <class T> | ||
| void MarkObjectUninitialized(T* ptr) {} | ||
| template <class T> | ||
| void MarkObjectUninitialized(T* ptr, Http2Random* rng) {} | ||
|
|
||
| template <class T, size_t N> | ||
| void MarkArrayUninitialized(T (&array)[N]) {} | ||
| template <class T, size_t N> | ||
| void MarkArrayUninitialized(T (&array)[N], Http2Random* rng) {} | ||
|
|
||
| template <class T, class... Args> | ||
| void Http2ReconstructObjectImpl(T* ptr, Http2Random* rng, Args&&... args) {} | ||
| template <class T> | ||
| void Http2DefaultReconstructObjectImpl(T* ptr, Http2Random* rng) {} | ||
|
|
||
| } // namespace test | ||
| } // namespace http2 | ||
9 changes: 9 additions & 0 deletions
9
source/extensions/quic_listeners/quiche/platform/http2_string_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| namespace http2 { | ||
|
|
||
| using Http2StringImpl = std::string; | ||
|
|
||
| } // namespace http2 |
7 changes: 7 additions & 0 deletions
7
source/extensions/quic_listeners/quiche/platform/http2_string_piece_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #pragma once | ||
|
|
||
| namespace http2 { | ||
|
|
||
| class Http2StringPieceImpl {}; | ||
|
|
||
| } // namespace http2 |
39 changes: 39 additions & 0 deletions
39
source/extensions/quic_listeners/quiche/platform/http2_string_utils_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #pragma once | ||
|
|
||
| namespace http2 { | ||
|
|
||
| template <typename... Args> | ||
| inline Http2String Http2StrCatImpl(const Args&... args) { | ||
| return Http2String(); | ||
| } | ||
|
|
||
| template <typename... Args> | ||
| inline void Http2StrAppendImpl(Http2String* output, const Args&... args) {} | ||
|
|
||
| template <typename... Args> | ||
| inline Http2String Http2StringPrintfImpl(const Args&... args) { | ||
| return Http2String(); | ||
| } | ||
|
|
||
| inline Http2String Http2HexEncodeImpl(const void* bytes, size_t size) { | ||
| return Http2String(); | ||
| } | ||
|
|
||
| inline Http2String Http2HexDecodeImpl(Http2StringPiece data) { | ||
| return Http2String(); | ||
| } | ||
|
|
||
| inline Http2String Http2HexDumpImpl(Http2StringPiece data) { | ||
| return Http2String(); | ||
| } | ||
|
|
||
| inline Http2String Http2HexEscapeImpl(Http2StringPiece data) { | ||
| return Http2String(); | ||
| } | ||
|
|
||
| template <typename Number> | ||
| inline Http2String Http2HexImpl(Number number) { | ||
| return Http2String(); | ||
| } | ||
|
|
||
| } // namespace http2 |
1 change: 1 addition & 0 deletions
1
source/extensions/quic_listeners/quiche/platform/http2_test_helpers_impl.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| #pragma once |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| load( | ||
| "//bazel:envoy_build_system.bzl", | ||
| "envoy_cc_fuzz_test", | ||
| "envoy_cc_test", | ||
| "envoy_cc_test_binary", | ||
| "envoy_cc_test_library", | ||
| "envoy_package", | ||
| "envoy_proto_library", | ||
| ) | ||
|
|
||
| envoy_package() | ||
|
|
||
| envoy_cc_test( | ||
| name = "dummy_test", | ||
| srcs = ["dummy_test.cc"], | ||
| external_deps = ["quiche_http2_platform"], | ||
| deps = [ | ||
| "//source/extensions/quic_listeners/quiche:dummy_lib", | ||
| "//test/test_common:utility_lib", | ||
| ], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #include "extensions/quic_listeners/quiche/dummy.h" | ||
|
|
||
| #include "gtest/gtest.h" | ||
| #include "quiche/http2/platform/api/http2_string.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace Extensions { | ||
| namespace QuicListeners { | ||
| namespace Quiche { | ||
|
|
||
| TEST(DummyTest, Dummy) { | ||
| http2::Http2String foo = "bar"; | ||
| EXPECT_EQ("bar cowbell", moreCowbell(foo)); | ||
| } | ||
|
|
||
| } // namespace Quiche | ||
| } // namespace QuicListeners | ||
| } // namespace Extensions | ||
| } // namespace Envoy |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.