mirror of
https://github.com/php-win-ext/grpc.git
synced 2026-03-24 00:52:08 +01:00
Rename HttpConnectHandshaker to HttpConnectClientHandshaker in preparation for adding a HttpConnectServerHandshaker.
PiperOrigin-RevId: 852382782
This commit is contained in:
committed by
Copybara-Service
parent
dabda5fea8
commit
d3afb84946
10
BUILD
10
BUILD
@@ -646,7 +646,7 @@ grpc_cc_library(
|
||||
"grpc_http_filters",
|
||||
"grpc_security_base",
|
||||
"grpc_trace",
|
||||
"http_connect_handshaker",
|
||||
"http_connect_client_handshaker",
|
||||
"iomgr_timer",
|
||||
"server",
|
||||
"transport_auth_context",
|
||||
@@ -743,7 +743,7 @@ grpc_cc_library(
|
||||
"grpc_public_hdrs",
|
||||
"grpc_security_base",
|
||||
"grpc_trace",
|
||||
"http_connect_handshaker",
|
||||
"http_connect_client_handshaker",
|
||||
"httpcli",
|
||||
"iomgr_timer",
|
||||
"promise",
|
||||
@@ -3496,9 +3496,9 @@ grpc_cc_library(
|
||||
)
|
||||
|
||||
grpc_cc_library(
|
||||
name = "http_connect_handshaker",
|
||||
name = "http_connect_client_handshaker",
|
||||
srcs = [
|
||||
"//src/core:handshaker/http_connect/http_connect_handshaker.cc",
|
||||
"//src/core:handshaker/http_connect/http_connect_client_handshaker.cc",
|
||||
],
|
||||
external_deps = [
|
||||
"absl/base:core_headers",
|
||||
@@ -3507,7 +3507,7 @@ grpc_cc_library(
|
||||
"absl/strings",
|
||||
],
|
||||
public_hdrs = [
|
||||
"//src/core:handshaker/http_connect/http_connect_handshaker.h",
|
||||
"//src/core:handshaker/http_connect/http_connect_client_handshaker.h",
|
||||
],
|
||||
visibility = ["//bazel:alt_grpc_base_legacy"],
|
||||
deps = [
|
||||
|
||||
4
CMakeLists.txt
generated
4
CMakeLists.txt
generated
@@ -2727,7 +2727,7 @@ add_library(grpc
|
||||
src/core/handshaker/endpoint_info/endpoint_info_handshaker.cc
|
||||
src/core/handshaker/handshaker.cc
|
||||
src/core/handshaker/handshaker_registry.cc
|
||||
src/core/handshaker/http_connect/http_connect_handshaker.cc
|
||||
src/core/handshaker/http_connect/http_connect_client_handshaker.cc
|
||||
src/core/handshaker/http_connect/http_proxy_mapper.cc
|
||||
src/core/handshaker/http_connect/xds_http_proxy_mapper.cc
|
||||
src/core/handshaker/proxy_mapper_registry.cc
|
||||
@@ -3550,7 +3550,7 @@ add_library(grpc_unsecure
|
||||
src/core/handshaker/endpoint_info/endpoint_info_handshaker.cc
|
||||
src/core/handshaker/handshaker.cc
|
||||
src/core/handshaker/handshaker_registry.cc
|
||||
src/core/handshaker/http_connect/http_connect_handshaker.cc
|
||||
src/core/handshaker/http_connect/http_connect_client_handshaker.cc
|
||||
src/core/handshaker/http_connect/http_proxy_mapper.cc
|
||||
src/core/handshaker/proxy_mapper_registry.cc
|
||||
src/core/handshaker/security/legacy_secure_endpoint.cc
|
||||
|
||||
2
Makefile
generated
2
Makefile
generated
@@ -1175,7 +1175,7 @@ LIBGRPC_SRC = \
|
||||
src/core/handshaker/endpoint_info/endpoint_info_handshaker.cc \
|
||||
src/core/handshaker/handshaker.cc \
|
||||
src/core/handshaker/handshaker_registry.cc \
|
||||
src/core/handshaker/http_connect/http_connect_handshaker.cc \
|
||||
src/core/handshaker/http_connect/http_connect_client_handshaker.cc \
|
||||
src/core/handshaker/http_connect/http_proxy_mapper.cc \
|
||||
src/core/handshaker/http_connect/xds_http_proxy_mapper.cc \
|
||||
src/core/handshaker/proxy_mapper_registry.cc \
|
||||
|
||||
4
Package.swift
generated
4
Package.swift
generated
@@ -1328,8 +1328,8 @@ let package = Package(
|
||||
"src/core/handshaker/handshaker_factory.h",
|
||||
"src/core/handshaker/handshaker_registry.cc",
|
||||
"src/core/handshaker/handshaker_registry.h",
|
||||
"src/core/handshaker/http_connect/http_connect_handshaker.cc",
|
||||
"src/core/handshaker/http_connect/http_connect_handshaker.h",
|
||||
"src/core/handshaker/http_connect/http_connect_client_handshaker.cc",
|
||||
"src/core/handshaker/http_connect/http_connect_client_handshaker.h",
|
||||
"src/core/handshaker/http_connect/http_proxy_mapper.cc",
|
||||
"src/core/handshaker/http_connect/http_proxy_mapper.h",
|
||||
"src/core/handshaker/http_connect/xds_http_proxy_mapper.cc",
|
||||
|
||||
8
build_autogenerated.yaml
generated
8
build_autogenerated.yaml
generated
@@ -886,7 +886,7 @@ libs:
|
||||
- src/core/handshaker/handshaker.h
|
||||
- src/core/handshaker/handshaker_factory.h
|
||||
- src/core/handshaker/handshaker_registry.h
|
||||
- src/core/handshaker/http_connect/http_connect_handshaker.h
|
||||
- src/core/handshaker/http_connect/http_connect_client_handshaker.h
|
||||
- src/core/handshaker/http_connect/http_proxy_mapper.h
|
||||
- src/core/handshaker/http_connect/xds_http_proxy_mapper.h
|
||||
- src/core/handshaker/proxy_mapper.h
|
||||
@@ -1852,7 +1852,7 @@ libs:
|
||||
- src/core/handshaker/endpoint_info/endpoint_info_handshaker.cc
|
||||
- src/core/handshaker/handshaker.cc
|
||||
- src/core/handshaker/handshaker_registry.cc
|
||||
- src/core/handshaker/http_connect/http_connect_handshaker.cc
|
||||
- src/core/handshaker/http_connect/http_connect_client_handshaker.cc
|
||||
- src/core/handshaker/http_connect/http_proxy_mapper.cc
|
||||
- src/core/handshaker/http_connect/xds_http_proxy_mapper.cc
|
||||
- src/core/handshaker/proxy_mapper_registry.cc
|
||||
@@ -2604,7 +2604,7 @@ libs:
|
||||
- src/core/handshaker/handshaker.h
|
||||
- src/core/handshaker/handshaker_factory.h
|
||||
- src/core/handshaker/handshaker_registry.h
|
||||
- src/core/handshaker/http_connect/http_connect_handshaker.h
|
||||
- src/core/handshaker/http_connect/http_connect_client_handshaker.h
|
||||
- src/core/handshaker/http_connect/http_proxy_mapper.h
|
||||
- src/core/handshaker/proxy_mapper.h
|
||||
- src/core/handshaker/proxy_mapper_registry.h
|
||||
@@ -3130,7 +3130,7 @@ libs:
|
||||
- src/core/handshaker/endpoint_info/endpoint_info_handshaker.cc
|
||||
- src/core/handshaker/handshaker.cc
|
||||
- src/core/handshaker/handshaker_registry.cc
|
||||
- src/core/handshaker/http_connect/http_connect_handshaker.cc
|
||||
- src/core/handshaker/http_connect/http_connect_client_handshaker.cc
|
||||
- src/core/handshaker/http_connect/http_proxy_mapper.cc
|
||||
- src/core/handshaker/proxy_mapper_registry.cc
|
||||
- src/core/handshaker/security/legacy_secure_endpoint.cc
|
||||
|
||||
2
config.m4
generated
2
config.m4
generated
@@ -549,7 +549,7 @@ if test "$PHP_GRPC" != "no"; then
|
||||
src/core/handshaker/endpoint_info/endpoint_info_handshaker.cc \
|
||||
src/core/handshaker/handshaker.cc \
|
||||
src/core/handshaker/handshaker_registry.cc \
|
||||
src/core/handshaker/http_connect/http_connect_handshaker.cc \
|
||||
src/core/handshaker/http_connect/http_connect_client_handshaker.cc \
|
||||
src/core/handshaker/http_connect/http_proxy_mapper.cc \
|
||||
src/core/handshaker/http_connect/xds_http_proxy_mapper.cc \
|
||||
src/core/handshaker/proxy_mapper_registry.cc \
|
||||
|
||||
2
config.w32
generated
2
config.w32
generated
@@ -514,7 +514,7 @@ if (PHP_GRPC != "no") {
|
||||
"src\\core\\handshaker\\endpoint_info\\endpoint_info_handshaker.cc " +
|
||||
"src\\core\\handshaker\\handshaker.cc " +
|
||||
"src\\core\\handshaker\\handshaker_registry.cc " +
|
||||
"src\\core\\handshaker\\http_connect\\http_connect_handshaker.cc " +
|
||||
"src\\core\\handshaker\\http_connect\\http_connect_client_handshaker.cc " +
|
||||
"src\\core\\handshaker\\http_connect\\http_proxy_mapper.cc " +
|
||||
"src\\core\\handshaker\\http_connect\\xds_http_proxy_mapper.cc " +
|
||||
"src\\core\\handshaker\\proxy_mapper_registry.cc " +
|
||||
|
||||
4
gRPC-C++.podspec
generated
4
gRPC-C++.podspec
generated
@@ -977,7 +977,7 @@ Pod::Spec.new do |s|
|
||||
'src/core/handshaker/handshaker.h',
|
||||
'src/core/handshaker/handshaker_factory.h',
|
||||
'src/core/handshaker/handshaker_registry.h',
|
||||
'src/core/handshaker/http_connect/http_connect_handshaker.h',
|
||||
'src/core/handshaker/http_connect/http_connect_client_handshaker.h',
|
||||
'src/core/handshaker/http_connect/http_proxy_mapper.h',
|
||||
'src/core/handshaker/http_connect/xds_http_proxy_mapper.h',
|
||||
'src/core/handshaker/proxy_mapper.h',
|
||||
@@ -2371,7 +2371,7 @@ Pod::Spec.new do |s|
|
||||
'src/core/handshaker/handshaker.h',
|
||||
'src/core/handshaker/handshaker_factory.h',
|
||||
'src/core/handshaker/handshaker_registry.h',
|
||||
'src/core/handshaker/http_connect/http_connect_handshaker.h',
|
||||
'src/core/handshaker/http_connect/http_connect_client_handshaker.h',
|
||||
'src/core/handshaker/http_connect/http_proxy_mapper.h',
|
||||
'src/core/handshaker/http_connect/xds_http_proxy_mapper.h',
|
||||
'src/core/handshaker/proxy_mapper.h',
|
||||
|
||||
6
gRPC-Core.podspec
generated
6
gRPC-Core.podspec
generated
@@ -1451,8 +1451,8 @@ Pod::Spec.new do |s|
|
||||
'src/core/handshaker/handshaker_factory.h',
|
||||
'src/core/handshaker/handshaker_registry.cc',
|
||||
'src/core/handshaker/handshaker_registry.h',
|
||||
'src/core/handshaker/http_connect/http_connect_handshaker.cc',
|
||||
'src/core/handshaker/http_connect/http_connect_handshaker.h',
|
||||
'src/core/handshaker/http_connect/http_connect_client_handshaker.cc',
|
||||
'src/core/handshaker/http_connect/http_connect_client_handshaker.h',
|
||||
'src/core/handshaker/http_connect/http_proxy_mapper.cc',
|
||||
'src/core/handshaker/http_connect/http_proxy_mapper.h',
|
||||
'src/core/handshaker/http_connect/xds_http_proxy_mapper.cc',
|
||||
@@ -3288,7 +3288,7 @@ Pod::Spec.new do |s|
|
||||
'src/core/handshaker/handshaker.h',
|
||||
'src/core/handshaker/handshaker_factory.h',
|
||||
'src/core/handshaker/handshaker_registry.h',
|
||||
'src/core/handshaker/http_connect/http_connect_handshaker.h',
|
||||
'src/core/handshaker/http_connect/http_connect_client_handshaker.h',
|
||||
'src/core/handshaker/http_connect/http_proxy_mapper.h',
|
||||
'src/core/handshaker/http_connect/xds_http_proxy_mapper.h',
|
||||
'src/core/handshaker/proxy_mapper.h',
|
||||
|
||||
4
grpc.gemspec
generated
4
grpc.gemspec
generated
@@ -1334,8 +1334,8 @@ Gem::Specification.new do |s|
|
||||
s.files += %w( src/core/handshaker/handshaker_factory.h )
|
||||
s.files += %w( src/core/handshaker/handshaker_registry.cc )
|
||||
s.files += %w( src/core/handshaker/handshaker_registry.h )
|
||||
s.files += %w( src/core/handshaker/http_connect/http_connect_handshaker.cc )
|
||||
s.files += %w( src/core/handshaker/http_connect/http_connect_handshaker.h )
|
||||
s.files += %w( src/core/handshaker/http_connect/http_connect_client_handshaker.cc )
|
||||
s.files += %w( src/core/handshaker/http_connect/http_connect_client_handshaker.h )
|
||||
s.files += %w( src/core/handshaker/http_connect/http_proxy_mapper.cc )
|
||||
s.files += %w( src/core/handshaker/http_connect/http_proxy_mapper.h )
|
||||
s.files += %w( src/core/handshaker/http_connect/xds_http_proxy_mapper.cc )
|
||||
|
||||
4
package.xml
generated
4
package.xml
generated
@@ -1316,8 +1316,8 @@
|
||||
<file baseinstalldir="/" name="src/core/handshaker/handshaker_factory.h" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/handshaker/handshaker_registry.cc" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/handshaker/handshaker_registry.h" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/handshaker/http_connect/http_connect_handshaker.cc" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/handshaker/http_connect/http_connect_handshaker.h" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/handshaker/http_connect/http_connect_client_handshaker.cc" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/handshaker/http_connect/http_connect_client_handshaker.h" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/handshaker/http_connect/http_proxy_mapper.cc" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/handshaker/http_connect/http_proxy_mapper.h" role="src" />
|
||||
<file baseinstalldir="/" name="src/core/handshaker/http_connect/xds_http_proxy_mapper.cc" role="src" />
|
||||
|
||||
@@ -4287,7 +4287,7 @@ grpc_cc_library(
|
||||
"//:channel_arg_names",
|
||||
"//:config",
|
||||
"//:gpr",
|
||||
"//:http_connect_handshaker",
|
||||
"//:http_connect_client_handshaker",
|
||||
"//:iomgr",
|
||||
"//:parse_address",
|
||||
"//:sockaddr_utils",
|
||||
@@ -4313,7 +4313,7 @@ grpc_cc_library(
|
||||
"resolved_address",
|
||||
"xds_endpoint",
|
||||
"//:config",
|
||||
"//:http_connect_handshaker",
|
||||
"//:http_connect_client_handshaker",
|
||||
"//:parse_address",
|
||||
"//:sockaddr_utils",
|
||||
],
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
//
|
||||
//
|
||||
|
||||
#include "src/core/handshaker/http_connect/http_connect_handshaker.h"
|
||||
#include "src/core/handshaker/http_connect/http_connect_client_handshaker.h"
|
||||
|
||||
#include <grpc/slice.h>
|
||||
#include <grpc/slice_buffer.h>
|
||||
@@ -58,17 +58,17 @@ namespace grpc_core {
|
||||
|
||||
namespace {
|
||||
|
||||
class HttpConnectHandshaker : public Handshaker {
|
||||
class HttpConnectClientHandshaker : public Handshaker {
|
||||
public:
|
||||
HttpConnectHandshaker();
|
||||
absl::string_view name() const override { return "http_connect"; }
|
||||
HttpConnectClientHandshaker();
|
||||
absl::string_view name() const override { return "http_connect_client"; }
|
||||
void DoHandshake(
|
||||
HandshakerArgs* args,
|
||||
absl::AnyInvocable<void(absl::Status)> on_handshake_done) override;
|
||||
void Shutdown(absl::Status error) override;
|
||||
|
||||
private:
|
||||
~HttpConnectHandshaker() override;
|
||||
~HttpConnectClientHandshaker() override;
|
||||
void HandshakeFailedLocked(absl::Status error)
|
||||
ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
|
||||
void FinishLocked(absl::Status error) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
|
||||
@@ -93,14 +93,14 @@ class HttpConnectHandshaker : public Handshaker {
|
||||
grpc_http_response http_response_ ABSL_GUARDED_BY(mu_);
|
||||
};
|
||||
|
||||
HttpConnectHandshaker::~HttpConnectHandshaker() {
|
||||
HttpConnectClientHandshaker::~HttpConnectClientHandshaker() {
|
||||
grpc_http_parser_destroy(&http_parser_);
|
||||
grpc_http_response_destroy(&http_response_);
|
||||
}
|
||||
|
||||
// If the handshake failed or we're shutting down, clean up and invoke the
|
||||
// callback with the error.
|
||||
void HttpConnectHandshaker::HandshakeFailedLocked(absl::Status error) {
|
||||
void HttpConnectClientHandshaker::HandshakeFailedLocked(absl::Status error) {
|
||||
if (error.ok()) {
|
||||
// If we were shut down after an endpoint operation succeeded but
|
||||
// before the endpoint callback was invoked, we need to generate our
|
||||
@@ -117,7 +117,7 @@ void HttpConnectHandshaker::HandshakeFailedLocked(absl::Status error) {
|
||||
FinishLocked(std::move(error));
|
||||
}
|
||||
|
||||
void HttpConnectHandshaker::FinishLocked(absl::Status error) {
|
||||
void HttpConnectClientHandshaker::FinishLocked(absl::Status error) {
|
||||
InvokeOnHandshakeDone(args_, std::move(on_handshake_done_), std::move(error));
|
||||
}
|
||||
|
||||
@@ -125,9 +125,9 @@ void HttpConnectHandshaker::FinishLocked(absl::Status error) {
|
||||
// avoid deadlocks, schedule OnWriteDone on ExecCtx.
|
||||
// TODO(roth): This hop will no longer be needed when we migrate to the
|
||||
// EventEngine endpoint API.
|
||||
void HttpConnectHandshaker::OnWriteDoneScheduler(void* arg,
|
||||
grpc_error_handle error) {
|
||||
auto* handshaker = static_cast<HttpConnectHandshaker*>(arg);
|
||||
void HttpConnectClientHandshaker::OnWriteDoneScheduler(
|
||||
void* arg, grpc_error_handle error) {
|
||||
auto* handshaker = static_cast<HttpConnectClientHandshaker*>(arg);
|
||||
handshaker->args_->event_engine->Run(
|
||||
[handshaker, error = std::move(error)]() mutable {
|
||||
ExecCtx exec_ctx;
|
||||
@@ -136,7 +136,7 @@ void HttpConnectHandshaker::OnWriteDoneScheduler(void* arg,
|
||||
}
|
||||
|
||||
// Callback invoked when finished writing HTTP CONNECT request.
|
||||
void HttpConnectHandshaker::OnWriteDone(absl::Status error) {
|
||||
void HttpConnectClientHandshaker::OnWriteDone(absl::Status error) {
|
||||
ReleasableMutexLock lock(&mu_);
|
||||
if (!error.ok() || args_->endpoint == nullptr) {
|
||||
// If the write failed or we're shutting down, clean up and invoke the
|
||||
@@ -150,8 +150,8 @@ void HttpConnectHandshaker::OnWriteDone(absl::Status error) {
|
||||
grpc_endpoint_read(
|
||||
args_->endpoint.get(), args_->read_buffer.c_slice_buffer(),
|
||||
GRPC_CLOSURE_INIT(&on_read_done_scheduler_,
|
||||
&HttpConnectHandshaker::OnReadDoneScheduler, this,
|
||||
grpc_schedule_on_exec_ctx),
|
||||
&HttpConnectClientHandshaker::OnReadDoneScheduler,
|
||||
this, grpc_schedule_on_exec_ctx),
|
||||
/*urgent=*/true, /*min_progress_size=*/1);
|
||||
}
|
||||
}
|
||||
@@ -160,9 +160,9 @@ void HttpConnectHandshaker::OnWriteDone(absl::Status error) {
|
||||
// avoid deadlocks, schedule OnReadDone on ExecCtx.
|
||||
// TODO(roth): This hop will no longer be needed when we migrate to the
|
||||
// EventEngine endpoint API.
|
||||
void HttpConnectHandshaker::OnReadDoneScheduler(void* arg,
|
||||
grpc_error_handle error) {
|
||||
auto* handshaker = static_cast<HttpConnectHandshaker*>(arg);
|
||||
void HttpConnectClientHandshaker::OnReadDoneScheduler(void* arg,
|
||||
grpc_error_handle error) {
|
||||
auto* handshaker = static_cast<HttpConnectClientHandshaker*>(arg);
|
||||
handshaker->args_->event_engine->Run(
|
||||
[handshaker, error = std::move(error)]() mutable {
|
||||
ExecCtx exec_ctx;
|
||||
@@ -171,7 +171,7 @@ void HttpConnectHandshaker::OnReadDoneScheduler(void* arg,
|
||||
}
|
||||
|
||||
// Callback invoked for reading HTTP CONNECT response.
|
||||
void HttpConnectHandshaker::OnReadDone(absl::Status error) {
|
||||
void HttpConnectClientHandshaker::OnReadDone(absl::Status error) {
|
||||
bool done;
|
||||
{
|
||||
MutexLock lock(&mu_);
|
||||
@@ -180,7 +180,7 @@ void HttpConnectHandshaker::OnReadDone(absl::Status error) {
|
||||
if (done) Unref();
|
||||
}
|
||||
|
||||
bool HttpConnectHandshaker::OnReadDoneLocked(absl::Status error) {
|
||||
bool HttpConnectClientHandshaker::OnReadDoneLocked(absl::Status error) {
|
||||
if (!error.ok() || args_->endpoint == nullptr) {
|
||||
// If the read failed or we're shutting down, clean up and invoke the
|
||||
// callback with the error.
|
||||
@@ -227,8 +227,8 @@ bool HttpConnectHandshaker::OnReadDoneLocked(absl::Status error) {
|
||||
grpc_endpoint_read(
|
||||
args_->endpoint.get(), args_->read_buffer.c_slice_buffer(),
|
||||
GRPC_CLOSURE_INIT(&on_read_done_scheduler_,
|
||||
&HttpConnectHandshaker::OnReadDoneScheduler, this,
|
||||
grpc_schedule_on_exec_ctx),
|
||||
&HttpConnectClientHandshaker::OnReadDoneScheduler,
|
||||
this, grpc_schedule_on_exec_ctx),
|
||||
/*urgent=*/true, /*min_progress_size=*/1);
|
||||
return false;
|
||||
}
|
||||
@@ -248,12 +248,12 @@ bool HttpConnectHandshaker::OnReadDoneLocked(absl::Status error) {
|
||||
// Public handshaker methods
|
||||
//
|
||||
|
||||
void HttpConnectHandshaker::Shutdown(absl::Status /*error*/) {
|
||||
void HttpConnectClientHandshaker::Shutdown(absl::Status /*error*/) {
|
||||
MutexLock lock(&mu_);
|
||||
if (on_handshake_done_ != nullptr) args_->endpoint.reset();
|
||||
}
|
||||
|
||||
void HttpConnectHandshaker::DoHandshake(
|
||||
void HttpConnectClientHandshaker::DoHandshake(
|
||||
HandshakerArgs* args,
|
||||
absl::AnyInvocable<void(absl::Status)> on_handshake_done) {
|
||||
// Check for HTTP CONNECT channel arg.
|
||||
@@ -323,12 +323,12 @@ void HttpConnectHandshaker::DoHandshake(
|
||||
grpc_endpoint_write(
|
||||
args->endpoint.get(), write_buffer_.c_slice_buffer(),
|
||||
GRPC_CLOSURE_INIT(&on_write_done_scheduler_,
|
||||
&HttpConnectHandshaker::OnWriteDoneScheduler, this,
|
||||
grpc_schedule_on_exec_ctx),
|
||||
&HttpConnectClientHandshaker::OnWriteDoneScheduler,
|
||||
this, grpc_schedule_on_exec_ctx),
|
||||
std::move(write_args));
|
||||
}
|
||||
|
||||
HttpConnectHandshaker::HttpConnectHandshaker() {
|
||||
HttpConnectClientHandshaker::HttpConnectClientHandshaker() {
|
||||
grpc_http_parser_init(&http_parser_, GRPC_HTTP_RESPONSE, &http_response_);
|
||||
}
|
||||
|
||||
@@ -336,24 +336,25 @@ HttpConnectHandshaker::HttpConnectHandshaker() {
|
||||
// handshaker factory
|
||||
//
|
||||
|
||||
class HttpConnectHandshakerFactory : public HandshakerFactory {
|
||||
class HttpConnectClientHandshakerFactory : public HandshakerFactory {
|
||||
public:
|
||||
void AddHandshakers(const ChannelArgs& /*args*/,
|
||||
grpc_pollset_set* /*interested_parties*/,
|
||||
HandshakeManager* handshake_mgr) override {
|
||||
handshake_mgr->Add(MakeRefCounted<HttpConnectHandshaker>());
|
||||
handshake_mgr->Add(MakeRefCounted<HttpConnectClientHandshaker>());
|
||||
}
|
||||
HandshakerPriority Priority() override {
|
||||
return HandshakerPriority::kHTTPConnectHandshakers;
|
||||
}
|
||||
~HttpConnectHandshakerFactory() override = default;
|
||||
~HttpConnectClientHandshakerFactory() override = default;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
void RegisterHttpConnectHandshaker(CoreConfiguration::Builder* builder) {
|
||||
void RegisterHttpConnectClientHandshaker(CoreConfiguration::Builder* builder) {
|
||||
builder->handshaker_registry()->RegisterHandshakerFactory(
|
||||
HANDSHAKER_CLIENT, std::make_unique<HttpConnectHandshakerFactory>());
|
||||
HANDSHAKER_CLIENT,
|
||||
std::make_unique<HttpConnectClientHandshakerFactory>());
|
||||
}
|
||||
|
||||
} // namespace grpc_core
|
||||
@@ -16,8 +16,8 @@
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef GRPC_SRC_CORE_HANDSHAKER_HTTP_CONNECT_HTTP_CONNECT_HANDSHAKER_H
|
||||
#define GRPC_SRC_CORE_HANDSHAKER_HTTP_CONNECT_HTTP_CONNECT_HANDSHAKER_H
|
||||
#ifndef GRPC_SRC_CORE_HANDSHAKER_HTTP_CONNECT_HTTP_CONNECT_CLIENT_HANDSHAKER_H
|
||||
#define GRPC_SRC_CORE_HANDSHAKER_HTTP_CONNECT_HTTP_CONNECT_CLIENT_HANDSHAKER_H
|
||||
|
||||
#include <grpc/support/port_platform.h>
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
namespace grpc_core {
|
||||
|
||||
// Register the HTTP Connect handshaker into the configuration builder.
|
||||
void RegisterHttpConnectHandshaker(CoreConfiguration::Builder* builder);
|
||||
void RegisterHttpConnectClientHandshaker(CoreConfiguration::Builder* builder);
|
||||
|
||||
} // namespace grpc_core
|
||||
|
||||
#endif // GRPC_SRC_CORE_HANDSHAKER_HTTP_CONNECT_HTTP_CONNECT_HANDSHAKER_H
|
||||
#endif // GRPC_SRC_CORE_HANDSHAKER_HTTP_CONNECT_HTTP_CONNECT_CLIENT_HANDSHAKER_H
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "src/core/handshaker/http_connect/http_connect_handshaker.h"
|
||||
#include "src/core/handshaker/http_connect/http_connect_client_handshaker.h"
|
||||
#include "src/core/lib/address_utils/parse_address.h"
|
||||
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
||||
#include "src/core/lib/channel/channel_args.h"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "src/core/handshaker/http_connect/http_connect_handshaker.h"
|
||||
#include "src/core/handshaker/http_connect/http_connect_client_handshaker.h"
|
||||
#include "src/core/lib/address_utils/parse_address.h"
|
||||
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
||||
#include "src/core/lib/channel/channel_args.h"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "src/core/config/core_configuration.h"
|
||||
#include "src/core/handshaker/endpoint_info/endpoint_info_handshaker.h"
|
||||
#include "src/core/handshaker/http_connect/http_connect_handshaker.h"
|
||||
#include "src/core/handshaker/http_connect/http_connect_client_handshaker.h"
|
||||
#include "src/core/handshaker/tcp_connect/tcp_connect_handshaker.h"
|
||||
#include "src/core/lib/surface/channel_stack_type.h"
|
||||
#include "src/core/lib/surface/lame_client.h"
|
||||
@@ -98,7 +98,7 @@ void BuildCoreConfiguration(CoreConfiguration::Builder* builder) {
|
||||
// We want TCP connect handshaker to be registered last so that it is added
|
||||
// to the start of the handshaker list.
|
||||
RegisterEndpointInfoHandshaker(builder);
|
||||
RegisterHttpConnectHandshaker(builder);
|
||||
RegisterHttpConnectClientHandshaker(builder);
|
||||
RegisterTCPConnectHandshaker(builder);
|
||||
RegisterChttp2Transport(builder);
|
||||
#ifndef GRPC_MINIMAL_LB_POLICY
|
||||
|
||||
2
src/python/grpcio/grpc_core_dependencies.py
generated
2
src/python/grpcio/grpc_core_dependencies.py
generated
@@ -524,7 +524,7 @@ CORE_SOURCE_FILES = [
|
||||
'src/core/handshaker/endpoint_info/endpoint_info_handshaker.cc',
|
||||
'src/core/handshaker/handshaker.cc',
|
||||
'src/core/handshaker/handshaker_registry.cc',
|
||||
'src/core/handshaker/http_connect/http_connect_handshaker.cc',
|
||||
'src/core/handshaker/http_connect/http_connect_client_handshaker.cc',
|
||||
'src/core/handshaker/http_connect/http_proxy_mapper.cc',
|
||||
'src/core/handshaker/http_connect/xds_http_proxy_mapper.cc',
|
||||
'src/core/handshaker/proxy_mapper_registry.cc',
|
||||
|
||||
@@ -171,7 +171,7 @@ grpc_cc_test(
|
||||
"//:channel_arg_names",
|
||||
"//:gpr",
|
||||
"//:grpc",
|
||||
"//:http_connect_handshaker",
|
||||
"//:http_connect_client_handshaker",
|
||||
"//:parse_address",
|
||||
"//:sockaddr_utils",
|
||||
"//src/core:channel_args",
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "src/core/handshaker/http_connect/http_connect_handshaker.h"
|
||||
#include "src/core/handshaker/http_connect/http_connect_client_handshaker.h"
|
||||
#include "src/core/lib/address_utils/parse_address.h"
|
||||
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
||||
#include "src/core/lib/channel/channel_args.h"
|
||||
|
||||
4
tools/doxygen/Doxyfile.c++.internal
generated
4
tools/doxygen/Doxyfile.c++.internal
generated
@@ -2301,8 +2301,8 @@ src/core/handshaker/handshaker.h \
|
||||
src/core/handshaker/handshaker_factory.h \
|
||||
src/core/handshaker/handshaker_registry.cc \
|
||||
src/core/handshaker/handshaker_registry.h \
|
||||
src/core/handshaker/http_connect/http_connect_handshaker.cc \
|
||||
src/core/handshaker/http_connect/http_connect_handshaker.h \
|
||||
src/core/handshaker/http_connect/http_connect_client_handshaker.cc \
|
||||
src/core/handshaker/http_connect/http_connect_client_handshaker.h \
|
||||
src/core/handshaker/http_connect/http_proxy_mapper.cc \
|
||||
src/core/handshaker/http_connect/http_proxy_mapper.h \
|
||||
src/core/handshaker/http_connect/xds_http_proxy_mapper.cc \
|
||||
|
||||
4
tools/doxygen/Doxyfile.core.internal
generated
4
tools/doxygen/Doxyfile.core.internal
generated
@@ -2135,8 +2135,8 @@ src/core/handshaker/handshaker_factory.h \
|
||||
src/core/handshaker/handshaker_registry.cc \
|
||||
src/core/handshaker/handshaker_registry.h \
|
||||
src/core/handshaker/http_connect/GEMINI.md \
|
||||
src/core/handshaker/http_connect/http_connect_handshaker.cc \
|
||||
src/core/handshaker/http_connect/http_connect_handshaker.h \
|
||||
src/core/handshaker/http_connect/http_connect_client_handshaker.cc \
|
||||
src/core/handshaker/http_connect/http_connect_client_handshaker.h \
|
||||
src/core/handshaker/http_connect/http_proxy_mapper.cc \
|
||||
src/core/handshaker/http_connect/http_proxy_mapper.h \
|
||||
src/core/handshaker/http_connect/xds_http_proxy_mapper.cc \
|
||||
|
||||
Reference in New Issue
Block a user