Skip to content
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

update envoy f95f5391 #1140

Merged
merged 12 commits into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from 8 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
2 changes: 1 addition & 1 deletion envoy
Submodule envoy updated 1223 files
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ const envoy_filter_headers_status_t kEnvoyFilterHeadersStatusContinue =
static_cast<envoy_filter_headers_status_t>(Envoy::Http::FilterHeadersStatus::Continue);
const envoy_filter_headers_status_t kEnvoyFilterHeadersStatusStopIteration =
static_cast<envoy_filter_headers_status_t>(Envoy::Http::FilterHeadersStatus::StopIteration);
const envoy_filter_headers_status_t kEnvoyFilterHeadersStatusContinueAndEndStream =
Copy link
Member Author

Choose a reason for hiding this comment

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

static_cast<envoy_filter_headers_status_t>(
Envoy::Http::FilterHeadersStatus::ContinueAndEndStream);
const envoy_filter_headers_status_t kEnvoyFilterHeadersStatusStopAllIterationAndBuffer =
static_cast<envoy_filter_headers_status_t>(
Envoy::Http::FilterHeadersStatus::StopAllIterationAndBuffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ extern const envoy_headers envoy_unaltered_headers;
typedef int envoy_filter_headers_status_t;
extern const envoy_filter_headers_status_t kEnvoyFilterHeadersStatusContinue;
extern const envoy_filter_headers_status_t kEnvoyFilterHeadersStatusStopIteration;
extern const envoy_filter_headers_status_t kEnvoyFilterHeadersStatusContinueAndEndStream;
extern const envoy_filter_headers_status_t kEnvoyFilterHeadersStatusStopAllIterationAndBuffer;
// Note this return status is unique to platform filters and used only to resume iteration after
// it has been previously stopped.
Expand Down
13 changes: 7 additions & 6 deletions library/common/http/dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void Dispatcher::DirectStreamCallbacks::encodeHeaders(const ResponseHeaderMap& h

// Error path: missing EnvoyUpstreamServiceTime implies this is a local reply, which we treat as
// a stream error.
if (!success_ && headers.get(Headers::get().EnvoyUpstreamServiceTime) == nullptr) {
if (!success_ && headers.get(Headers::get().EnvoyUpstreamServiceTime).empty()) {
ENVOY_LOG(debug, "[S{}] intercepted local response", direct_stream_.stream_handle_);
mapLocalResponseToError(headers);
if (end_stream) {
Expand Down Expand Up @@ -427,13 +427,14 @@ void Dispatcher::setDestinationCluster(HeaderMap& headers) {
// TODO(junr03): once http3 is available this would probably benefit from some sort of struct that
// maps to appropriate cluster names. However, with only two options (http1/2) this suffices.
bool use_h2_cluster{};
const HeaderEntry* entry = headers.get(H2UpstreamHeader);
if (entry) {
if (entry->value() == "http2") {
auto get_result = headers.get(H2UpstreamHeader);
if (!get_result.empty()) {
ASSERT(get_result.size() == 1);
const auto value = get_result[0]->value().getStringView();
if (value == "http2") {
use_h2_cluster = true;
} else {
ASSERT(entry->value() == "http1",
fmt::format("using unsupported protocol version {}", entry->value().getStringView()));
ASSERT(value == "http1", fmt::format("using unsupported protocol version {}", value));
}
headers.remove(H2UpstreamHeader);
}
Expand Down
1 change: 0 additions & 1 deletion library/objective-c/EnvoyEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ typedef NSDictionary<NSString *, NSArray<NSString *> *> EnvoyHeaders;
/// Return codes for on-headers filter invocations. @see envoy/http/filter.h
extern const int kEnvoyFilterHeadersStatusContinue;
extern const int kEnvoyFilterHeadersStatusStopIteration;
extern const int kEnvoyFilterHeadersStatusContinueAndEndStream;
extern const int kEnvoyFilterHeadersStatusStopAllIterationAndBuffer;

/// Return codes for on-data filter invocations. @see envoy/http/filter.h
Expand Down
2 changes: 1 addition & 1 deletion tools/check_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
# TODO(mattklein123): WORKSPACE is excluded due to warning about @bazel_tools reference. Fix here
# or in the upstream checker.
ENVOY_BAZEL_PREFIX=@envoy envoy/tools/code_format/check_format.py \
--add-excluded-prefixes ./envoy/ ./envoy_build_config/extensions_build_config.bzl ./WORKSPACE ./dist/Envoy.framework/ ./library/common/config_template.cc \
--add-excluded-prefixes ./envoy/ ./envoy_build_config/extensions_build_config.bzl ./WORKSPACE ./dist/Envoy.framework/ ./library/common/config_template.cc ./bazel/envoy_mobile_swift_bazel_support.bzl ./bazel/envoy_mobile_repositories.bzl \
--skip_envoy_build_rule_check "$ENVOY_FORMAT_ACTION" \
--namespace_check_excluded_paths ./examples/ ./library/java/ ./library/kotlin ./library/objective-c \
--build_fixer_check_excluded_paths ./BUILD ./dist ./examples ./library/java ./library/kotlin ./library/objective-c ./library/swift ./library/common/extensions