Resolve comments

pull/18909/head
yang-g 6 years ago
parent 152a7cc122
commit 68b5260b74
  1. 8
      src/core/lib/iomgr/tcp_server_posix.cc
  2. 4
      src/cpp/server/external_connection_acceptor_impl.cc

@ -587,26 +587,19 @@ class ExternalConnectionHandler : public grpc_core::TcpServerFdHandler {
close(fd);
return;
}
grpc_set_socket_no_sigpipe_if_possible(fd);
addr_str = grpc_sockaddr_to_uri(&addr);
gpr_asprintf(&name, "tcp-server-connection:%s", addr_str);
if (grpc_tcp_trace.enabled()) {
gpr_log(GPR_INFO, "SERVER_CONNECT: incoming external connection: %s",
addr_str);
}
grpc_fd* fdobj = grpc_fd_create(fd, name, true);
read_notifier_pollset =
s_->pollsets[static_cast<size_t>(gpr_atm_no_barrier_fetch_add(
&s_->next_pollset_to_assign, 1)) %
s_->pollset_count];
grpc_pollset_add_fd(read_notifier_pollset, fdobj);
grpc_tcp_server_acceptor* acceptor =
static_cast<grpc_tcp_server_acceptor*>(gpr_malloc(sizeof(*acceptor)));
acceptor->from_server = s_;
@ -614,7 +607,6 @@ class ExternalConnectionHandler : public grpc_core::TcpServerFdHandler {
acceptor->fd_index = -1;
acceptor->external_connection = true;
acceptor->pending_data = buf;
s_->on_accept_cb(s_->on_accept_cb_arg,
grpc_tcp_create(fdobj, s_->channel_args, addr_str),
read_notifier_pollset, acceptor);

@ -62,6 +62,10 @@ void ExternalConnectionAcceptorImpl::HandleNewConnection(
std::lock_guard<std::mutex> lock(mu_);
if (shutdown_ || !started_) {
// TODO(yangg) clean up.
gpr_log(
GPR_ERROR,
"NOT handling external connection with fd %d, started %d, shutdown %d",
p->fd, started_, shutdown_);
return;
}
if (handler_) {

Loading…
Cancel
Save