Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 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
3 changes: 3 additions & 0 deletions bazel/envoy_internal.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def envoy_copts(repository, test = False):
# Allow 'nodiscard' function return values to be discarded
# TODO(wrowe,sunjayBhatia): Drop this option when all causes are fixed
"-wd4834",
"-Wv:19.4",

@wrowe wrowe Nov 13, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this back down to the new line 68 just below, e.g. ["-experimental:preprocessor", "-Wv:19.4"],

]

return select({
Expand All @@ -63,6 +64,8 @@ def envoy_copts(repository, test = False):
}) + select({
repository + "//bazel:clang_build": ["-fno-limit-debug-info", "-Wgnu-conditional-omitted-operand", "-Wc++2a-extensions", "-Wrange-loop-analysis"],
repository + "//bazel:gcc_build": ["-Wno-maybe-uninitialized"],
# TODO: Replace with /Zc:preprocessor for cl.exe versions >= 16.5
repository + "//bazel:windows_x86_64": ["-experimental:preprocessor"],
"//conditions:default": [],
}) + select({
repository + "//bazel:no_debug_info": ["-g0"],
Expand Down
85 changes: 52 additions & 33 deletions bazel/external/quiche.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,12 @@ quiche_common_copts = [
"-Wno-unused-function",
# quic_inlined_frame.h uses offsetof() to optimize memory usage in frames.
"-Wno-invalid-offsetof",
"-Wno-range-loop-analysis",
]

quiche_copts = select({
# Ignore unguarded #pragma GCC statements in QUICHE sources
"@envoy//bazel:windows_x86_64": ["-wd4068"],
# Remove these after upstream fix.
"@envoy//bazel:gcc_build": [
"-Wno-sign-compare",
] + quiche_common_copts,
Comment thread
danzh2010 marked this conversation as resolved.
"//conditions:default": quiche_common_copts,
})

Expand Down Expand Up @@ -737,7 +733,6 @@ envoy_cc_library(
hdrs = [
"quiche/spdy/platform/api/spdy_bug_tracker.h",
"quiche/spdy/platform/api/spdy_containers.h",
"quiche/spdy/platform/api/spdy_endianness_util.h",
"quiche/spdy/platform/api/spdy_estimate_memory_usage.h",
"quiche/spdy/platform/api/spdy_flags.h",
"quiche/spdy/platform/api/spdy_logging.h",
Expand Down Expand Up @@ -935,6 +930,7 @@ envoy_cc_library(
copts = quiche_copts,
repository = "@envoy",
deps = [
":http2_hpack_huffman_hpack_huffman_encoder_lib",
":spdy_core_protocol_lib",
":spdy_platform",
],
Expand Down Expand Up @@ -1049,19 +1045,16 @@ envoy_cc_library(
envoy_cc_library(
name = "quic_platform_base",
hdrs = [
"quiche/quic/platform/api/quic_aligned.h",
"quiche/quic/platform/api/quic_bug_tracker.h",
"quiche/quic/platform/api/quic_client_stats.h",
"quiche/quic/platform/api/quic_containers.h",
"quiche/quic/platform/api/quic_error_code_wrappers.h",
"quiche/quic/platform/api/quic_estimate_memory_usage.h",
"quiche/quic/platform/api/quic_exported_stats.h",
"quiche/quic/platform/api/quic_fallthrough.h",
"quiche/quic/platform/api/quic_flag_utils.h",
"quiche/quic/platform/api/quic_flags.h",
"quiche/quic/platform/api/quic_iovec.h",
"quiche/quic/platform/api/quic_logging.h",
"quiche/quic/platform/api/quic_macros.h",
"quiche/quic/platform/api/quic_map_util.h",
"quiche/quic/platform/api/quic_mem_slice.h",
"quiche/quic/platform/api/quic_prefetch.h",
Expand All @@ -1072,6 +1065,7 @@ envoy_cc_library(
"quiche/quic/platform/api/quic_stream_buffer_allocator.h",
"quiche/quic/platform/api/quic_string_utils.h",
"quiche/quic/platform/api/quic_uint128.h",
"quiche/quic/platform/api/quic_testvalue.h",
# TODO: uncomment the following files as implementations are added.
# "quiche/quic/platform/api/quic_fuzzed_data_provider.h",
# "quiche/quic/platform/api/quic_test_loopback.h",
Expand Down Expand Up @@ -1147,7 +1141,6 @@ envoy_cc_test_library(
hdrs = ["quiche/quic/platform/api/quic_port_utils.h"],
repository = "@envoy",
tags = ["nofips"],
deps = ["@envoy//test/extensions/quic_listeners/quiche/platform:quic_platform_port_utils_impl_lib"],
)

envoy_cc_library(
Expand Down Expand Up @@ -1216,15 +1209,14 @@ envoy_cc_test_library(
)

envoy_cc_library(
name = "quiche_common_platform_endian",
hdrs = ["quiche/common/platform/api/quiche_endian.h"],
name = "quiche_common_endian_lib",
hdrs = ["quiche/common/quiche_endian.h"],
repository = "@envoy",
tags = ["nofips"],
visibility = ["//visibility:public"],
deps =
[
":quiche_common_platform_export",
"@envoy//source/extensions/quic_listeners/quiche/platform:quiche_common_platform_endian_impl_lib",
],
)

Expand Down Expand Up @@ -1932,6 +1924,7 @@ envoy_cc_library(
visibility = ["//visibility:public"],
deps = [
":quic_core_clock_lib",
":quic_core_crypto_certificate_view_lib",
":quic_core_crypto_encryption_lib",
":quic_core_crypto_hkdf_lib",
":quic_core_crypto_proof_source_interface_lib",
Expand Down Expand Up @@ -2167,6 +2160,15 @@ envoy_cc_library(
],
)

envoy_cc_library(
name = "quic_core_flags_list_lib",
hdrs = ["quiche/quic/core/quic_flags_list.h"],
copts = quiche_copts,
repository = "@envoy",
tags = ["nofips"],
visibility = ["//visibility:public"],
)

envoy_cc_library(
name = "quic_core_framer_lib",
srcs = ["quiche/quic/core/quic_framer.cc"],
Expand Down Expand Up @@ -2339,6 +2341,7 @@ envoy_cc_library(
repository = "@envoy",
tags = ["nofips"],
deps = [
":http2_constants_lib",
":quic_core_data_lib",
":quic_core_error_codes_lib",
":quic_core_http_http_frames_lib",
Expand Down Expand Up @@ -2723,6 +2726,27 @@ envoy_cc_library(
],
)

envoy_cc_library(
name = "quic_core_path_validator_lib",
srcs = ["quiche/quic/core/quic_path_validator.cc"],
hdrs = ["quiche/quic/core/quic_path_validator.h"],
copts = quiche_copts,
repository = "@envoy",
tags = ["nofips"],
deps = [
":quic_core_alarm_factory_interface_lib",
":quic_core_alarm_interface_lib",
":quic_core_arena_scoped_ptr_lib",
":quic_core_clock_lib",
":quic_core_constants_lib",
":quic_core_crypto_random_lib",
":quic_core_one_block_arena_lib",
":quic_core_packet_writer_interface_lib",
":quic_core_types_lib",
":quic_platform",
],
)

envoy_cc_library(
name = "quic_core_process_packet_interface_lib",
hdrs = ["quiche/quic/core/quic_process_packet_interface.h"],
Expand All @@ -2735,6 +2759,15 @@ envoy_cc_library(
],
)

envoy_cc_library(
name = "quic_core_protocol_flags_list_lib",
hdrs = ["quiche/quic/core/quic_protocol_flags_list.h"],
copts = quiche_copts,
repository = "@envoy",
tags = ["nofips"],
visibility = ["//visibility:public"],
)

envoy_cc_library(
name = "quic_core_qpack_blocking_manager_lib",
srcs = ["quiche/quic/core/qpack/qpack_blocking_manager.cc"],
Expand Down Expand Up @@ -2896,6 +2929,7 @@ envoy_cc_library(
deps = [
":http2_decoder_decode_buffer_lib",
":http2_decoder_decode_status_lib",
":quic_core_error_codes_lib",
":quic_core_qpack_qpack_instruction_decoder_lib",
":quic_core_qpack_qpack_instructions_lib",
":quic_core_qpack_qpack_stream_receiver_lib",
Expand Down Expand Up @@ -3368,7 +3402,7 @@ envoy_cc_library(
":quic_core_error_codes_lib",
":quic_core_time_lib",
":quic_platform_base",
":quiche_common_platform_endian",
":quiche_common_endian_lib",
],
)

Expand Down Expand Up @@ -3420,6 +3454,7 @@ envoy_cc_library(
repository = "@envoy",
tags = ["nofips"],
deps = [
":quic_core_circular_deque_lib",
":quic_core_connection_stats_lib",
":quic_core_packets_lib",
":quic_core_session_notifier_interface_lib",
Expand Down Expand Up @@ -3459,6 +3494,7 @@ envoy_cc_library(
deps = [
":quic_core_versions_lib",
":quic_platform_base",
":quiche_common_endian_lib",
],
)

Expand All @@ -3475,7 +3511,6 @@ envoy_cc_library(
":quic_core_tag_lib",
":quic_core_types_lib",
":quic_platform_base",
":quiche_common_platform_endian",
],
)

Expand Down Expand Up @@ -3746,6 +3781,7 @@ envoy_cc_test_library(
":quic_core_packet_creator_lib",
":quic_core_packet_writer_interface_lib",
":quic_core_packets_lib",
":quic_core_path_validator_lib",
":quic_core_received_packet_manager_lib",
":quic_core_sent_packet_manager_lib",
":quic_core_server_id_lib",
Expand Down Expand Up @@ -3836,25 +3872,10 @@ envoy_cc_test_library(
deps = [":epoll_server_platform"],
)

envoy_cc_library(
name = "quiche_common_platform_optional",
hdrs = ["quiche/common/platform/api/quiche_optional.h"],
repository = "@envoy",
tags = ["nofips"],
visibility = ["//visibility:public"],
deps = [
":quiche_common_platform_export",
"@envoy//source/extensions/quic_listeners/quiche/platform:quiche_common_platform_optional_impl_lib",
],
)

envoy_cc_library(
name = "quiche_common_platform",
hdrs = [
"quiche/common/platform/api/quiche_arraysize.h",
"quiche/common/platform/api/quiche_logging.h",
"quiche/common/platform/api/quiche_optional.h",
"quiche/common/platform/api/quiche_ptr_util.h",
"quiche/common/platform/api/quiche_str_cat.h",
"quiche/common/platform/api/quiche_string_piece.h",
"quiche/common/platform/api/quiche_text_utils.h",
Expand All @@ -3866,15 +3887,13 @@ envoy_cc_library(
visibility = ["//visibility:public"],
deps = [
":quiche_common_platform_export",
":quiche_common_platform_optional",
"@envoy//source/extensions/quic_listeners/quiche/platform:quiche_common_platform_impl_lib",
],
)

envoy_cc_test_library(
name = "quiche_common_platform_test",
srcs = [
"quiche/common/platform/api/quiche_endian_test.cc",
"quiche/common/platform/api/quiche_str_cat_test.cc",
"quiche/common/platform/api/quiche_text_utils_test.cc",
"quiche/common/platform/api/quiche_time_utils_test.cc",
Expand All @@ -3884,7 +3903,6 @@ envoy_cc_test_library(
tags = ["nofips"],
deps = [
":quiche_common_platform",
":quiche_common_platform_endian",
"@envoy//test/extensions/quic_listeners/quiche/platform:quiche_common_platform_test_impl_lib",
],
)
Expand All @@ -3904,8 +3922,8 @@ envoy_cc_library(
tags = ["nofips"],
visibility = ["//visibility:public"],
deps = [
":quiche_common_endian_lib",
":quiche_common_platform",
":quiche_common_platform_endian",
],
)

Expand Down Expand Up @@ -3944,6 +3962,7 @@ envoy_cc_test(
deps = [
":http2_platform",
":http2_test_tools_random",
":quiche_common_test_tools_test_utils_lib",
],
)

Expand Down
8 changes: 4 additions & 4 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -671,13 +671,13 @@ REPOSITORY_LOCATIONS_SPEC = dict(
project_name = "QUICHE",
project_desc = "QUICHE (QUIC, HTTP/2, Etc) is Google‘s implementation of QUIC and related protocols",
project_url = "https://quiche.googlesource.com/quiche",
# Static snapshot of https://quiche.googlesource.com/quiche/+archive/f555d99a084cdd086a349548c70fb558ac5847cf.tar.gz
version = "f555d99a084cdd086a349548c70fb558ac5847cf",
sha256 = "1833f08e7b0f18b49d7498b029b7f3e6559a82113ec82a98a9e945553756e351",
# Static snapshot of https://quiche.googlesource.com/quiche/+archive/ecc28c0d7428f3323ea26eb1ddb98a5e06b23dea.tar.gz
version = "ecc28c0d7428f3323ea26eb1ddb98a5e06b23dea",
sha256 = "52680dea984dbe899c27176155578b97276e1f1516b7c3a63fb16ba593061859",
urls = ["https://storage.googleapis.com/quiche-envoy-integration/{version}.tar.gz"],
use_category = ["dataplane_ext"],
extensions = ["envoy.transport_sockets.quic"],
release_date = "2020-09-17",
release_date = "2020-11-10",
cpe = "N/A",
),
com_googlesource_googleurl = dict(
Expand Down
1 change: 1 addition & 0 deletions source/extensions/quic_listeners/quiche/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ envoy_cc_library(
"//source/common/buffer:buffer_lib",
"//source/common/common:assert_lib",
"//source/common/http:header_map_lib",
"//source/common/http:header_utility_lib",
"//source/extensions/quic_listeners/quiche/platform:quic_platform_mem_slice_storage_impl_lib",
"@com_googlesource_quiche//:quic_core_http_client_lib",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ActiveQuicListener::ActiveQuicListener(
quic::QuicRandom* const random = quic::QuicRandom::GetInstance();
random->RandBytes(random_seed_, sizeof(random_seed_));
crypto_config_ = std::make_unique<quic::QuicCryptoServerConfig>(
quiche::QuicheStringPiece(reinterpret_cast<char*>(random_seed_), sizeof(random_seed_)),
absl::string_view(reinterpret_cast<char*>(random_seed_), sizeof(random_seed_)),
quic::QuicRandom::GetInstance(),
std::make_unique<EnvoyQuicProofSource>(listen_socket_, listener_config.filterChainManager(),
stats_),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ EnvoyQuicClientConnection::EnvoyQuicClientConnection(
const quic::ParsedQuicVersionVector& supported_versions, Event::Dispatcher& dispatcher,
Network::ConnectionSocketPtr&& connection_socket)
: EnvoyQuicConnection(
server_connection_id,
server_connection_id, quic::QuicSocketAddress(),
envoyIpAddressToQuicSocketAddress(connection_socket->remoteAddress()->ip()), helper,
alarm_factory, writer, owns_writer, quic::Perspective::IS_CLIENT, supported_versions,
std::move(connection_socket)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "common/buffer/buffer_impl.h"
#include "common/http/header_map_impl.h"
#include "common/http/header_utility.h"
#include "common/common/assert.h"

namespace Envoy {
Expand Down Expand Up @@ -48,6 +49,10 @@ EnvoyQuicClientStream::EnvoyQuicClientStream(quic::PendingStream* pending,

Http::Status EnvoyQuicClientStream::encodeHeaders(const Http::RequestHeaderMap& headers,
bool end_stream) {
// Required headers must be present. This can only happen by some erroneous processing after the
// downstream codecs decode.
RETURN_IF_ERROR(Http::HeaderUtility::checkRequiredHeaders(headers));

ENVOY_STREAM_LOG(debug, "encodeHeaders: (end_stream={}) {}.", *this, end_stream, headers);
quic::QuicStream* writing_stream =
quic::VersionUsesHttp3(transport_version())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ namespace Envoy {
namespace Quic {

EnvoyQuicConnection::EnvoyQuicConnection(const quic::QuicConnectionId& server_connection_id,
quic::QuicSocketAddress initial_self_address,
quic::QuicSocketAddress initial_peer_address,
quic::QuicConnectionHelperInterface& helper,
quic::QuicAlarmFactory& alarm_factory,
quic::QuicPacketWriter* writer, bool owns_writer,
quic::Perspective perspective,
const quic::ParsedQuicVersionVector& supported_versions,
Network::ConnectionSocketPtr&& connection_socket)
: quic::QuicConnection(server_connection_id, initial_peer_address, &helper, &alarm_factory,
writer, owns_writer, perspective, supported_versions),
: quic::QuicConnection(server_connection_id, initial_self_address, initial_peer_address,
&helper, &alarm_factory, writer, owns_writer, perspective,
supported_versions),
connection_socket_(std::move(connection_socket)) {}

EnvoyQuicConnection::~EnvoyQuicConnection() { connection_socket_->close(); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class EnvoyQuicConnection : public quic::QuicConnection,
protected Logger::Loggable<Logger::Id::connection> {
public:
EnvoyQuicConnection(const quic::QuicConnectionId& server_connection_id,
quic::QuicSocketAddress initial_self_address,
quic::QuicSocketAddress initial_peer_address,
quic::QuicConnectionHelperInterface& helper,
quic::QuicAlarmFactory& alarm_factory, quic::QuicPacketWriter* writer,
Expand Down
Loading