Skip to content

Commit

Permalink
Merge branch 'header-only' of github.com:snowp/envoy into header-only
Browse files Browse the repository at this point in the history
Signed-off-by: Snow Pettersen <snowp@squareup.com>
  • Loading branch information
snowp committed Nov 17, 2018
2 parents d0a771b + ec72f47 commit ddce29e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/common/http/conn_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,12 @@ void ConnectionManagerImpl::ActiveStream::decodeHeaders(HeaderMapPtr&& headers,

decodeHeaders(nullptr, *request_headers_, end_stream);

// Normally we end decode at the start of this function, but if the request was turned into
// a header only request we need to set this flag here.
if (encoding_headers_only_) {
maybeEndDecode(true);
}

// Reset it here for both global and overridden cases.
resetIdleTimer();
}
Expand Down Expand Up @@ -1135,6 +1141,8 @@ void ConnectionManagerImpl::ActiveStream::encodeHeaders(ActiveStreamEncoderFilte
(*continue_data_entry)->stopped_ = true;
(*continue_data_entry)->continueEncoding();
} else {
// End encoding if this is a header only response, either due to a filter converting it to one
// or due to the upstream returning headers only.
maybeEndEncode(encoding_headers_only_ || end_stream);
}
}
Expand Down
3 changes: 3 additions & 0 deletions source/common/http/conn_manager_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,10 @@ class ConnectionManagerImpl : Logger::Loggable<Logger::Id::http>,
// is ever called, this is set to true so commonContinue resumes processing the 100-Continue.
bool has_continue_headers_{};
bool is_head_request_{};
// Whether a filter has indicated that the request should be treated as a headers only request.
bool decoding_headers_only_{};
// Whether a filter has indicated that the response should be treated as a headers only
// response.
bool encoding_headers_only_{};
};

Expand Down

0 comments on commit ddce29e

Please sign in to comment.