#include "quiche/quic/tools/quic_simple_server_stream.h"
#include <algorithm>
#include <cstdint>
#include <list>
#include <optional>
#include <string>
#include <utility>
#include "absl/strings/numbers.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/http/quic_spdy_stream.h"
#include "quiche/quic/core/http/spdy_utils.h"
#include "quiche/quic/core/http/web_transport_http3.h"
#include "quiche/quic/core/quic_error_codes.h"
#include "quiche/quic/core/quic_utils.h"
#include "quiche/quic/platform/api/quic_bug_tracker.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_logging.h"
#include "quiche/quic/tools/quic_simple_server_session.h"
#include "quiche/spdy/core/spdy_protocol.h"
HttpHeaderBlock;
namespace quic {
QuicSimpleServerStream::QuicSimpleServerStream(
QuicStreamId id, QuicSpdySession* session, StreamType type,
QuicSimpleServerBackend* quic_simple_server_backend)
: … { … }
QuicSimpleServerStream::QuicSimpleServerStream(
PendingStream* pending, QuicSpdySession* session,
QuicSimpleServerBackend* quic_simple_server_backend)
: … { … }
QuicSimpleServerStream::~QuicSimpleServerStream() { … }
void QuicSimpleServerStream::OnInitialHeadersComplete(
bool fin, size_t frame_len, const QuicHeaderList& header_list) { … }
void QuicSimpleServerStream::OnBodyAvailable() { … }
void QuicSimpleServerStream::HandleRequestConnectData(bool fin_received) { … }
void QuicSimpleServerStream::SendResponse() { … }
QuicConnectionId QuicSimpleServerStream::connection_id() const { … }
QuicStreamId QuicSimpleServerStream::stream_id() const { … }
std::string QuicSimpleServerStream::peer_host() const { … }
QuicSpdyStream* QuicSimpleServerStream::GetStream() { … }
namespace {
class DelayedResponseAlarm : public QuicAlarm::DelegateWithContext { … };
}
void QuicSimpleServerStream::OnResponseBackendComplete(
const QuicBackendResponse* response) { … }
void QuicSimpleServerStream::Respond(const QuicBackendResponse* response) { … }
void QuicSimpleServerStream::SendStreamData(absl::string_view data,
bool close_stream) { … }
void QuicSimpleServerStream::TerminateStreamWithError(
QuicResetStreamError error) { … }
void QuicSimpleServerStream::OnCanWrite() { … }
void QuicSimpleServerStream::WriteGeneratedBytes() { … }
void QuicSimpleServerStream::SendNotFoundResponse() { … }
void QuicSimpleServerStream::SendErrorResponse() { … }
void QuicSimpleServerStream::SendErrorResponse(int resp_code) { … }
void QuicSimpleServerStream::SendIncompleteResponse(
std::optional<HttpHeaderBlock> response_headers, absl::string_view body) { … }
void QuicSimpleServerStream::SendHeadersAndBody(
HttpHeaderBlock response_headers, absl::string_view body) { … }
void QuicSimpleServerStream::SendHeadersAndBodyAndTrailers(
std::optional<HttpHeaderBlock> response_headers, absl::string_view body,
HttpHeaderBlock response_trailers) { … }
bool QuicSimpleServerStream::IsConnectRequest() const { … }
void QuicSimpleServerStream::OnInvalidHeaders() { … }
const char* const QuicSimpleServerStream::kErrorResponseBody = …;
const char* const QuicSimpleServerStream::kNotFoundResponseBody = …;
}