Make changes to fix test failures

pull/18373/head
Karthik Ravi Shankar 6 years ago
parent 392554e341
commit 130962490b
  1. 2
      include/grpcpp/create_channel_posix.h
  2. 32
      src/cpp/client/create_channel_posix.cc

@ -43,7 +43,7 @@ CreateCustomInsecureChannelWithInterceptorsFromFd(
std::unique_ptr<std::vector< std::unique_ptr<std::vector<
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>> std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>>
interceptor_creators) { interceptor_creators) {
return CreateCustomInsecureChannelWithInterceptorsFromFd( return ::grpc_impl::experimental::CreateCustomInsecureChannelWithInterceptorsFromFd(
target, fd, args, std::move(interceptor_creators)); target, fd, args, std::move(interceptor_creators));
} }

@ -24,45 +24,45 @@
#include "src/cpp/client/create_channel_internal.h" #include "src/cpp/client/create_channel_internal.h"
namespace grpc { namespace grpc_impl {
#ifdef GPR_SUPPORT_CHANNELS_FROM_FD #ifdef GPR_SUPPORT_CHANNELS_FROM_FD
std::shared_ptr<Channel> CreateInsecureChannelFromFd(const grpc::string& target, std::shared_ptr<grpc::Channel> CreateInsecureChannelFromFd(const grpc::string& target,
int fd) { int fd) {
internal::GrpcLibrary init_lib; grpc::internal::GrpcLibrary init_lib;
init_lib.init(); init_lib.init();
return CreateChannelInternal( return grpc::CreateChannelInternal(
"", grpc_insecure_channel_create_from_fd(target.c_str(), fd, nullptr), "", grpc_insecure_channel_create_from_fd(target.c_str(), fd, nullptr),
std::vector< std::vector<
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>()); std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>());
} }
std::shared_ptr<Channel> CreateCustomInsecureChannelFromFd( std::shared_ptr<grpc::Channel> CreateCustomInsecureChannelFromFd(
const grpc::string& target, int fd, const ChannelArguments& args) { const grpc::string& target, int fd, const grpc::ChannelArguments& args) {
internal::GrpcLibrary init_lib; grpc::internal::GrpcLibrary init_lib;
init_lib.init(); init_lib.init();
grpc_channel_args channel_args; grpc_channel_args channel_args;
args.SetChannelArgs(&channel_args); args.SetChannelArgs(&channel_args);
return CreateChannelInternal( return grpc::CreateChannelInternal(
"", "",
grpc_insecure_channel_create_from_fd(target.c_str(), fd, &channel_args), grpc_insecure_channel_create_from_fd(target.c_str(), fd, &channel_args),
std::vector< std::vector<
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>()); std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>());
} }
namespace experimental { namespace experimental {
std::shared_ptr<Channel> CreateCustomInsecureChannelWithInterceptorsFromFd( std::shared_ptr<grpc::Channel> CreateCustomInsecureChannelWithInterceptorsFromFd(
const grpc::string& target, int fd, const ChannelArguments& args, const grpc::string& target, int fd, const grpc::ChannelArguments& args,
std::vector< std::vector<
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>> std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators) { interceptor_creators) {
internal::GrpcLibrary init_lib; grpc::internal::GrpcLibrary init_lib;
init_lib.init(); init_lib.init();
grpc_channel_args channel_args; grpc_channel_args channel_args;
args.SetChannelArgs(&channel_args); args.SetChannelArgs(&channel_args);
return CreateChannelInternal( return grpc::CreateChannelInternal(
"", "",
grpc_insecure_channel_create_from_fd(target.c_str(), fd, &channel_args), grpc_insecure_channel_create_from_fd(target.c_str(), fd, &channel_args),
std::move(interceptor_creators)); std::move(interceptor_creators));
@ -72,4 +72,4 @@ std::shared_ptr<Channel> CreateCustomInsecureChannelWithInterceptorsFromFd(
#endif // GPR_SUPPORT_CHANNELS_FROM_FD #endif // GPR_SUPPORT_CHANNELS_FROM_FD
} // namespace grpc } // namespace grpc_impl

Loading…
Cancel
Save