chttp2_connector.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
20 
22 
23 #include <stdint.h>
24 
25 #include <string>
26 
27 #include "absl/container/inlined_vector.h"
28 #include "absl/status/status.h"
29 #include "absl/status/statusor.h"
30 
31 #include <grpc/grpc.h>
32 #include <grpc/grpc_posix.h>
33 #include <grpc/grpc_security.h>
35 #include <grpc/status.h>
36 #include <grpc/support/alloc.h>
37 #include <grpc/support/log.h>
38 #include <grpc/support/sync.h>
39 
71 
72 #ifdef GPR_SUPPORT_CHANNELS_FROM_FD
73 
74 #include <fcntl.h>
75 
78 
79 #endif // GPR_SUPPORT_CHANNELS_FROM_FD
80 
81 namespace grpc_core {
82 
83 namespace {
84 void NullThenSchedClosure(const DebugLocation& location, grpc_closure** closure,
87  *closure = nullptr;
88  ExecCtx::Run(location, c, error);
89 }
90 } // namespace
91 
93  if (endpoint_ != nullptr) {
95  }
96 }
97 
99  grpc_closure* notify) {
100  {
101  MutexLock lock(&mu_);
102  GPR_ASSERT(notify_ == nullptr);
103  args_ = args;
104  result_ = result;
105  notify_ = notify;
106  GPR_ASSERT(endpoint_ == nullptr);
107  }
109  if (!address.ok()) {
112  NullThenSchedClosure(DEBUG_LOCATION, &notify_, error);
113  return;
114  }
115  absl::InlinedVector<grpc_arg, 2> args_to_add = {
117  const_cast<char*>(GRPC_ARG_TCP_HANDSHAKER_RESOLVED_ADDRESS),
118  const_cast<char*>(address.value().c_str())),
121  1),
122  };
124  args_.channel_args, args_to_add.data(), args_to_add.size());
125  handshake_mgr_ = MakeRefCounted<HandshakeManager>();
128  handshake_mgr_.get());
129  Ref().release(); // Ref held by OnHandshakeDone().
130  handshake_mgr_->DoHandshake(nullptr /* endpoint */, channel_args,
131  args.deadline, nullptr /* acceptor */,
132  OnHandshakeDone, this);
133  grpc_channel_args_destroy(channel_args);
134 }
135 
137  MutexLock lock(&mu_);
138  shutdown_ = true;
139  if (handshake_mgr_ != nullptr) {
140  // Handshaker will also shutdown the endpoint if it exists
141  handshake_mgr_->Shutdown(GRPC_ERROR_REF(error));
142  }
144 }
145 
147  auto* args = static_cast<HandshakerArgs*>(arg);
148  Chttp2Connector* self = static_cast<Chttp2Connector*>(args->user_data);
149  {
150  MutexLock lock(&self->mu_);
151  if (!GRPC_ERROR_IS_NONE(error) || self->shutdown_) {
152  if (GRPC_ERROR_IS_NONE(error)) {
153  error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("connector shutdown");
154  // We were shut down after handshaking completed successfully, so
155  // destroy the endpoint here.
156  if (args->endpoint != nullptr) {
157  // TODO(ctiller): It is currently necessary to shutdown endpoints
158  // before destroying them, even if we know that there are no
159  // pending read/write callbacks. This should be fixed, at which
160  // point this can be removed.
162  grpc_endpoint_destroy(args->endpoint);
165  gpr_free(args->read_buffer);
166  }
167  } else {
169  }
170  self->result_->Reset();
171  NullThenSchedClosure(DEBUG_LOCATION, &self->notify_, error);
172  } else if (args->endpoint != nullptr) {
173  self->result_->transport =
174  grpc_create_chttp2_transport(args->args, args->endpoint, true);
175  self->result_->socket_node =
176  grpc_chttp2_transport_get_socket_node(self->result_->transport);
177  self->result_->channel_args = args->args;
178  GPR_ASSERT(self->result_->transport != nullptr);
179  self->endpoint_ = args->endpoint;
180  self->Ref().release(); // Ref held by OnReceiveSettings()
181  GRPC_CLOSURE_INIT(&self->on_receive_settings_, OnReceiveSettings, self,
182  grpc_schedule_on_exec_ctx);
183  self->Ref().release(); // Ref held by OnTimeout()
184  grpc_chttp2_transport_start_reading(self->result_->transport,
185  args->read_buffer,
186  &self->on_receive_settings_, nullptr);
187  GRPC_CLOSURE_INIT(&self->on_timeout_, OnTimeout, self,
188  grpc_schedule_on_exec_ctx);
189  grpc_timer_init(&self->timer_, self->args_.deadline, &self->on_timeout_);
190  } else {
191  // If the handshaking succeeded but there is no endpoint, then the
192  // handshaker may have handed off the connection to some external
193  // code. Just verify that exit_early flag is set.
194  GPR_DEBUG_ASSERT(args->exit_early);
195  NullThenSchedClosure(DEBUG_LOCATION, &self->notify_, error);
196  }
197  self->handshake_mgr_.reset();
198  }
199  self->Unref();
200 }
201 
203  Chttp2Connector* self = static_cast<Chttp2Connector*>(arg);
204  {
205  MutexLock lock(&self->mu_);
206  if (!self->notify_error_.has_value()) {
208  self->args_.interested_parties);
209  if (!GRPC_ERROR_IS_NONE(error)) {
210  // Transport got an error while waiting on SETTINGS frame.
211  // TODO(yashykt): The following two lines should be moved to
212  // SubchannelConnector::Result::Reset()
213  grpc_transport_destroy(self->result_->transport);
214  grpc_channel_args_destroy(self->result_->channel_args);
215  self->result_->Reset();
216  }
217  self->MaybeNotify(GRPC_ERROR_REF(error));
218  grpc_timer_cancel(&self->timer_);
219  } else {
220  // OnTimeout() was already invoked. Call Notify() again so that notify_
221  // can be invoked.
222  self->MaybeNotify(GRPC_ERROR_NONE);
223  }
224  }
225  self->Unref();
226 }
227 
229  Chttp2Connector* self = static_cast<Chttp2Connector*>(arg);
230  {
231  MutexLock lock(&self->mu_);
232  if (!self->notify_error_.has_value()) {
233  // The transport did not receive the settings frame in time. Destroy the
234  // transport.
236  self->args_.interested_parties);
237  // TODO(yashykt): The following two lines should be moved to
238  // SubchannelConnector::Result::Reset()
239  grpc_transport_destroy(self->result_->transport);
240  grpc_channel_args_destroy(self->result_->channel_args);
241  self->result_->Reset();
242  self->MaybeNotify(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
243  "connection attempt timed out before receiving SETTINGS frame"));
244  } else {
245  // OnReceiveSettings() was already invoked. Call Notify() again so that
246  // notify_ can be invoked.
247  self->MaybeNotify(GRPC_ERROR_NONE);
248  }
249  }
250  self->Unref();
251 }
252 
254  if (notify_error_.has_value()) {
256  NullThenSchedClosure(DEBUG_LOCATION, &notify_, notify_error_.value());
257  // Clear state for a new Connect().
258  // Clear out the endpoint_, since it is the responsibility of
259  // the transport to shut it down.
260  endpoint_ = nullptr;
261  notify_error_.reset();
262  } else {
264  }
265 }
266 
267 namespace {
268 
269 class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
270  public:
271  RefCountedPtr<Subchannel> CreateSubchannel(
272  const grpc_resolved_address& address,
273  const grpc_channel_args* args) override {
274  grpc_channel_args* new_args = GetSecureNamingChannelArgs(args);
275  if (new_args == nullptr) {
277  "Failed to create channel args during subchannel creation.");
278  return nullptr;
279  }
280  RefCountedPtr<Subchannel> s = Subchannel::Create(
281  MakeOrphanable<Chttp2Connector>(), address, new_args);
282  grpc_channel_args_destroy(new_args);
283  return s;
284  }
285 
286  private:
287  static grpc_channel_args* GetSecureNamingChannelArgs(
288  const grpc_channel_args* args) {
289  grpc_channel_credentials* channel_credentials =
291  if (channel_credentials == nullptr) {
293  "Can't create subchannel: channel credentials missing for secure "
294  "channel. Got args: %s",
296  return nullptr;
297  }
298  // Make sure security connector does not already exist in args.
299  if (grpc_security_connector_find_in_args(args) != nullptr) {
301  "Can't create subchannel: security connector already present in "
302  "channel args.");
303  return nullptr;
304  }
305  // Find the authority to use in the security connector.
306  const char* authority =
308  GPR_ASSERT(authority != nullptr);
309  // Create the security connector using the credentials and target name.
310  grpc_channel_args* new_args_from_connector = nullptr;
311  RefCountedPtr<grpc_channel_security_connector>
312  subchannel_security_connector =
313  channel_credentials->create_security_connector(
314  /*call_creds=*/nullptr, authority, args,
315  &new_args_from_connector);
316  if (subchannel_security_connector == nullptr) {
318  "Failed to create secure subchannel for secure name '%s'",
319  authority);
320  return nullptr;
321  }
322  grpc_arg new_security_connector_arg =
323  grpc_security_connector_to_arg(subchannel_security_connector.get());
325  new_args_from_connector != nullptr ? new_args_from_connector : args,
326  &new_security_connector_arg, 1);
327  subchannel_security_connector.reset(DEBUG_LOCATION, "lb_channel_create");
328  grpc_channel_args_destroy(new_args_from_connector);
329  return new_args;
330  }
331 };
332 
334  ChannelArgs args) {
335  if (target == nullptr) {
336  gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
337  return absl::InvalidArgumentError("channel target is NULL");
338  }
339  // Add channel arg containing the server URI.
340  std::string canonical_target =
342  target);
343  return Channel::Create(target,
344  args.Set(GRPC_ARG_SERVER_URI, canonical_target),
345  GRPC_CLIENT_CHANNEL, nullptr);
346 }
347 
348 } // namespace
349 } // namespace grpc_core
350 
351 namespace {
352 
353 grpc_core::Chttp2SecureClientChannelFactory* g_factory;
354 gpr_once g_factory_once = GPR_ONCE_INIT;
355 
356 void FactoryInit() {
357  g_factory = new grpc_core::Chttp2SecureClientChannelFactory();
358 }
359 
360 } // namespace
361 
362 // Create a secure client channel:
363 // Asynchronously: - resolve target
364 // - connect to it (trying alternatives as presented)
365 // - perform handshakes
368  const grpc_channel_args* c_args) {
370  GRPC_API_TRACE("grpc_secure_channel_create(target=%s, creds=%p, args=%p)", 3,
371  (target, (void*)creds, (void*)c_args));
372  grpc_channel* channel = nullptr;
374  if (creds != nullptr) {
375  // Add channel args containing the client channel factory and channel
376  // credentials.
377  gpr_once_init(&g_factory_once, FactoryInit);
379  creds->update_arguments(grpc_core::CoreConfiguration::Get()
380  .channel_args_preconditioning()
381  .PreconditionChannelArgs(c_args)
382  .SetObject(creds->Ref())
383  .SetObject(g_factory));
384  // Create channel.
386  if (r.ok()) {
387  channel = r->release()->c_ptr();
388  } else {
389  error = absl_status_to_grpc_error(r.status());
390  }
391  }
392  if (channel == nullptr) {
393  intptr_t integer;
396  status = static_cast<grpc_status_code>(integer);
397  }
400  target, status, "Failed to create secure client channel");
401  }
402  return channel;
403 }
404 
405 #ifdef GPR_SUPPORT_CHANNELS_FROM_FD
406 grpc_channel* grpc_channel_create_from_fd(const char* target, int fd,
408  const grpc_channel_args* args) {
411  "grpc_channel_create_from_fd(target=%p, fd=%d, creds=%p, args=%p)", 4,
412  (target, fd, creds, args));
413  // For now, we only support insecure channel credentials.
414  if (creds == nullptr ||
418  "Failed to create client channel due to invalid creds");
419  }
420  const grpc_channel_args* final_args =
424  .SetIfUnset(GRPC_ARG_DEFAULT_AUTHORITY, "test.authority")
425  .SetObject(creds->Ref())
426  .ToC();
427 
428  int flags = fcntl(fd, F_GETFL, 0);
429  GPR_ASSERT(fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
431  grpc_fd_create(fd, "client", true), final_args, "fd-client");
433  grpc_create_chttp2_transport(final_args, client, true);
438  grpc_channel_args_destroy(final_args);
439  if (channel.ok()) {
440  grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
442  return channel->release()->c_ptr();
443  } else {
446  target, static_cast<grpc_status_code>(channel.status().code()),
447  "Failed to create client channel");
448  }
449 }
450 
451 #else // !GPR_SUPPORT_CHANNELS_FROM_FD
452 
453 grpc_channel* grpc_channel_create_from_fd(const char* /* target */,
454  int /* fd */,
455  grpc_channel_credentials* /* creds*/,
456  const grpc_channel_args* /* args */) {
457  GPR_ASSERT(0);
458  return nullptr;
459 }
460 
461 #endif // GPR_SUPPORT_CHANNELS_FROM_FD
GRPC_CLOSURE_INIT
#define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler)
Definition: closure.h:115
grpc_arg
Definition: grpc_types.h:103
trace.h
absl::InvalidArgumentError
Status InvalidArgumentError(absl::string_view message)
Definition: third_party/abseil-cpp/absl/status/status.cc:351
grpc_core::SubchannelConnector::Args
Definition: connector.h:41
grpc_channel_args_find_string
char * grpc_channel_args_find_string(const grpc_channel_args *args, const char *name)
Definition: channel_args.cc:441
grpc_core::Chttp2Connector::OnHandshakeDone
static void OnHandshakeDone(void *arg, grpc_error_handle error)
Definition: chttp2_connector.cc:146
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
connector.h
chttp2_connector.h
orphanable.h
GRPC_ERROR_NONE
#define GRPC_ERROR_NONE
Definition: error.h:234
log.h
core_configuration.h
sockaddr_utils.h
absl::Status::ToString
std::string ToString(StatusToStringMode mode=StatusToStringMode::kDefault) const
Definition: third_party/abseil-cpp/absl/status/status.h:821
GPR_DEBUG_ASSERT
#define GPR_DEBUG_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:103
fix_build_deps.c
list c
Definition: fix_build_deps.py:490
gpr_once
pthread_once_t gpr_once
Definition: impl/codegen/sync_posix.h:50
CreateChannel
static grpc_channel * CreateChannel()
Definition: bm_call_create.cc:98
grpc_create_chttp2_transport
grpc_transport * grpc_create_chttp2_transport(const grpc_channel_args *channel_args, grpc_endpoint *ep, bool is_client)
Definition: chttp2_transport.cc:3122
grpc_channel_credentials::type
virtual grpc_core::UniqueTypeName type() const =0
insecure_credentials.h
subchannel.h
tcp_client_posix.h
grpc_core
Definition: call_metric_recorder.h:31
client
Definition: examples/python/async_streaming/client.py:1
grpc_core::MutexLock
Definition: src/core/lib/gprpp/sync.h:88
GRPC_CLIENT_DIRECT_CHANNEL
@ GRPC_CLIENT_DIRECT_CHANNEL
Definition: channel_stack_type.h:34
grpc_core::Chttp2Connector
Definition: chttp2_connector.h:37
grpc_lame_client_channel_create
GRPCAPI grpc_channel * grpc_lame_client_channel_create(const char *target, grpc_status_code error_code, const char *error_message)
Definition: lame_client.cc:131
gpr_free
GPRAPI void gpr_free(void *ptr)
Definition: alloc.cc:51
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
error
grpc_error_handle error
Definition: retry_filter.cc:499
grpc_status_code
grpc_status_code
Definition: include/grpc/impl/codegen/status.h:28
client_channel.h
grpc_core::ChannelArgs::FromC
static ChannelArgs FromC(const grpc_channel_args *args)
Definition: channel_args.cc:84
grpc_resolved_address
Definition: resolved_address.h:34
grpc_endpoint_delete_from_pollset_set
void grpc_endpoint_delete_from_pollset_set(grpc_endpoint *ep, grpc_pollset_set *pollset_set)
Definition: endpoint.cc:44
status
absl::Status status
Definition: rls.cc:251
GPR_ONCE_INIT
#define GPR_ONCE_INIT
Definition: impl/codegen/sync_posix.h:52
grpc_channel_arg_string_create
grpc_arg grpc_channel_arg_string_create(char *name, char *value)
Definition: channel_args.cc:476
grpc_security.h
resolved_address.h
grpc_core::ChannelArgs::SetIfUnset
GRPC_MUST_USE_RESULT ChannelArgs SetIfUnset(absl::string_view name, T value)
Definition: channel_args.h:205
channelz.h
grpc_core::Chttp2Connector::mu_
Mutex mu_
Definition: chttp2_connector.h:60
grpc_core::Chttp2Connector::OnTimeout
static void OnTimeout(void *arg, grpc_error_handle error)
Definition: chttp2_connector.cc:228
credentials.h
grpc_channel_args
Definition: grpc_types.h:132
grpc_tcp_client_create_from_fd
grpc_endpoint * grpc_tcp_client_create_from_fd(grpc_fd *fd, const grpc_channel_args *channel_args, absl::string_view addr_str)
grpc_security_connector_to_arg
grpc_arg grpc_security_connector_to_arg(grpc_security_connector *sc)
Definition: security_connector.cc:101
channel_args_preconditioning.h
status.h
grpc_core::SubchannelConnector::Args::interested_parties
grpc_pollset_set * interested_parties
Definition: connector.h:45
gpr_once_init
GPRAPI void gpr_once_init(gpr_once *once, void(*init_function)(void))
grpc_types.h
DEBUG_LOCATION
#define DEBUG_LOCATION
Definition: debug_location.h:41
grpc_core::InsecureCredentials::Type
static UniqueTypeName Type()
Definition: core/lib/security/credentials/insecure/insecure_credentials.cc:40
grpc_core::ClientChannelFactory
Definition: client_channel_factory.h:32
GRPC_ARG_DEFAULT_AUTHORITY
#define GRPC_ARG_DEFAULT_AUTHORITY
Definition: grpc_types.h:251
grpc_core::ResolverRegistry::AddDefaultPrefixIfNeeded
std::string AddDefaultPrefixIfNeeded(absl::string_view target) const
Returns target with the default prefix prepended, if needed.
Definition: resolver_registry.cc:100
grpc_core::ChannelArgs::SetObject
GRPC_MUST_USE_RESULT ChannelArgs SetObject(T *p) const
Definition: channel_args.h:229
channel
wrapped_grpc_channel * channel
Definition: src/php/ext/grpc/call.h:33
grpc_core::HANDSHAKER_CLIENT
@ HANDSHAKER_CLIENT
Definition: handshaker_registry.h:35
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
grpc_core::SubchannelConnector::Args::channel_args
const grpc_channel_args * channel_args
Definition: connector.h:49
grpc_core::RefCountedPtr
Definition: ref_counted_ptr.h:35
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
grpc_core::CoreConfiguration::Get
static const CoreConfiguration & Get()
Definition: core_configuration.h:82
gen_stats_data.c_str
def c_str(s, encoding='ascii')
Definition: gen_stats_data.py:38
grpc_core::Chttp2Connector::OnReceiveSettings
static void OnReceiveSettings(void *arg, grpc_error_handle error)
Definition: chttp2_connector.cc:202
ev_posix.h
grpc_core::ExecCtx::Flush
bool Flush()
Definition: exec_ctx.cc:69
GRPC_ARG_SERVER_URI
#define GRPC_ARG_SERVER_URI
Definition: client_channel.h:89
grpc_core::InternallyRefCounted< SubchannelConnector >::Ref
RefCountedPtr< SubchannelConnector > Ref() GRPC_MUST_USE_RESULT
Definition: orphanable.h:90
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
transport
grpc_transport transport
Definition: filter_fuzzer.cc:146
grpc_fd_create
grpc_fd * grpc_fd_create(int fd, const char *name, bool track_err)
grpc_transport_destroy
void grpc_transport_destroy(grpc_transport *transport)
Definition: transport.cc:96
closure
grpc_closure closure
Definition: src/core/lib/surface/server.cc:466
grpc.h
grpc_channel_credentials_find_in_args
grpc_channel_credentials * grpc_channel_credentials_find_in_args(const grpc_channel_args *args)
Definition: credentials.cc:83
handshaker_registry.h
security_connector.h
grpc_core::ChannelArgs::ToC
const grpc_channel_args * ToC() const
Definition: channel_args.cc:94
grpc_channel_args_destroy
void grpc_channel_args_destroy(grpc_channel_args *a)
Definition: channel_args.cc:360
arg
Definition: cmdline.cc:40
grpc_error_get_int
bool grpc_error_get_int(grpc_error_handle err, grpc_error_ints which, intptr_t *p)
Definition: error.cc:635
grpc_core::CoreConfiguration::handshaker_registry
const HandshakerRegistry & handshaker_registry() const
Definition: core_configuration.h:145
absl::InlinedVector::data
pointer data() noexcept
Definition: abseil-cpp/absl/container/inlined_vector.h:302
intptr_t
_W64 signed int intptr_t
Definition: stdint-msvc2008.h:118
client_channel_factory.h
grpc_posix.h
grpc_endpoint_shutdown
void grpc_endpoint_shutdown(grpc_endpoint *ep, grpc_error_handle why)
Definition: endpoint.cc:49
absl::InlinedVector::size
size_type size() const noexcept
Definition: abseil-cpp/absl/container/inlined_vector.h:270
slice_internal.h
GPR_ERROR
#define GPR_ERROR
Definition: include/grpc/impl/codegen/log.h:57
grpc_endpoint_destroy
void grpc_endpoint_destroy(grpc_endpoint *ep)
Definition: endpoint.cc:53
channel_stack_type.h
tcp_connect_handshaker.h
grpc_core::CoreConfiguration::channel_args_preconditioning
const ChannelArgsPreconditioning & channel_args_preconditioning() const
Definition: core_configuration.h:139
grpc_core::Subchannel::Create
static RefCountedPtr< Subchannel > Create(OrphanablePtr< SubchannelConnector > connector, const grpc_resolved_address &address, const grpc_channel_args *args)
Definition: subchannel.cc:712
grpc_core::ExecCtx
Definition: exec_ctx.h:97
grpc_core::SubchannelConnector::Result
Definition: connector.h:52
stdint.h
transport_fwd.h
resolver_registry.h
GRPC_ERROR_CREATE_FROM_STATIC_STRING
#define GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc)
Definition: error.h:291
grpc_chttp2_transport_get_socket_node
grpc_core::RefCountedPtr< grpc_core::channelz::SocketNode > grpc_chttp2_transport_get_socket_node(grpc_transport *transport)
Definition: chttp2_transport.cc:3116
grpc_core::Chttp2Connector::Connect
void Connect(const Args &args, Result *result, grpc_closure *notify) override
Definition: chttp2_connector.cc:98
grpc_timer_cancel
void grpc_timer_cancel(grpc_timer *timer)
Definition: iomgr/timer.cc:36
grpc_core::Chttp2Connector::handshake_mgr_
RefCountedPtr< HandshakeManager > handshake_mgr_
Definition: chttp2_connector.h:72
absl::StatusOr::ok
ABSL_MUST_USE_RESULT bool ok() const
Definition: abseil-cpp/absl/status/statusor.h:491
grpc_core::HandshakerRegistry::AddHandshakers
void AddHandshakers(HandshakerType handshaker_type, const grpc_channel_args *args, grpc_pollset_set *interested_parties, HandshakeManager *handshake_mgr) const
Definition: handshaker_registry.cc:45
GRPC_ERROR_REF
#define GRPC_ERROR_REF(err)
Definition: error.h:261
GRPC_ARG_TCP_HANDSHAKER_RESOLVED_ADDRESS
#define GRPC_ARG_TCP_HANDSHAKER_RESOLVED_ADDRESS
Definition: tcp_connect_handshaker.h:25
absl_status_to_grpc_error
grpc_error_handle absl_status_to_grpc_error(absl::Status status)
Definition: error_utils.cc:167
debug_location.h
grpc_channel_arg_integer_create
grpc_arg grpc_channel_arg_integer_create(char *name, int value)
Definition: channel_args.cc:484
grpc_core::Chttp2Connector::args_
Args args_
Definition: chttp2_connector.h:61
absl::flags_internal
Definition: abseil-cpp/absl/flags/commandlineflag.h:40
GRPC_CLIENT_CHANNEL
@ GRPC_CLIENT_CHANNEL
Definition: channel_stack_type.h:26
exec_ctx
grpc_core::ExecCtx exec_ctx
Definition: end2end_binder_transport_test.cc:75
GRPC_ERROR_CREATE_FROM_CPP_STRING
#define GRPC_ERROR_CREATE_FROM_CPP_STRING(desc)
Definition: error.h:297
alloc.h
fix_build_deps.r
r
Definition: fix_build_deps.py:491
chttp2_transport.h
GRPC_ARG_TCP_HANDSHAKER_BIND_ENDPOINT_TO_POLLSET
#define GRPC_ARG_TCP_HANDSHAKER_BIND_ENDPOINT_TO_POLLSET
Definition: tcp_connect_handshaker.h:29
grpc_core::Chttp2Connector::result_
Result * result_
Definition: chttp2_connector.h:62
grpc_core::Chttp2Connector::shutdown_
bool shutdown_
Definition: chttp2_connector.h:64
arg
struct arg arg
grpc_core::CoreConfiguration::resolver_registry
const ResolverRegistry & resolver_registry() const
Definition: core_configuration.h:157
exec_ctx.h
grpc_timer_init
void grpc_timer_init(grpc_timer *timer, grpc_core::Timestamp deadline, grpc_closure *closure)
Definition: iomgr/timer.cc:31
handshaker.h
closure
Definition: proxy.cc:59
unique_type_name.h
GRPC_ERROR_UNREF
#define GRPC_ERROR_UNREF(err)
Definition: error.h:262
grpc_core::ChannelArgs
Definition: channel_args.h:111
grpc_core::ExecCtx::Run
static void Run(const DebugLocation &location, grpc_closure *closure, grpc_error_handle error)
Definition: exec_ctx.cc:98
grpc_channel
struct grpc_channel grpc_channel
Definition: grpc_types.h:62
grpc_transport
Definition: transport_impl.h:89
transport.h
grpc_security_connector_find_in_args
grpc_security_connector * grpc_security_connector_find_in_args(const grpc_channel_args *args)
Definition: security_connector.cc:117
channel_args.h
grpc_slice_buffer_destroy_internal
void grpc_slice_buffer_destroy_internal(grpc_slice_buffer *sb)
Definition: slice/slice_buffer.cc:123
api_trace.h
grpc_core::HandshakerArgs
Definition: handshaker.h:64
GRPC_STATUS_INTERNAL
@ GRPC_STATUS_INTERNAL
Definition: include/grpc/impl/codegen/status.h:129
absl::StatusOr::value
const T & value() const &ABSL_ATTRIBUTE_LIFETIME_BOUND
Definition: abseil-cpp/absl/status/statusor.h:687
absl::StatusOr< std::string >
absl::InlinedVector
Definition: abseil-cpp/absl/container/inlined_vector.h:69
endpoint.h
grpc_core::Chttp2Connector::~Chttp2Connector
~Chttp2Connector() override
Definition: chttp2_connector.cc:92
grpc_error
Definition: error_internal.h:42
grpc_core::Chttp2Connector::notify_error_
absl::optional< grpc_error_handle > notify_error_
Definition: chttp2_connector.h:71
grpc_channel_create
grpc_channel * grpc_channel_create(const char *target, grpc_channel_credentials *creds, const grpc_channel_args *c_args)
Definition: chttp2_connector.cc:366
grpc_core::Chttp2Connector::notify_
grpc_closure * notify_
Definition: chttp2_connector.h:63
self
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern self
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/map.c:543
grpc_channel_credentials::create_security_connector
virtual grpc_core::RefCountedPtr< grpc_channel_security_connector > create_security_connector(grpc_core::RefCountedPtr< grpc_call_credentials > call_creds, const char *target, const grpc_channel_args *args, grpc_channel_args **new_args)=0
sync.h
grpc_closure
Definition: closure.h:56
grpc_sockaddr_to_uri
absl::StatusOr< std::string > grpc_sockaddr_to_uri(const grpc_resolved_address *resolved_addr)
Definition: sockaddr_utils.cc:260
grpc_core::Chttp2Connector::Shutdown
void Shutdown(grpc_error_handle error) override
Definition: chttp2_connector.cc:136
grpc_endpoint
Definition: endpoint.h:105
setup.target
target
Definition: third_party/bloaty/third_party/protobuf/python/setup.py:179
grpc_channel_credentials
Definition: src/core/lib/security/credentials/credentials.h:96
grpc_core::ChannelArgsPreconditioning::PreconditionChannelArgs
ChannelArgs PreconditionChannelArgs(const grpc_channel_args *args) const
Definition: channel_args_preconditioning.cc:34
grpc_core::Chttp2Connector::MaybeNotify
void MaybeNotify(grpc_error_handle error)
Definition: chttp2_connector.cc:253
grpc_core::Channel::Create
static absl::StatusOr< RefCountedPtr< Channel > > Create(const char *target, ChannelArgs args, grpc_channel_stack_type channel_stack_type, grpc_transport *optional_transport)
Definition: channel.cc:202
grpc_channel_args_string
std::string grpc_channel_args_string(const grpc_channel_args *args)
Definition: channel_args.cc:502
grpc_channel_create_from_fd
grpc_channel * grpc_channel_create_from_fd(const char *, int, grpc_channel_credentials *, const grpc_channel_args *)
Definition: chttp2_connector.cc:453
grpc_chttp2_transport_start_reading
void grpc_chttp2_transport_start_reading(grpc_transport *transport, grpc_slice_buffer *read_buffer, grpc_closure *notify_on_receive_settings, grpc_closure *notify_on_close)
Definition: chttp2_transport.cc:3128
grpc_core::ExecCtx::Get
static ExecCtx * Get()
Definition: exec_ctx.h:205
grpc_channel_args_copy_and_add
grpc_channel_args * grpc_channel_args_copy_and_add(const grpc_channel_args *src, const grpc_arg *to_add, size_t num_to_add)
Definition: channel_args.cc:224
grpc_core::RefCounted::Ref
RefCountedPtr< Child > Ref() GRPC_MUST_USE_RESULT
Definition: ref_counted.h:287
grpc_core::Chttp2Connector::endpoint_
grpc_endpoint * endpoint_
Definition: chttp2_connector.h:67
GRPC_ERROR_INT_GRPC_STATUS
@ GRPC_ERROR_INT_GRPC_STATUS
grpc status code representing this error
Definition: error.h:66
GRPC_API_TRACE
#define GRPC_API_TRACE(fmt, nargs, args)
Definition: api_trace.h:48
absl::StatusOr::status
const Status & status() const &
Definition: abseil-cpp/absl/status/statusor.h:678
error_utils.h
GRPC_ERROR_IS_NONE
#define GRPC_ERROR_IS_NONE(err)
Definition: error.h:241
channel.h
port_platform.h


grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:53