grpc 1.25.0 → 1.26.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +782 -291
- data/include/grpc/impl/codegen/grpc_types.h +4 -0
- data/include/grpc/impl/codegen/port_platform.h +7 -0
- data/include/grpc/support/alloc.h +0 -16
- data/src/core/ext/filters/client_channel/backend_metric.cc +2 -2
- data/src/core/ext/filters/client_channel/backup_poller.cc +1 -1
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +2 -2
- data/src/core/ext/filters/client_channel/client_channel.cc +95 -88
- data/src/core/ext/filters/client_channel/client_channel_channelz.cc +7 -7
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +4 -2
- data/src/core/ext/filters/client_channel/client_channel_factory.cc +1 -1
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +3 -3
- data/src/core/ext/filters/client_channel/connector.h +40 -45
- data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +10 -10
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +16 -13
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +66 -37
- data/src/core/ext/filters/client_channel/http_proxy.cc +107 -116
- data/src/core/ext/filters/client_channel/http_proxy.h +5 -1
- data/src/core/ext/filters/client_channel/lb_policy.cc +3 -3
- data/src/core/ext/filters/client_channel/lb_policy.h +9 -5
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +10 -8
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +18 -19
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +4 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +4 -4
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +6 -9
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +368 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +157 -77
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +5 -5
- data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -1
- data/src/core/ext/filters/client_channel/local_subchannel_pool.cc +8 -8
- data/src/core/ext/filters/client_channel/proxy_mapper.h +14 -34
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +46 -79
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +23 -17
- data/src/core/ext/filters/client_channel/resolver.cc +2 -1
- data/src/core/ext/filters/client_channel/resolver.h +2 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +4 -4
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +13 -10
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +3 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +9 -8
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +17 -16
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +2 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +4 -4
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +9 -9
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +5 -3
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver_factory.h +3 -3
- data/src/core/ext/filters/client_channel/resolver_registry.cc +14 -12
- data/src/core/ext/filters/client_channel/resolver_registry.h +6 -4
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +6 -6
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +6 -6
- data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +5 -5
- data/src/core/ext/filters/client_channel/resolving_lb_policy.h +3 -3
- data/src/core/ext/filters/client_channel/service_config.cc +15 -14
- data/src/core/ext/filters/client_channel/service_config.h +14 -19
- data/src/core/ext/filters/client_channel/subchannel.cc +38 -36
- data/src/core/ext/filters/client_channel/subchannel.h +11 -12
- data/src/core/ext/filters/client_channel/subchannel_interface.h +1 -1
- data/src/core/ext/filters/client_channel/xds/xds_api.cc +19 -9
- data/src/core/ext/filters/client_channel/xds/xds_api.h +19 -9
- data/src/core/ext/filters/client_channel/xds/xds_bootstrap.cc +3 -3
- data/src/core/ext/filters/client_channel/xds/xds_bootstrap.h +6 -5
- data/src/core/ext/filters/client_channel/xds/xds_client.cc +58 -31
- data/src/core/ext/filters/client_channel/xds/xds_client.h +20 -15
- data/src/core/ext/filters/client_channel/xds/xds_client_stats.cc +5 -3
- data/src/core/ext/filters/client_channel/xds/xds_client_stats.h +18 -15
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +10 -10
- data/src/core/ext/filters/deadline/deadline_filter.cc +15 -13
- data/src/core/ext/filters/http/client/http_client_filter.cc +12 -12
- data/src/core/ext/filters/http/client_authority_filter.cc +3 -3
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +13 -7
- data/src/core/ext/filters/http/server/http_server_filter.cc +14 -13
- data/src/core/ext/filters/max_age/max_age_filter.cc +16 -14
- data/src/core/ext/filters/message_size/message_size_filter.cc +10 -8
- data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +9 -8
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +141 -174
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +31 -1
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +7 -6
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +14 -12
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +8 -5
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +46 -38
- data/src/core/ext/transport/chttp2/transport/context_list.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/flow_control.h +0 -5
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +6 -7
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +5 -5
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +11 -8
- data/src/core/ext/transport/chttp2/transport/internal.h +3 -3
- data/src/core/ext/transport/chttp2/transport/parsing.cc +4 -4
- data/src/core/ext/transport/chttp2/transport/writing.cc +3 -2
- data/src/core/ext/transport/inproc/inproc_transport.cc +65 -41
- data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.c +141 -70
- data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +352 -118
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c +8 -4
- data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h +65 -0
- data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +16 -2
- data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +36 -0
- data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c +12 -5
- data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +34 -0
- data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c +1 -2
- data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c +13 -12
- data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h +28 -24
- data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c +5 -4
- data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +13 -0
- data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.c +23 -23
- data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.h +48 -44
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/type/http.upb.c +16 -0
- data/src/core/ext/upb-generated/envoy/type/http.upb.h +36 -0
- data/src/core/ext/upb-generated/envoy/type/percent.upb.c +0 -1
- data/src/core/ext/upb-generated/envoy/type/range.upb.c +0 -1
- data/src/core/lib/avl/avl.cc +1 -1
- data/src/core/lib/channel/channel_stack.cc +1 -1
- data/src/core/lib/channel/channel_stack.h +16 -4
- data/src/core/lib/channel/channel_trace.cc +4 -4
- data/src/core/lib/channel/channelz.cc +46 -46
- data/src/core/lib/channel/channelz.h +37 -35
- data/src/core/lib/channel/channelz_registry.cc +2 -2
- data/src/core/lib/channel/channelz_registry.h +1 -1
- data/src/core/lib/channel/connected_channel.cc +3 -2
- data/src/core/lib/channel/handshaker.cc +1 -1
- data/src/core/lib/channel/handshaker_registry.cc +5 -5
- data/src/core/lib/channel/handshaker_registry.h +3 -3
- data/src/core/lib/compression/message_compress.cc +3 -2
- data/src/core/lib/compression/stream_compression_identity.cc +5 -7
- data/src/core/lib/gpr/alloc.cc +4 -29
- data/src/core/lib/gpr/cpu_linux.cc +1 -1
- data/src/core/lib/gprpp/fork.cc +4 -4
- data/src/core/lib/gprpp/global_config_env.cc +7 -7
- data/src/core/lib/gprpp/global_config_env.h +2 -2
- data/src/core/lib/gprpp/host_port.cc +8 -8
- data/src/core/lib/gprpp/host_port.h +3 -3
- data/src/core/lib/gprpp/inlined_vector.h +13 -0
- data/src/core/lib/gprpp/map.h +2 -9
- data/src/core/lib/gprpp/memory.h +12 -98
- data/src/core/lib/gprpp/orphanable.h +3 -3
- data/src/core/lib/gprpp/ref_counted.h +3 -3
- data/src/core/lib/gprpp/ref_counted_ptr.h +1 -1
- data/src/core/lib/gprpp/string_view.h +45 -23
- data/src/core/lib/gprpp/thd.h +1 -1
- data/src/core/lib/gprpp/thd_posix.cc +6 -5
- data/src/core/lib/gprpp/thd_windows.cc +3 -3
- data/src/core/lib/http/httpcli.cc +1 -1
- data/src/core/lib/http/httpcli_security_connector.cc +3 -3
- data/src/core/lib/iomgr/buffer_list.cc +10 -5
- data/src/core/lib/iomgr/call_combiner.cc +7 -6
- data/src/core/lib/iomgr/call_combiner.h +4 -3
- data/src/core/lib/iomgr/cfstream_handle.cc +2 -2
- data/src/core/lib/iomgr/closure.h +33 -135
- data/src/core/lib/iomgr/combiner.cc +10 -17
- data/src/core/lib/iomgr/combiner.h +0 -2
- data/src/core/lib/iomgr/endpoint_cfstream.cc +2 -2
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +1 -1
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +3 -2
- data/src/core/lib/iomgr/ev_epollex_linux.cc +23 -13
- data/src/core/lib/iomgr/ev_poll_posix.cc +30 -17
- data/src/core/lib/iomgr/exec_ctx.cc +52 -5
- data/src/core/lib/iomgr/exec_ctx.h +6 -2
- data/src/core/lib/iomgr/executor.cc +16 -37
- data/src/core/lib/iomgr/executor.h +4 -7
- data/src/core/lib/iomgr/executor/threadpool.cc +4 -4
- data/src/core/lib/iomgr/iomgr_custom.cc +1 -1
- data/src/core/lib/iomgr/lockfree_event.cc +9 -8
- data/src/core/lib/iomgr/logical_thread.cc +103 -0
- data/src/core/lib/iomgr/logical_thread.h +52 -0
- data/src/core/lib/iomgr/pollset_custom.cc +5 -5
- data/src/core/lib/iomgr/pollset_set_custom.cc +9 -9
- data/src/core/lib/iomgr/pollset_windows.cc +16 -2
- data/src/core/lib/iomgr/port.h +3 -0
- data/src/core/lib/iomgr/resolve_address_custom.cc +4 -4
- data/src/core/lib/iomgr/resolve_address_posix.cc +8 -9
- data/src/core/lib/iomgr/resolve_address_windows.cc +4 -6
- data/src/core/lib/iomgr/resource_quota.cc +26 -21
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +11 -0
- data/src/core/lib/iomgr/socket_windows.cc +2 -2
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +2 -2
- data/src/core/lib/iomgr/tcp_client_custom.cc +2 -2
- data/src/core/lib/iomgr/tcp_client_posix.cc +5 -4
- data/src/core/lib/iomgr/tcp_client_windows.cc +2 -2
- data/src/core/lib/iomgr/tcp_custom.cc +10 -9
- data/src/core/lib/iomgr/tcp_posix.cc +19 -15
- data/src/core/lib/iomgr/tcp_server_custom.cc +3 -2
- data/src/core/lib/iomgr/tcp_server_posix.cc +5 -4
- data/src/core/lib/iomgr/tcp_server_windows.cc +5 -3
- data/src/core/lib/iomgr/tcp_windows.cc +16 -13
- data/src/core/lib/iomgr/timer_custom.cc +4 -3
- data/src/core/lib/iomgr/timer_generic.cc +11 -9
- data/src/core/lib/iomgr/udp_server.cc +16 -13
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +8 -5
- data/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +45 -57
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +7 -6
- data/src/core/lib/security/credentials/credentials.cc +8 -8
- data/src/core/lib/security/credentials/credentials.h +5 -5
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +5 -5
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +1 -1
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +4 -4
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +4 -4
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +2 -2
- data/src/core/lib/security/credentials/local/local_credentials.cc +3 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +13 -11
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +6 -5
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +4 -4
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +5 -5
- data/src/core/lib/security/credentials/tls/spiffe_credentials.cc +2 -2
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +28 -22
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +5 -0
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +10 -10
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +2 -1
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +8 -8
- data/src/core/lib/security/security_connector/security_connector.h +1 -1
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +9 -9
- data/src/core/lib/security/security_connector/ssl_utils.cc +5 -4
- data/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc +14 -15
- data/src/core/lib/security/transport/client_auth_filter.cc +4 -3
- data/src/core/lib/security/transport/secure_endpoint.cc +9 -8
- data/src/core/lib/security/transport/security_handshaker.cc +67 -23
- data/src/core/lib/security/transport/server_auth_filter.cc +6 -5
- data/src/core/lib/security/transport/target_authority_table.h +1 -1
- data/src/core/lib/slice/b64.cc +3 -4
- data/src/core/lib/slice/b64.h +1 -2
- data/src/core/lib/slice/slice.cc +8 -13
- data/src/core/lib/surface/call.cc +19 -19
- data/src/core/lib/surface/call.h +6 -7
- data/src/core/lib/surface/call_log_batch.cc +1 -2
- data/src/core/lib/surface/channel.cc +17 -18
- data/src/core/lib/surface/channel.h +4 -19
- data/src/core/lib/surface/channel_ping.cc +1 -1
- data/src/core/lib/surface/completion_queue.cc +21 -22
- data/src/core/lib/surface/completion_queue_factory.cc +1 -1
- data/src/core/lib/surface/init.cc +1 -1
- data/src/core/lib/surface/init_secure.cc +2 -2
- data/src/core/lib/surface/lame_client.cc +10 -12
- data/src/core/lib/surface/server.cc +24 -18
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/byte_stream.cc +2 -2
- data/src/core/lib/transport/byte_stream.h +2 -1
- data/src/core/lib/transport/connectivity_state.cc +4 -4
- data/src/core/lib/transport/connectivity_state.h +2 -2
- data/src/core/lib/transport/metadata.cc +8 -10
- data/src/core/lib/transport/metadata.h +5 -8
- data/src/core/lib/transport/metadata_batch.cc +6 -0
- data/src/core/lib/transport/static_metadata.cc +2 -4
- data/src/core/lib/transport/status_metadata.cc +7 -0
- data/src/core/lib/transport/status_metadata.h +18 -0
- data/src/core/lib/transport/transport.cc +9 -7
- data/src/core/plugin_registry/grpc_plugin_registry.cc +4 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +292 -43
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +197 -46
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +4 -2
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +5 -0
- data/src/core/tsi/ssl/session_cache/ssl_session.h +1 -1
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +4 -4
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +1 -1
- data/src/core/tsi/ssl_transport_security.cc +2 -1
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +0 -4
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +0 -6
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/upb/upb/decode.c +1 -0
- metadata +34 -32
- data/src/core/ext/filters/client_channel/connector.cc +0 -41
- data/src/core/ext/filters/client_channel/proxy_mapper.cc +0 -48
- data/src/core/lib/gprpp/set.h +0 -33
@@ -91,13 +91,14 @@ class GrpcPolledFdFactoryPosix : public GrpcPolledFdFactory {
|
|
91
91
|
GrpcPolledFd* NewGrpcPolledFdLocked(ares_socket_t as,
|
92
92
|
grpc_pollset_set* driver_pollset_set,
|
93
93
|
Combiner* /*combiner*/) override {
|
94
|
-
return
|
94
|
+
return new GrpcPolledFdPosix(as, driver_pollset_set);
|
95
95
|
}
|
96
96
|
|
97
97
|
void ConfigureAresChannelLocked(ares_channel /*channel*/) override {}
|
98
98
|
};
|
99
99
|
|
100
|
-
|
100
|
+
std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
|
101
|
+
Combiner* /*combiner*/) {
|
101
102
|
return MakeUnique<GrpcPolledFdFactoryPosix>();
|
102
103
|
}
|
103
104
|
|
@@ -128,12 +128,12 @@ class GrpcPolledFdWindows {
|
|
128
128
|
}
|
129
129
|
|
130
130
|
void ScheduleAndNullReadClosure(grpc_error* error) {
|
131
|
-
|
131
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, read_closure_, error);
|
132
132
|
read_closure_ = nullptr;
|
133
133
|
}
|
134
134
|
|
135
135
|
void ScheduleAndNullWriteClosure(grpc_error* error) {
|
136
|
-
|
136
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, write_closure_, error);
|
137
137
|
write_closure_ = nullptr;
|
138
138
|
}
|
139
139
|
|
@@ -752,7 +752,7 @@ class SockToPolledFdMap {
|
|
752
752
|
}
|
753
753
|
|
754
754
|
void AddNewSocket(SOCKET s, GrpcPolledFdWindows* polled_fd) {
|
755
|
-
SockToPolledFdEntry* new_node =
|
755
|
+
SockToPolledFdEntry* new_node = new SockToPolledFdEntry(s, polled_fd);
|
756
756
|
new_node->next = head_;
|
757
757
|
head_ = new_node;
|
758
758
|
}
|
@@ -775,7 +775,7 @@ class SockToPolledFdMap {
|
|
775
775
|
node = node->next) {
|
776
776
|
if (node->socket == s) {
|
777
777
|
*prev = node->next;
|
778
|
-
|
778
|
+
delete node;
|
779
779
|
return;
|
780
780
|
}
|
781
781
|
prev = &node->next;
|
@@ -805,7 +805,7 @@ class SockToPolledFdMap {
|
|
805
805
|
}
|
806
806
|
grpc_tcp_set_non_block(s);
|
807
807
|
GrpcPolledFdWindows* polled_fd =
|
808
|
-
|
808
|
+
new GrpcPolledFdWindows(s, map->combiner_, af, type);
|
809
809
|
GRPC_CARES_TRACE_LOG(
|
810
810
|
"fd:|%s| created with params af:%d type:%d protocol:%d",
|
811
811
|
polled_fd->GetName(), af, type, protocol);
|
@@ -855,7 +855,7 @@ class SockToPolledFdMap {
|
|
855
855
|
"Shut down c-ares fd before without it ever having made it into the "
|
856
856
|
"driver's list"));
|
857
857
|
}
|
858
|
-
|
858
|
+
delete polled_fd;
|
859
859
|
return 0;
|
860
860
|
}
|
861
861
|
|
@@ -920,7 +920,7 @@ class GrpcPolledFdFactoryWindows : public GrpcPolledFdFactory {
|
|
920
920
|
// Set a flag so that the virtual socket "close" method knows it
|
921
921
|
// doesn't need to call ShutdownLocked, since now the driver will.
|
922
922
|
polled_fd->set_gotten_into_driver_list();
|
923
|
-
return
|
923
|
+
return new GrpcPolledFdWindowsWrapper(polled_fd);
|
924
924
|
}
|
925
925
|
|
926
926
|
void ConfigureAresChannelLocked(ares_channel channel) override {
|
@@ -932,7 +932,8 @@ class GrpcPolledFdFactoryWindows : public GrpcPolledFdFactory {
|
|
932
932
|
SockToPolledFdMap sock_to_polled_fd_map_;
|
933
933
|
};
|
934
934
|
|
935
|
-
|
935
|
+
std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
|
936
|
+
Combiner* combiner) {
|
936
937
|
return MakeUnique<GrpcPolledFdFactoryWindows>(combiner);
|
937
938
|
}
|
938
939
|
|
@@ -59,7 +59,7 @@ struct grpc_ares_request {
|
|
59
59
|
/** closure to call when the request completes */
|
60
60
|
grpc_closure* on_done;
|
61
61
|
/** the pointer to receive the resolved addresses */
|
62
|
-
|
62
|
+
std::unique_ptr<grpc_core::ServerAddressList>* addresses_out;
|
63
63
|
/** the pointer to receive the service config in JSON */
|
64
64
|
char** service_config_json_out;
|
65
65
|
/** the evernt driver used by this request */
|
@@ -148,7 +148,7 @@ void grpc_ares_complete_request_locked(grpc_ares_request* r) {
|
|
148
148
|
// TODO(apolcyn): allow c-ares to return a service config
|
149
149
|
// with no addresses along side it
|
150
150
|
}
|
151
|
-
|
151
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done, r->error);
|
152
152
|
}
|
153
153
|
|
154
154
|
static grpc_ares_hostbyname_request* create_hostbyname_request_locked(
|
@@ -447,12 +447,12 @@ void grpc_dns_lookup_ares_continue_after_check_localhost_and_ip_literals_locked(
|
|
447
447
|
return;
|
448
448
|
|
449
449
|
error_cleanup:
|
450
|
-
|
450
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done, error);
|
451
451
|
}
|
452
452
|
|
453
453
|
static bool inner_resolve_as_ip_literal_locked(
|
454
454
|
const char* name, const char* default_port,
|
455
|
-
|
455
|
+
std::unique_ptr<grpc_core::ServerAddressList>* addrs,
|
456
456
|
grpc_core::UniquePtr<char>* host, grpc_core::UniquePtr<char>* port,
|
457
457
|
grpc_core::UniquePtr<char>* hostport) {
|
458
458
|
grpc_core::SplitHostPort(name, host, port);
|
@@ -489,7 +489,7 @@ static bool inner_resolve_as_ip_literal_locked(
|
|
489
489
|
|
490
490
|
static bool resolve_as_ip_literal_locked(
|
491
491
|
const char* name, const char* default_port,
|
492
|
-
|
492
|
+
std::unique_ptr<grpc_core::ServerAddressList>* addrs) {
|
493
493
|
grpc_core::UniquePtr<char> host;
|
494
494
|
grpc_core::UniquePtr<char> port;
|
495
495
|
grpc_core::UniquePtr<char> hostport;
|
@@ -521,7 +521,7 @@ static bool target_matches_localhost(const char* name) {
|
|
521
521
|
#ifdef GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY
|
522
522
|
static bool inner_maybe_resolve_localhost_manually_locked(
|
523
523
|
const char* name, const char* default_port,
|
524
|
-
|
524
|
+
std::unique_ptr<grpc_core::ServerAddressList>* addrs,
|
525
525
|
grpc_core::UniquePtr<char>* host, grpc_core::UniquePtr<char>* port) {
|
526
526
|
grpc_core::SplitHostPort(name, host, port);
|
527
527
|
if (*host == nullptr) {
|
@@ -571,7 +571,7 @@ static bool inner_maybe_resolve_localhost_manually_locked(
|
|
571
571
|
|
572
572
|
static bool grpc_ares_maybe_resolve_localhost_manually_locked(
|
573
573
|
const char* name, const char* default_port,
|
574
|
-
|
574
|
+
std::unique_ptr<grpc_core::ServerAddressList>* addrs) {
|
575
575
|
grpc_core::UniquePtr<char> host;
|
576
576
|
grpc_core::UniquePtr<char> port;
|
577
577
|
return inner_maybe_resolve_localhost_manually_locked(name, default_port,
|
@@ -580,7 +580,7 @@ static bool grpc_ares_maybe_resolve_localhost_manually_locked(
|
|
580
580
|
#else /* GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY */
|
581
581
|
static bool grpc_ares_maybe_resolve_localhost_manually_locked(
|
582
582
|
const char* /*name*/, const char* /*default_port*/,
|
583
|
-
|
583
|
+
std::unique_ptr<grpc_core::ServerAddressList>* /*addrs*/) {
|
584
584
|
return false;
|
585
585
|
}
|
586
586
|
#endif /* GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY */
|
@@ -588,8 +588,8 @@ static bool grpc_ares_maybe_resolve_localhost_manually_locked(
|
|
588
588
|
static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
|
589
589
|
const char* dns_server, const char* name, const char* default_port,
|
590
590
|
grpc_pollset_set* interested_parties, grpc_closure* on_done,
|
591
|
-
|
592
|
-
|
591
|
+
std::unique_ptr<grpc_core::ServerAddressList>* addrs, bool check_grpclb,
|
592
|
+
char** service_config_json, int query_timeout_ms,
|
593
593
|
grpc_core::Combiner* combiner) {
|
594
594
|
grpc_ares_request* r =
|
595
595
|
static_cast<grpc_ares_request*>(gpr_zalloc(sizeof(grpc_ares_request)));
|
@@ -631,8 +631,8 @@ static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
|
|
631
631
|
grpc_ares_request* (*grpc_dns_lookup_ares_locked)(
|
632
632
|
const char* dns_server, const char* name, const char* default_port,
|
633
633
|
grpc_pollset_set* interested_parties, grpc_closure* on_done,
|
634
|
-
|
635
|
-
|
634
|
+
std::unique_ptr<grpc_core::ServerAddressList>* addrs, bool check_grpclb,
|
635
|
+
char** service_config_json, int query_timeout_ms,
|
636
636
|
grpc_core::Combiner* combiner) = grpc_dns_lookup_ares_locked_impl;
|
637
637
|
|
638
638
|
static void grpc_cancel_ares_request_locked_impl(grpc_ares_request* r) {
|
@@ -678,7 +678,7 @@ typedef struct grpc_resolve_address_ares_request {
|
|
678
678
|
/** the pointer to receive the resolved addresses */
|
679
679
|
grpc_resolved_addresses** addrs_out;
|
680
680
|
/** currently resolving addresses */
|
681
|
-
|
681
|
+
std::unique_ptr<ServerAddressList> addresses;
|
682
682
|
/** closure to call when the resolve_address_ares request completes */
|
683
683
|
grpc_closure* on_resolve_address_done;
|
684
684
|
/** a closure wrapping on_resolve_address_done, which should be invoked when
|
@@ -714,9 +714,10 @@ static void on_dns_lookup_done_locked(void* arg, grpc_error* error) {
|
|
714
714
|
sizeof(grpc_resolved_address));
|
715
715
|
}
|
716
716
|
}
|
717
|
-
|
717
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_resolve_address_done,
|
718
|
+
GRPC_ERROR_REF(error));
|
718
719
|
GRPC_COMBINER_UNREF(r->combiner, "on_dns_lookup_done_cb");
|
719
|
-
|
720
|
+
delete r;
|
720
721
|
}
|
721
722
|
|
722
723
|
static void on_dns_lookup_done(void* arg, grpc_error* error) {
|
@@ -746,7 +747,7 @@ static void grpc_resolve_address_ares_impl(const char* name,
|
|
746
747
|
grpc_closure* on_done,
|
747
748
|
grpc_resolved_addresses** addrs) {
|
748
749
|
grpc_resolve_address_ares_request* r =
|
749
|
-
|
750
|
+
new grpc_resolve_address_ares_request();
|
750
751
|
r->combiner = grpc_combiner_create();
|
751
752
|
r->addrs_out = addrs;
|
752
753
|
r->on_resolve_address_done = on_done;
|
@@ -63,8 +63,8 @@ extern void (*grpc_resolve_address_ares)(const char* name,
|
|
63
63
|
extern grpc_ares_request* (*grpc_dns_lookup_ares_locked)(
|
64
64
|
const char* dns_server, const char* name, const char* default_port,
|
65
65
|
grpc_pollset_set* interested_parties, grpc_closure* on_done,
|
66
|
-
|
67
|
-
|
66
|
+
std::unique_ptr<grpc_core::ServerAddressList>* addresses, bool check_grpclb,
|
67
|
+
char** service_config_json, int query_timeout_ms,
|
68
68
|
grpc_core::Combiner* combiner);
|
69
69
|
|
70
70
|
/* Cancel the pending grpc_ares_request \a request */
|
@@ -29,8 +29,8 @@ struct grpc_ares_request {
|
|
29
29
|
static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
|
30
30
|
const char* dns_server, const char* name, const char* default_port,
|
31
31
|
grpc_pollset_set* interested_parties, grpc_closure* on_done,
|
32
|
-
|
33
|
-
|
32
|
+
std::unique_ptr<grpc_core::ServerAddressList>* addrs, bool check_grpclb,
|
33
|
+
char** service_config_json, int query_timeout_ms,
|
34
34
|
grpc_core::Combiner* combiner) {
|
35
35
|
return NULL;
|
36
36
|
}
|
@@ -38,8 +38,8 @@ static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
|
|
38
38
|
grpc_ares_request* (*grpc_dns_lookup_ares_locked)(
|
39
39
|
const char* dns_server, const char* name, const char* default_port,
|
40
40
|
grpc_pollset_set* interested_parties, grpc_closure* on_done,
|
41
|
-
|
42
|
-
|
41
|
+
std::unique_ptr<grpc_core::ServerAddressList>* addrs, bool check_grpclb,
|
42
|
+
char** service_config_json, int query_timeout_ms,
|
43
43
|
grpc_core::Combiner* combiner) = grpc_dns_lookup_ares_locked_impl;
|
44
44
|
|
45
45
|
static void grpc_cancel_ares_request_locked_impl(grpc_ares_request* r) {}
|
@@ -191,7 +191,7 @@ void FakeResolverResponseGenerator::SetResponseLocked(void* arg,
|
|
191
191
|
resolver->has_next_result_ = true;
|
192
192
|
resolver->MaybeSendResultLocked();
|
193
193
|
}
|
194
|
-
|
194
|
+
delete closure_arg;
|
195
195
|
}
|
196
196
|
|
197
197
|
void FakeResolverResponseGenerator::SetResponse(Resolver::Result result) {
|
@@ -205,7 +205,7 @@ void FakeResolverResponseGenerator::SetResponse(Resolver::Result result) {
|
|
205
205
|
}
|
206
206
|
resolver = resolver_->Ref();
|
207
207
|
}
|
208
|
-
SetResponseClosureArg* closure_arg =
|
208
|
+
SetResponseClosureArg* closure_arg = new SetResponseClosureArg();
|
209
209
|
closure_arg->resolver = std::move(resolver);
|
210
210
|
closure_arg->result = std::move(result);
|
211
211
|
closure_arg->resolver->combiner()->Run(
|
@@ -222,7 +222,7 @@ void FakeResolverResponseGenerator::SetReresolutionResponseLocked(
|
|
222
222
|
resolver->reresolution_result_ = std::move(closure_arg->result);
|
223
223
|
resolver->has_reresolution_result_ = closure_arg->has_result;
|
224
224
|
}
|
225
|
-
|
225
|
+
delete closure_arg;
|
226
226
|
}
|
227
227
|
|
228
228
|
void FakeResolverResponseGenerator::SetReresolutionResponse(
|
@@ -233,7 +233,7 @@ void FakeResolverResponseGenerator::SetReresolutionResponse(
|
|
233
233
|
GPR_ASSERT(resolver_ != nullptr);
|
234
234
|
resolver = resolver_->Ref();
|
235
235
|
}
|
236
|
-
SetResponseClosureArg* closure_arg =
|
236
|
+
SetResponseClosureArg* closure_arg = new SetResponseClosureArg();
|
237
237
|
closure_arg->resolver = std::move(resolver);
|
238
238
|
closure_arg->result = std::move(result);
|
239
239
|
closure_arg->has_result = true;
|
@@ -250,7 +250,7 @@ void FakeResolverResponseGenerator::UnsetReresolutionResponse() {
|
|
250
250
|
GPR_ASSERT(resolver_ != nullptr);
|
251
251
|
resolver = resolver_->Ref();
|
252
252
|
}
|
253
|
-
SetResponseClosureArg* closure_arg =
|
253
|
+
SetResponseClosureArg* closure_arg = new SetResponseClosureArg();
|
254
254
|
closure_arg->resolver = std::move(resolver);
|
255
255
|
closure_arg->resolver->combiner()->Run(
|
256
256
|
GRPC_CLOSURE_INIT(&closure_arg->set_response_closure,
|
@@ -266,7 +266,7 @@ void FakeResolverResponseGenerator::SetFailureLocked(void* arg,
|
|
266
266
|
resolver->return_failure_ = true;
|
267
267
|
if (closure_arg->immediate) resolver->MaybeSendResultLocked();
|
268
268
|
}
|
269
|
-
|
269
|
+
delete closure_arg;
|
270
270
|
}
|
271
271
|
|
272
272
|
void FakeResolverResponseGenerator::SetFailure() {
|
@@ -276,7 +276,7 @@ void FakeResolverResponseGenerator::SetFailure() {
|
|
276
276
|
GPR_ASSERT(resolver_ != nullptr);
|
277
277
|
resolver = resolver_->Ref();
|
278
278
|
}
|
279
|
-
SetResponseClosureArg* closure_arg =
|
279
|
+
SetResponseClosureArg* closure_arg = new SetResponseClosureArg();
|
280
280
|
closure_arg->resolver = std::move(resolver);
|
281
281
|
closure_arg->resolver->combiner()->Run(
|
282
282
|
GRPC_CLOSURE_INIT(&closure_arg->set_response_closure, SetFailureLocked,
|
@@ -291,7 +291,7 @@ void FakeResolverResponseGenerator::SetFailureOnReresolution() {
|
|
291
291
|
GPR_ASSERT(resolver_ != nullptr);
|
292
292
|
resolver = resolver_->Ref();
|
293
293
|
}
|
294
|
-
SetResponseClosureArg* closure_arg =
|
294
|
+
SetResponseClosureArg* closure_arg = new SetResponseClosureArg();
|
295
295
|
closure_arg->resolver = std::move(resolver);
|
296
296
|
closure_arg->immediate = false;
|
297
297
|
closure_arg->resolver->combiner()->Run(
|
@@ -306,7 +306,7 @@ void FakeResolverResponseGenerator::SetFakeResolver(
|
|
306
306
|
resolver_ = std::move(resolver);
|
307
307
|
if (resolver_ == nullptr) return;
|
308
308
|
if (has_result_) {
|
309
|
-
SetResponseClosureArg* closure_arg =
|
309
|
+
SetResponseClosureArg* closure_arg = new SetResponseClosureArg();
|
310
310
|
closure_arg->resolver = resolver_->Ref();
|
311
311
|
closure_arg->result = std::move(result_);
|
312
312
|
resolver_->combiner()->Run(
|
@@ -97,7 +97,8 @@ bool ParseUri(const grpc_uri* uri,
|
|
97
97
|
bool errors_found = false;
|
98
98
|
for (size_t i = 0; i < path_parts.count; i++) {
|
99
99
|
grpc_uri ith_uri = *uri;
|
100
|
-
UniquePtr<char> part_str(
|
100
|
+
grpc_core::UniquePtr<char> part_str(
|
101
|
+
grpc_slice_to_c_string(path_parts.slices[i]));
|
101
102
|
ith_uri.path = part_str.get();
|
102
103
|
grpc_resolved_address addr;
|
103
104
|
if (!parse(&ith_uri, &addr)) {
|
@@ -160,8 +161,9 @@ class UnixResolverFactory : public ResolverFactory {
|
|
160
161
|
return CreateSockaddrResolver(std::move(args), grpc_parse_unix);
|
161
162
|
}
|
162
163
|
|
163
|
-
UniquePtr<char> GetDefaultAuthority(
|
164
|
-
|
164
|
+
grpc_core::UniquePtr<char> GetDefaultAuthority(
|
165
|
+
grpc_uri* /*uri*/) const override {
|
166
|
+
return grpc_core::UniquePtr<char>(gpr_strdup("localhost"));
|
165
167
|
}
|
166
168
|
|
167
169
|
const char* scheme() const override { return "unix"; }
|
@@ -60,7 +60,7 @@ class XdsResolver : public Resolver {
|
|
60
60
|
RefCountedPtr<XdsResolver> resolver_;
|
61
61
|
};
|
62
62
|
|
63
|
-
UniquePtr<char> server_name_;
|
63
|
+
grpc_core::UniquePtr<char> server_name_;
|
64
64
|
const grpc_channel_args* args_;
|
65
65
|
grpc_pollset_set* interested_parties_;
|
66
66
|
OrphanablePtr<XdsClient> xds_client_;
|
@@ -41,7 +41,7 @@ struct ResolverArgs {
|
|
41
41
|
/// The combiner under which all resolver calls will be run.
|
42
42
|
Combiner* combiner = nullptr;
|
43
43
|
/// The result handler to be used by the resolver.
|
44
|
-
|
44
|
+
std::unique_ptr<Resolver::ResultHandler> result_handler;
|
45
45
|
};
|
46
46
|
|
47
47
|
class ResolverFactory {
|
@@ -55,10 +55,10 @@ class ResolverFactory {
|
|
55
55
|
|
56
56
|
/// Returns a string representing the default authority to use for this
|
57
57
|
/// scheme.
|
58
|
-
virtual UniquePtr<char> GetDefaultAuthority(grpc_uri* uri) const {
|
58
|
+
virtual grpc_core::UniquePtr<char> GetDefaultAuthority(grpc_uri* uri) const {
|
59
59
|
const char* path = uri->path;
|
60
60
|
if (path[0] == '/') ++path;
|
61
|
-
return UniquePtr<char>(gpr_strdup(path));
|
61
|
+
return grpc_core::UniquePtr<char>(gpr_strdup(path));
|
62
62
|
}
|
63
63
|
|
64
64
|
/// Returns the URI scheme that this factory implements.
|
@@ -40,7 +40,7 @@ class RegistryState {
|
|
40
40
|
default_prefix_.reset(gpr_strdup(default_resolver_prefix));
|
41
41
|
}
|
42
42
|
|
43
|
-
void RegisterResolverFactory(
|
43
|
+
void RegisterResolverFactory(std::unique_ptr<ResolverFactory> factory) {
|
44
44
|
for (size_t i = 0; i < factories_.size(); ++i) {
|
45
45
|
GPR_ASSERT(strcmp(factories_[i]->scheme(), factory->scheme()) != 0);
|
46
46
|
}
|
@@ -90,8 +90,8 @@ class RegistryState {
|
|
90
90
|
// more factories are needed and the additional allocations are
|
91
91
|
// hurting performance (which is unlikely, since these allocations
|
92
92
|
// only occur at gRPC initialization time).
|
93
|
-
InlinedVector<
|
94
|
-
UniquePtr<char> default_prefix_;
|
93
|
+
InlinedVector<std::unique_ptr<ResolverFactory>, 10> factories_;
|
94
|
+
grpc_core::UniquePtr<char> default_prefix_;
|
95
95
|
};
|
96
96
|
|
97
97
|
static RegistryState* g_state = nullptr;
|
@@ -103,11 +103,11 @@ static RegistryState* g_state = nullptr;
|
|
103
103
|
//
|
104
104
|
|
105
105
|
void ResolverRegistry::Builder::InitRegistry() {
|
106
|
-
if (g_state == nullptr) g_state =
|
106
|
+
if (g_state == nullptr) g_state = new RegistryState();
|
107
107
|
}
|
108
108
|
|
109
109
|
void ResolverRegistry::Builder::ShutdownRegistry() {
|
110
|
-
|
110
|
+
delete g_state;
|
111
111
|
g_state = nullptr;
|
112
112
|
}
|
113
113
|
|
@@ -118,7 +118,7 @@ void ResolverRegistry::Builder::SetDefaultPrefix(
|
|
118
118
|
}
|
119
119
|
|
120
120
|
void ResolverRegistry::Builder::RegisterResolverFactory(
|
121
|
-
|
121
|
+
std::unique_ptr<ResolverFactory> factory) {
|
122
122
|
InitRegistry();
|
123
123
|
g_state->RegisterResolverFactory(std::move(factory));
|
124
124
|
}
|
@@ -146,7 +146,7 @@ bool ResolverRegistry::IsValidTarget(const char* target) {
|
|
146
146
|
OrphanablePtr<Resolver> ResolverRegistry::CreateResolver(
|
147
147
|
const char* target, const grpc_channel_args* args,
|
148
148
|
grpc_pollset_set* pollset_set, Combiner* combiner,
|
149
|
-
|
149
|
+
std::unique_ptr<Resolver::ResultHandler> result_handler) {
|
150
150
|
GPR_ASSERT(g_state != nullptr);
|
151
151
|
grpc_uri* uri = nullptr;
|
152
152
|
char* canonical_target = nullptr;
|
@@ -166,27 +166,29 @@ OrphanablePtr<Resolver> ResolverRegistry::CreateResolver(
|
|
166
166
|
return resolver;
|
167
167
|
}
|
168
168
|
|
169
|
-
UniquePtr<char> ResolverRegistry::GetDefaultAuthority(
|
169
|
+
grpc_core::UniquePtr<char> ResolverRegistry::GetDefaultAuthority(
|
170
|
+
const char* target) {
|
170
171
|
GPR_ASSERT(g_state != nullptr);
|
171
172
|
grpc_uri* uri = nullptr;
|
172
173
|
char* canonical_target = nullptr;
|
173
174
|
ResolverFactory* factory =
|
174
175
|
g_state->FindResolverFactory(target, &uri, &canonical_target);
|
175
|
-
UniquePtr<char> authority =
|
176
|
+
grpc_core::UniquePtr<char> authority =
|
176
177
|
factory == nullptr ? nullptr : factory->GetDefaultAuthority(uri);
|
177
178
|
grpc_uri_destroy(uri);
|
178
179
|
gpr_free(canonical_target);
|
179
180
|
return authority;
|
180
181
|
}
|
181
182
|
|
182
|
-
UniquePtr<char> ResolverRegistry::AddDefaultPrefixIfNeeded(
|
183
|
+
grpc_core::UniquePtr<char> ResolverRegistry::AddDefaultPrefixIfNeeded(
|
184
|
+
const char* target) {
|
183
185
|
GPR_ASSERT(g_state != nullptr);
|
184
186
|
grpc_uri* uri = nullptr;
|
185
187
|
char* canonical_target = nullptr;
|
186
188
|
g_state->FindResolverFactory(target, &uri, &canonical_target);
|
187
189
|
grpc_uri_destroy(uri);
|
188
|
-
return UniquePtr<char>(
|
189
|
-
|
190
|
+
return grpc_core::UniquePtr<char>(
|
191
|
+
canonical_target == nullptr ? gpr_strdup(target) : canonical_target);
|
190
192
|
}
|
191
193
|
|
192
194
|
} // namespace grpc_core
|