#include "quiche/quic/tools/connect_server_backend.h"
#include <memory>
#include <string>
#include <utility>
#include "absl/container/flat_hash_set.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/quic_server_id.h"
#include "quiche/quic/core/socket_factory.h"
#include "quiche/quic/tools/connect_tunnel.h"
#include "quiche/quic/tools/connect_udp_tunnel.h"
#include "quiche/quic/tools/quic_simple_server_backend.h"
#include "quiche/common/http/http_header_block.h"
#include "quiche/common/platform/api/quiche_bug_tracker.h"
#include "quiche/common/platform/api/quiche_logging.h"
namespace quic {
namespace {
void SendErrorResponse(QuicSimpleServerBackend::RequestHandler* request_handler,
absl::string_view error_code) { … }
}
ConnectServerBackend::ConnectServerBackend(
std::unique_ptr<QuicSimpleServerBackend> non_connect_backend,
absl::flat_hash_set<QuicServerId> acceptable_connect_destinations,
absl::flat_hash_set<QuicServerId> acceptable_connect_udp_targets,
std::string server_label)
: … { … }
ConnectServerBackend::~ConnectServerBackend() { … }
bool ConnectServerBackend::InitializeBackend(const std::string&) { … }
bool ConnectServerBackend::IsBackendInitialized() const { … }
void ConnectServerBackend::SetSocketFactory(SocketFactory* socket_factory) { … }
void ConnectServerBackend::FetchResponseFromBackend(
const quiche::HttpHeaderBlock& request_headers,
const std::string& request_body, RequestHandler* request_handler) { … }
void ConnectServerBackend::HandleConnectHeaders(
const quiche::HttpHeaderBlock& request_headers,
RequestHandler* request_handler) { … }
void ConnectServerBackend::HandleConnectData(absl::string_view data,
bool data_complete,
RequestHandler* request_handler) { … }
void ConnectServerBackend::CloseBackendResponseStream(
QuicSimpleServerBackend::RequestHandler* request_handler) { … }
}