Skip to content

Commit

Permalink
Add comment and fix nit
Browse files Browse the repository at this point in the history
Signed-off-by: ZhouyihaiDing <ddyihai@google.com>
  • Loading branch information
ZhouyihaiDing committed Aug 26, 2019
1 parent dd768d1 commit 107ae87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions source/common/router/router.cc
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ Filter::streamResetReasonToResponseFlag(Http::StreamResetReason reset_reason) {
NOT_REACHED_GCOVR_EXCL_LINE;
}

void Filter::handleNon5xxResponseHeaders(const absl::optional<Grpc::Status::GrpcStatus> grpc_status,
void Filter::handleNon5xxResponseHeaders(absl::optional<Grpc::Status::GrpcStatus> grpc_status,
UpstreamRequest& upstream_request, bool end_stream,
uint64_t grpc_to_http_status) {
// We need to defer gRPC success until after we have processed grpc-status in
Expand Down Expand Up @@ -1001,7 +1001,9 @@ void Filter::onUpstreamHeaders(uint64_t response_code, Http::HeaderMapPtr&& head
ENVOY_STREAM_LOG(debug, "upstream headers complete: end_stream={}", *callbacks_, end_stream);

modify_headers_(*headers);

// When grpc-status appears in response headers, convert grpc-status to HTTP status code
// for outlier detection. This does not currently change any stats or logging and does not
// handle the case when an error grpc-status is sent as a trailer.
absl::optional<Grpc::Status::GrpcStatus> grpc_status;
uint64_t grpc_to_http_status = 0;
if (grpc_request_) {
Expand Down
2 changes: 1 addition & 1 deletion source/common/router/router.h
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ class Filter : Logger::Loggable<Logger::Id::router>,
void doRetry();
// Called immediately after a non-5xx header is received from upstream, performs stats accounting
// and handle difference between gRPC and non-gRPC requests.
void handleNon5xxResponseHeaders(const absl::optional<Grpc::Status::GrpcStatus> grpc_status,
void handleNon5xxResponseHeaders(absl::optional<Grpc::Status::GrpcStatus> grpc_status,
UpstreamRequest& upstream_request, bool end_stream,
uint64_t grpc_to_http_status);
TimeSource& timeSource() { return config_.timeSource(); }
Expand Down

0 comments on commit 107ae87

Please sign in to comment.