Skip to content

Commit

Permalink
cleanup: Remove unused method ServerConnectionImpl::sendProtocolError…
Browse files Browse the repository at this point in the history
…Old. Uses were removed by #14684 (#14728)

Signed-off-by: Antonio Vicente <avd@google.com>
  • Loading branch information
antoniovicente authored Jan 26, 2021
1 parent 0bc3fc9 commit b74d0eb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
18 changes: 0 additions & 18 deletions source/common/http/http1/codec_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1077,24 +1077,6 @@ void ServerConnectionImpl::onResetStream(StreamResetReason reason) {
active_request_.reset();
}

void ServerConnectionImpl::sendProtocolErrorOld(absl::string_view details) {
if (active_request_.has_value()) {
active_request_.value().response_encoder_.setDetails(details);
}
// We do this here because we may get a protocol error before we have a logical stream. Higher
// layers can only operate on streams, so there is no coherent way to allow them to send an error
// "out of band." On one hand this is kind of a hack but on the other hand it normalizes HTTP/1.1
// to look more like HTTP/2 to higher layers.
if (!active_request_.has_value() ||
!active_request_.value().response_encoder_.startedResponse()) {
Buffer::OwnedImpl bad_request_response(
absl::StrCat("HTTP/1.1 ", error_code_, " ", CodeUtility::toString(error_code_),
"\r\ncontent-length: 0\r\nconnection: close\r\n\r\n"));

connection_.write(bad_request_response, false);
}
}

Status ServerConnectionImpl::sendProtocolError(absl::string_view details) {
// We do this here because we may get a protocol error before we have a logical stream.
if (!active_request_.has_value()) {
Expand Down
2 changes: 0 additions & 2 deletions source/common/http/http1/codec_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,6 @@ class ServerConnectionImpl : public ServerConnection, public ConnectionImpl {
}
}

void sendProtocolErrorOld(absl::string_view details);

void releaseOutboundResponse(const Buffer::OwnedBufferFragmentImpl* fragment);
void maybeAddSentinelBufferFragment(Buffer::Instance& output_buffer) override;
Status doFloodProtectionChecks() const;
Expand Down

0 comments on commit b74d0eb

Please sign in to comment.