pull/35957/head
AJ Heller 8 months ago
parent caa1d1f761
commit abdb9939c5
  1. 2
      include/grpcpp/server_builder.h
  2. 6
      src/core/ext/transport/chttp2/server/chttp2_server.cc

@ -300,7 +300,7 @@ class ServerBuilder {
// Creates a passive listener for Server Endpoint injection.
///
/// \a PasiveListener lets applications provide pre-established connections
/// to gRPC Servers. The server will behave as if it accepted the onnection
/// to gRPC Servers. The server will behave as if it accepted the connection
/// itself on its own listening addresses.
///
/// This can be called multiple times to create passive listeners with

@ -1211,11 +1211,12 @@ absl::Status grpc_server_add_passive_listener(
2, (server, credentials));
// Create security context.
if (credentials == nullptr) {
return GRPC_ERROR_CREATE("No credentials specified for passive listener");
return absl::UnavailableError(
"No credentials specified for passive listener");
}
auto sc = credentials->create_security_connector(grpc_core::ChannelArgs());
if (sc == nullptr) {
return GRPC_ERROR_CREATE(
return absl::UnavailableError(
absl::StrCat("Unable to create secure server with credentials of type ",
credentials->type().name()));
}
@ -1226,6 +1227,5 @@ absl::Status grpc_server_add_passive_listener(
grpc_core::Chttp2ServerListener::CreateForPassiveListener(
server, args, passive_listener);
passive_listener->server_ = server->Ref();
return absl::OkStatus();
}

Loading…
Cancel
Save