Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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