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
@@ -36,13 +36,16 @@
|
|
36
36
|
#include "src/core/lib/slice/b64.h"
|
37
37
|
#include "src/core/lib/uri/uri_parser.h"
|
38
38
|
|
39
|
+
namespace grpc_core {
|
40
|
+
namespace {
|
41
|
+
|
39
42
|
/**
|
40
43
|
* Parses the 'https_proxy' env var (fallback on 'http_proxy') and returns the
|
41
44
|
* proxy hostname to resolve or nullptr on error. Also sets 'user_cred' to user
|
42
45
|
* credentials if present in the 'http_proxy' env var, otherwise leaves it
|
43
46
|
* unchanged. It is caller's responsibility to gpr_free user_cred.
|
44
47
|
*/
|
45
|
-
|
48
|
+
char* GetHttpProxyServer(char** user_cred) {
|
46
49
|
GPR_ASSERT(user_cred != nullptr);
|
47
50
|
char* proxy_name = nullptr;
|
48
51
|
char** authority_strs = nullptr;
|
@@ -89,127 +92,115 @@ done:
|
|
89
92
|
return proxy_name;
|
90
93
|
}
|
91
94
|
|
92
|
-
|
93
|
-
|
94
|
-
*
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
return false;
|
109
|
-
}
|
110
|
-
char* user_cred = nullptr;
|
111
|
-
*name_to_resolve = get_http_proxy_server(&user_cred);
|
112
|
-
if (*name_to_resolve == nullptr) return false;
|
113
|
-
char* no_proxy_str = nullptr;
|
114
|
-
grpc_uri* uri = grpc_uri_parse(server_uri, false /* suppress_errors */);
|
115
|
-
if (uri == nullptr || uri->path[0] == '\0') {
|
116
|
-
gpr_log(GPR_ERROR,
|
117
|
-
"'http_proxy' environment variable set, but cannot "
|
118
|
-
"parse server URI '%s' -- not using proxy",
|
119
|
-
server_uri);
|
120
|
-
goto no_use_proxy;
|
121
|
-
}
|
122
|
-
if (strcmp(uri->scheme, "unix") == 0) {
|
123
|
-
gpr_log(GPR_INFO, "not using proxy for Unix domain socket '%s'",
|
124
|
-
server_uri);
|
125
|
-
goto no_use_proxy;
|
126
|
-
}
|
127
|
-
/* Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. */
|
128
|
-
no_proxy_str = gpr_getenv("no_grpc_proxy");
|
129
|
-
if (no_proxy_str == nullptr) no_proxy_str = gpr_getenv("no_proxy");
|
130
|
-
if (no_proxy_str != nullptr) {
|
131
|
-
static const char* NO_PROXY_SEPARATOR = ",";
|
132
|
-
bool use_proxy = true;
|
133
|
-
grpc_core::UniquePtr<char> server_host;
|
134
|
-
grpc_core::UniquePtr<char> server_port;
|
135
|
-
if (!grpc_core::SplitHostPort(
|
136
|
-
uri->path[0] == '/' ? uri->path + 1 : uri->path, &server_host,
|
137
|
-
&server_port)) {
|
138
|
-
gpr_log(GPR_INFO,
|
139
|
-
"unable to split host and port, not checking no_proxy list for "
|
140
|
-
"host '%s'",
|
95
|
+
class HttpProxyMapper : public ProxyMapperInterface {
|
96
|
+
public:
|
97
|
+
bool MapName(const char* server_uri, const grpc_channel_args* args,
|
98
|
+
char** name_to_resolve, grpc_channel_args** new_args) override {
|
99
|
+
if (!grpc_channel_args_find_bool(args, GRPC_ARG_ENABLE_HTTP_PROXY, true)) {
|
100
|
+
return false;
|
101
|
+
}
|
102
|
+
char* user_cred = nullptr;
|
103
|
+
*name_to_resolve = GetHttpProxyServer(&user_cred);
|
104
|
+
if (*name_to_resolve == nullptr) return false;
|
105
|
+
char* no_proxy_str = nullptr;
|
106
|
+
grpc_uri* uri = grpc_uri_parse(server_uri, false /* suppress_errors */);
|
107
|
+
if (uri == nullptr || uri->path[0] == '\0') {
|
108
|
+
gpr_log(GPR_ERROR,
|
109
|
+
"'http_proxy' environment variable set, but cannot "
|
110
|
+
"parse server URI '%s' -- not using proxy",
|
141
111
|
server_uri);
|
142
|
-
|
143
|
-
}
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
112
|
+
goto no_use_proxy;
|
113
|
+
}
|
114
|
+
if (strcmp(uri->scheme, "unix") == 0) {
|
115
|
+
gpr_log(GPR_INFO, "not using proxy for Unix domain socket '%s'",
|
116
|
+
server_uri);
|
117
|
+
goto no_use_proxy;
|
118
|
+
}
|
119
|
+
/* Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. */
|
120
|
+
no_proxy_str = gpr_getenv("no_grpc_proxy");
|
121
|
+
if (no_proxy_str == nullptr) no_proxy_str = gpr_getenv("no_proxy");
|
122
|
+
if (no_proxy_str != nullptr) {
|
123
|
+
static const char* NO_PROXY_SEPARATOR = ",";
|
124
|
+
bool use_proxy = true;
|
125
|
+
grpc_core::UniquePtr<char> server_host;
|
126
|
+
grpc_core::UniquePtr<char> server_port;
|
127
|
+
if (!grpc_core::SplitHostPort(
|
128
|
+
uri->path[0] == '/' ? uri->path + 1 : uri->path, &server_host,
|
129
|
+
&server_port)) {
|
130
|
+
gpr_log(GPR_INFO,
|
131
|
+
"unable to split host and port, not checking no_proxy list for "
|
132
|
+
"host '%s'",
|
133
|
+
server_uri);
|
134
|
+
gpr_free(no_proxy_str);
|
135
|
+
} else {
|
136
|
+
size_t uri_len = strlen(server_host.get());
|
137
|
+
char** no_proxy_hosts;
|
138
|
+
size_t num_no_proxy_hosts;
|
139
|
+
gpr_string_split(no_proxy_str, NO_PROXY_SEPARATOR, &no_proxy_hosts,
|
140
|
+
&num_no_proxy_hosts);
|
141
|
+
for (size_t i = 0; i < num_no_proxy_hosts; i++) {
|
142
|
+
char* no_proxy_entry = no_proxy_hosts[i];
|
143
|
+
size_t no_proxy_len = strlen(no_proxy_entry);
|
144
|
+
if (no_proxy_len <= uri_len &&
|
145
|
+
gpr_stricmp(no_proxy_entry,
|
146
|
+
&(server_host.get()[uri_len - no_proxy_len])) == 0) {
|
147
|
+
gpr_log(GPR_INFO, "not using proxy for host in no_proxy list '%s'",
|
148
|
+
server_uri);
|
149
|
+
use_proxy = false;
|
150
|
+
break;
|
151
|
+
}
|
159
152
|
}
|
153
|
+
for (size_t i = 0; i < num_no_proxy_hosts; i++) {
|
154
|
+
gpr_free(no_proxy_hosts[i]);
|
155
|
+
}
|
156
|
+
gpr_free(no_proxy_hosts);
|
157
|
+
gpr_free(no_proxy_str);
|
158
|
+
if (!use_proxy) goto no_use_proxy;
|
160
159
|
}
|
161
|
-
for (size_t i = 0; i < num_no_proxy_hosts; i++) {
|
162
|
-
gpr_free(no_proxy_hosts[i]);
|
163
|
-
}
|
164
|
-
gpr_free(no_proxy_hosts);
|
165
|
-
gpr_free(no_proxy_str);
|
166
|
-
if (!use_proxy) goto no_use_proxy;
|
167
160
|
}
|
161
|
+
grpc_arg args_to_add[2];
|
162
|
+
args_to_add[0] = grpc_channel_arg_string_create(
|
163
|
+
(char*)GRPC_ARG_HTTP_CONNECT_SERVER,
|
164
|
+
uri->path[0] == '/' ? uri->path + 1 : uri->path);
|
165
|
+
if (user_cred != nullptr) {
|
166
|
+
/* Use base64 encoding for user credentials as stated in RFC 7617 */
|
167
|
+
char* encoded_user_cred =
|
168
|
+
grpc_base64_encode(user_cred, strlen(user_cred), 0, 0);
|
169
|
+
char* header;
|
170
|
+
gpr_asprintf(&header, "Proxy-Authorization:Basic %s", encoded_user_cred);
|
171
|
+
gpr_free(encoded_user_cred);
|
172
|
+
args_to_add[1] = grpc_channel_arg_string_create(
|
173
|
+
(char*)GRPC_ARG_HTTP_CONNECT_HEADERS, header);
|
174
|
+
*new_args = grpc_channel_args_copy_and_add(args, args_to_add, 2);
|
175
|
+
gpr_free(header);
|
176
|
+
} else {
|
177
|
+
*new_args = grpc_channel_args_copy_and_add(args, args_to_add, 1);
|
178
|
+
}
|
179
|
+
grpc_uri_destroy(uri);
|
180
|
+
gpr_free(user_cred);
|
181
|
+
return true;
|
182
|
+
no_use_proxy:
|
183
|
+
if (uri != nullptr) grpc_uri_destroy(uri);
|
184
|
+
gpr_free(*name_to_resolve);
|
185
|
+
*name_to_resolve = nullptr;
|
186
|
+
gpr_free(user_cred);
|
187
|
+
return false;
|
168
188
|
}
|
169
|
-
grpc_arg args_to_add[2];
|
170
|
-
args_to_add[0] = grpc_channel_arg_string_create(
|
171
|
-
(char*)GRPC_ARG_HTTP_CONNECT_SERVER,
|
172
|
-
uri->path[0] == '/' ? uri->path + 1 : uri->path);
|
173
|
-
if (user_cred != nullptr) {
|
174
|
-
/* Use base64 encoding for user credentials as stated in RFC 7617 */
|
175
|
-
char* encoded_user_cred =
|
176
|
-
grpc_base64_encode(user_cred, strlen(user_cred), 0, 0);
|
177
|
-
char* header;
|
178
|
-
gpr_asprintf(&header, "Proxy-Authorization:Basic %s", encoded_user_cred);
|
179
|
-
gpr_free(encoded_user_cred);
|
180
|
-
args_to_add[1] = grpc_channel_arg_string_create(
|
181
|
-
(char*)GRPC_ARG_HTTP_CONNECT_HEADERS, header);
|
182
|
-
*new_args = grpc_channel_args_copy_and_add(args, args_to_add, 2);
|
183
|
-
gpr_free(header);
|
184
|
-
} else {
|
185
|
-
*new_args = grpc_channel_args_copy_and_add(args, args_to_add, 1);
|
186
|
-
}
|
187
|
-
grpc_uri_destroy(uri);
|
188
|
-
gpr_free(user_cred);
|
189
|
-
return true;
|
190
|
-
no_use_proxy:
|
191
|
-
if (uri != nullptr) grpc_uri_destroy(uri);
|
192
|
-
gpr_free(*name_to_resolve);
|
193
|
-
*name_to_resolve = nullptr;
|
194
|
-
gpr_free(user_cred);
|
195
|
-
return false;
|
196
|
-
}
|
197
|
-
|
198
|
-
static bool proxy_mapper_map_address(grpc_proxy_mapper* mapper,
|
199
|
-
const grpc_resolved_address* address,
|
200
|
-
const grpc_channel_args* args,
|
201
|
-
grpc_resolved_address** new_address,
|
202
|
-
grpc_channel_args** new_args) {
|
203
|
-
return false;
|
204
|
-
}
|
205
|
-
|
206
|
-
static void proxy_mapper_destroy(grpc_proxy_mapper* mapper) {}
|
207
189
|
|
208
|
-
|
209
|
-
|
190
|
+
bool MapAddress(const grpc_resolved_address& address,
|
191
|
+
const grpc_channel_args* args,
|
192
|
+
grpc_resolved_address** new_address,
|
193
|
+
grpc_channel_args** new_args) override {
|
194
|
+
return false;
|
195
|
+
}
|
196
|
+
};
|
210
197
|
|
211
|
-
|
198
|
+
} // namespace
|
212
199
|
|
213
|
-
void
|
214
|
-
|
200
|
+
void RegisterHttpProxyMapper() {
|
201
|
+
ProxyMapperRegistry::Register(
|
202
|
+
true /* at_start */,
|
203
|
+
std::unique_ptr<ProxyMapperInterface>(new HttpProxyMapper()));
|
215
204
|
}
|
205
|
+
|
206
|
+
} // namespace grpc_core
|
@@ -19,6 +19,10 @@
|
|
19
19
|
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H
|
20
20
|
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H
|
21
21
|
|
22
|
-
|
22
|
+
namespace grpc_core {
|
23
|
+
|
24
|
+
void RegisterHttpProxyMapper();
|
25
|
+
|
26
|
+
} // namespace grpc_core
|
23
27
|
|
24
28
|
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H */
|
@@ -90,7 +90,7 @@ LoadBalancingPolicy::UpdateArgs& LoadBalancingPolicy::UpdateArgs::operator=(
|
|
90
90
|
//
|
91
91
|
|
92
92
|
LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick(
|
93
|
-
PickArgs args) {
|
93
|
+
PickArgs /*args*/) {
|
94
94
|
// We invoke the parent's ExitIdleLocked() via a closure instead
|
95
95
|
// of doing it directly here, for two reasons:
|
96
96
|
// 1. ExitIdleLocked() may cause the policy's state to change and
|
@@ -115,7 +115,7 @@ LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick(
|
|
115
115
|
}
|
116
116
|
|
117
117
|
void LoadBalancingPolicy::QueuePicker::CallExitIdle(void* arg,
|
118
|
-
grpc_error* error) {
|
118
|
+
grpc_error* /*error*/) {
|
119
119
|
LoadBalancingPolicy* parent = static_cast<LoadBalancingPolicy*>(arg);
|
120
120
|
parent->ExitIdleLocked();
|
121
121
|
parent->Unref();
|
@@ -126,7 +126,7 @@ void LoadBalancingPolicy::QueuePicker::CallExitIdle(void* arg,
|
|
126
126
|
//
|
127
127
|
|
128
128
|
LoadBalancingPolicy::PickResult
|
129
|
-
LoadBalancingPolicy::TransientFailurePicker::Pick(PickArgs args) {
|
129
|
+
LoadBalancingPolicy::TransientFailurePicker::Pick(PickArgs /*args*/) {
|
130
130
|
PickResult result;
|
131
131
|
result.type = PickResult::PICK_FAILED;
|
132
132
|
result.error = GRPC_ERROR_REF(error_);
|
@@ -21,6 +21,7 @@
|
|
21
21
|
|
22
22
|
#include <grpc/support/port_platform.h>
|
23
23
|
|
24
|
+
#include <functional>
|
24
25
|
#include <iterator>
|
25
26
|
|
26
27
|
#include "src/core/ext/filters/client_channel/server_address.h"
|
@@ -92,11 +93,11 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
|
|
92
93
|
/// Application-specific requests cost metrics. Metric names are
|
93
94
|
/// determined by the application. Each value is an absolute cost
|
94
95
|
/// (e.g. 3487 bytes of storage) associated with the request.
|
95
|
-
|
96
|
+
std::map<StringView, double, StringLess> request_cost;
|
96
97
|
/// Application-specific resource utilization metrics. Metric names
|
97
98
|
/// are determined by the application. Each value is expressed as a
|
98
99
|
/// fraction of total resources available.
|
99
|
-
|
100
|
+
std::map<StringView, double, StringLess> utilization;
|
100
101
|
};
|
101
102
|
|
102
103
|
/// Interface for accessing per-call state.
|
@@ -268,7 +269,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
|
|
268
269
|
/// Sets the connectivity state and returns a new picker to be used
|
269
270
|
/// by the client channel.
|
270
271
|
virtual void UpdateState(grpc_connectivity_state state,
|
271
|
-
|
272
|
+
std::unique_ptr<SubchannelPicker>) = 0;
|
272
273
|
|
273
274
|
/// Requests that the resolver re-resolve.
|
274
275
|
virtual void RequestReresolution() = 0;
|
@@ -317,9 +318,12 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
|
|
317
318
|
/// Channel control helper.
|
318
319
|
/// Note: LB policies MUST NOT call any method on the helper from
|
319
320
|
/// their constructor.
|
320
|
-
|
321
|
+
std::unique_ptr<ChannelControlHelper> channel_control_helper;
|
321
322
|
/// Channel args.
|
322
323
|
// TODO(roth): Find a better channel args representation for this API.
|
324
|
+
// TODO(roth): Clarify ownership semantics here -- currently, this
|
325
|
+
// does not take ownership of args, which is the opposite of how we
|
326
|
+
// handle them in UpdateArgs.
|
323
327
|
const grpc_channel_args* args = nullptr;
|
324
328
|
};
|
325
329
|
|
@@ -400,7 +404,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
|
|
400
404
|
/// Owned pointer to interested parties in load balancing decisions.
|
401
405
|
grpc_pollset_set* interested_parties_;
|
402
406
|
/// Channel control helper.
|
403
|
-
|
407
|
+
std::unique_ptr<ChannelControlHelper> channel_control_helper_;
|
404
408
|
};
|
405
409
|
|
406
410
|
} // namespace grpc_core
|
@@ -30,12 +30,12 @@
|
|
30
30
|
#include "src/core/lib/iomgr/error.h"
|
31
31
|
#include "src/core/lib/profiling/timers.h"
|
32
32
|
|
33
|
-
static grpc_error* clr_init_channel_elem(grpc_channel_element* elem
|
34
|
-
grpc_channel_element_args* args) {
|
33
|
+
static grpc_error* clr_init_channel_elem(grpc_channel_element* /*elem*/,
|
34
|
+
grpc_channel_element_args* /*args*/) {
|
35
35
|
return GRPC_ERROR_NONE;
|
36
36
|
}
|
37
37
|
|
38
|
-
static void clr_destroy_channel_elem(grpc_channel_element* elem) {}
|
38
|
+
static void clr_destroy_channel_elem(grpc_channel_element* /*elem*/) {}
|
39
39
|
|
40
40
|
namespace {
|
41
41
|
|
@@ -59,7 +59,8 @@ static void on_complete_for_send(void* arg, grpc_error* error) {
|
|
59
59
|
if (error == GRPC_ERROR_NONE) {
|
60
60
|
calld->send_initial_metadata_succeeded = true;
|
61
61
|
}
|
62
|
-
|
62
|
+
grpc_core::Closure::Run(DEBUG_LOCATION, calld->original_on_complete_for_send,
|
63
|
+
GRPC_ERROR_REF(error));
|
63
64
|
}
|
64
65
|
|
65
66
|
static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
|
@@ -67,8 +68,9 @@ static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
|
|
67
68
|
if (error == GRPC_ERROR_NONE) {
|
68
69
|
calld->recv_initial_metadata_succeeded = true;
|
69
70
|
}
|
70
|
-
|
71
|
-
|
71
|
+
grpc_core::Closure::Run(DEBUG_LOCATION,
|
72
|
+
calld->original_recv_initial_metadata_ready,
|
73
|
+
GRPC_ERROR_REF(error));
|
72
74
|
}
|
73
75
|
|
74
76
|
static grpc_error* clr_init_call_elem(grpc_call_element* elem,
|
@@ -79,8 +81,8 @@ static grpc_error* clr_init_call_elem(grpc_call_element* elem,
|
|
79
81
|
}
|
80
82
|
|
81
83
|
static void clr_destroy_call_elem(grpc_call_element* elem,
|
82
|
-
const grpc_call_final_info* final_info
|
83
|
-
grpc_closure* ignored) {
|
84
|
+
const grpc_call_final_info* /*final_info*/,
|
85
|
+
grpc_closure* /*ignored*/) {
|
84
86
|
call_data* calld = static_cast<call_data*>(elem->call_data);
|
85
87
|
if (calld->client_stats != nullptr) {
|
86
88
|
// Record call finished, optionally setting client_failed_to_send and
|
@@ -237,7 +237,7 @@ class GrpcLb : public LoadBalancingPolicy {
|
|
237
237
|
const grpc_grpclb_serverlist* serverlist() const { return serverlist_; }
|
238
238
|
|
239
239
|
// Returns a text representation suitable for logging.
|
240
|
-
UniquePtr<char> AsText() const;
|
240
|
+
grpc_core::UniquePtr<char> AsText() const;
|
241
241
|
|
242
242
|
// Extracts all non-drop entries into a ServerAddressList.
|
243
243
|
ServerAddressList GetServerAddressList(
|
@@ -268,7 +268,7 @@ class GrpcLb : public LoadBalancingPolicy {
|
|
268
268
|
class Picker : public SubchannelPicker {
|
269
269
|
public:
|
270
270
|
Picker(GrpcLb* parent, RefCountedPtr<Serverlist> serverlist,
|
271
|
-
|
271
|
+
std::unique_ptr<SubchannelPicker> child_picker,
|
272
272
|
RefCountedPtr<GrpcLbClientStats> client_stats)
|
273
273
|
: parent_(parent),
|
274
274
|
serverlist_(std::move(serverlist)),
|
@@ -285,7 +285,7 @@ class GrpcLb : public LoadBalancingPolicy {
|
|
285
285
|
// Serverlist to be used for determining drops.
|
286
286
|
RefCountedPtr<Serverlist> serverlist_;
|
287
287
|
|
288
|
-
|
288
|
+
std::unique_ptr<SubchannelPicker> child_picker_;
|
289
289
|
RefCountedPtr<GrpcLbClientStats> client_stats_;
|
290
290
|
};
|
291
291
|
|
@@ -297,7 +297,7 @@ class GrpcLb : public LoadBalancingPolicy {
|
|
297
297
|
RefCountedPtr<SubchannelInterface> CreateSubchannel(
|
298
298
|
const grpc_channel_args& args) override;
|
299
299
|
void UpdateState(grpc_connectivity_state state,
|
300
|
-
|
300
|
+
std::unique_ptr<SubchannelPicker> picker) override;
|
301
301
|
void RequestReresolution() override;
|
302
302
|
void AddTraceEvent(TraceSeverity severity, StringView message) override;
|
303
303
|
|
@@ -430,7 +430,7 @@ void ParseServer(const grpc_grpclb_server* server,
|
|
430
430
|
}
|
431
431
|
}
|
432
432
|
|
433
|
-
UniquePtr<char> GrpcLb::Serverlist::AsText() const {
|
433
|
+
grpc_core::UniquePtr<char> GrpcLb::Serverlist::AsText() const {
|
434
434
|
gpr_strvec entries;
|
435
435
|
gpr_strvec_init(&entries);
|
436
436
|
for (size_t i = 0; i < serverlist_->num_servers; ++i) {
|
@@ -449,7 +449,7 @@ UniquePtr<char> GrpcLb::Serverlist::AsText() const {
|
|
449
449
|
gpr_free(ipport);
|
450
450
|
gpr_strvec_add(&entries, entry);
|
451
451
|
}
|
452
|
-
UniquePtr<char> result(gpr_strvec_flatten(&entries, nullptr));
|
452
|
+
grpc_core::UniquePtr<char> result(gpr_strvec_flatten(&entries, nullptr));
|
453
453
|
gpr_strvec_destroy(&entries);
|
454
454
|
return result;
|
455
455
|
}
|
@@ -468,7 +468,7 @@ void client_stats_destroy(void* p) {
|
|
468
468
|
GrpcLbClientStats* client_stats = static_cast<GrpcLbClientStats*>(p);
|
469
469
|
client_stats->Unref();
|
470
470
|
}
|
471
|
-
int equal_cmp(void* p1
|
471
|
+
int equal_cmp(void* /*p1*/, void* /*p2*/) {
|
472
472
|
// Always indicate a match, since we don't want this channel arg to
|
473
473
|
// affect the subchannel's key in the index.
|
474
474
|
// TODO(roth): Is this right? This does prevent us from needlessly
|
@@ -479,8 +479,7 @@ int equal_cmp(void* p1, void* p2) {
|
|
479
479
|
// token or client stats. A better approach might be to find somewhere
|
480
480
|
// other than the subchannel args to store the LB token and client
|
481
481
|
// stats. They could be stored in a map and then looked up for each
|
482
|
-
// call
|
483
|
-
// performant enough). Or we could do something more complicated whereby
|
482
|
+
// call. Or we could do something more complicated whereby
|
484
483
|
// we create our own subchannel wrapper to store them, although that would
|
485
484
|
// involve a lot of refcounting overhead.
|
486
485
|
// Given that we're trying to move from grpclb to xds at this point,
|
@@ -658,7 +657,7 @@ RefCountedPtr<SubchannelInterface> GrpcLb::Helper::CreateSubchannel(
|
|
658
657
|
}
|
659
658
|
|
660
659
|
void GrpcLb::Helper::UpdateState(grpc_connectivity_state state,
|
661
|
-
|
660
|
+
std::unique_ptr<SubchannelPicker> picker) {
|
662
661
|
if (parent_->shutting_down_) return;
|
663
662
|
// If this request is from the pending child policy, ignore it until
|
664
663
|
// it reports READY, at which point we swap it into place.
|
@@ -1025,8 +1024,8 @@ void GrpcLb::BalancerCallState::OnInitialRequestSent(void* arg,
|
|
1025
1024
|
GRPC_ERROR_REF(error));
|
1026
1025
|
}
|
1027
1026
|
|
1028
|
-
void GrpcLb::BalancerCallState::OnInitialRequestSentLocked(
|
1029
|
-
|
1027
|
+
void GrpcLb::BalancerCallState::OnInitialRequestSentLocked(
|
1028
|
+
void* arg, grpc_error* /*error*/) {
|
1030
1029
|
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
|
1031
1030
|
grpc_byte_buffer_destroy(lb_calld->send_message_payload_);
|
1032
1031
|
lb_calld->send_message_payload_ = nullptr;
|
@@ -1050,7 +1049,7 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceived(void* arg,
|
|
1050
1049
|
}
|
1051
1050
|
|
1052
1051
|
void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked(
|
1053
|
-
void* arg, grpc_error* error) {
|
1052
|
+
void* arg, grpc_error* /*error*/) {
|
1054
1053
|
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
|
1055
1054
|
GrpcLb* grpclb_policy = lb_calld->grpclb_policy();
|
1056
1055
|
// Null payload means the LB call was cancelled.
|
@@ -1100,7 +1099,7 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked(
|
|
1100
1099
|
GPR_ASSERT(lb_calld->lb_call_ != nullptr);
|
1101
1100
|
auto serverlist_wrapper = MakeRefCounted<Serverlist>(serverlist);
|
1102
1101
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
|
1103
|
-
UniquePtr<char> serverlist_text = serverlist_wrapper->AsText();
|
1102
|
+
grpc_core::UniquePtr<char> serverlist_text = serverlist_wrapper->AsText();
|
1104
1103
|
gpr_log(GPR_INFO,
|
1105
1104
|
"[grpclb %p] lb_calld=%p: Serverlist with %" PRIuPTR
|
1106
1105
|
" servers received:\n%s",
|
@@ -1547,7 +1546,7 @@ void GrpcLb::OnBalancerChannelConnectivityChanged(void* arg,
|
|
1547
1546
|
}
|
1548
1547
|
|
1549
1548
|
void GrpcLb::OnBalancerChannelConnectivityChangedLocked(void* arg,
|
1550
|
-
grpc_error* error) {
|
1549
|
+
grpc_error* /*error*/) {
|
1551
1550
|
GrpcLb* self = static_cast<GrpcLb*>(arg);
|
1552
1551
|
if (!self->shutting_down_ && self->fallback_at_startup_checks_pending_) {
|
1553
1552
|
if (self->lb_channel_connectivity_ != GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
@@ -1725,12 +1724,12 @@ grpc_channel_args* GrpcLb::CreateChildPolicyArgsLocked(
|
|
1725
1724
|
|
1726
1725
|
OrphanablePtr<LoadBalancingPolicy> GrpcLb::CreateChildPolicyLocked(
|
1727
1726
|
const char* name, const grpc_channel_args* args) {
|
1728
|
-
Helper* helper =
|
1727
|
+
Helper* helper = new Helper(Ref());
|
1729
1728
|
LoadBalancingPolicy::Args lb_policy_args;
|
1730
1729
|
lb_policy_args.combiner = combiner();
|
1731
1730
|
lb_policy_args.args = args;
|
1732
1731
|
lb_policy_args.channel_control_helper =
|
1733
|
-
|
1732
|
+
std::unique_ptr<ChannelControlHelper>(helper);
|
1734
1733
|
OrphanablePtr<LoadBalancingPolicy> lb_policy =
|
1735
1734
|
LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
|
1736
1735
|
name, std::move(lb_policy_args));
|
@@ -1884,7 +1883,7 @@ class GrpcLbFactory : public LoadBalancingPolicyFactory {
|
|
1884
1883
|
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
|
1885
1884
|
if (json == nullptr) {
|
1886
1885
|
return RefCountedPtr<LoadBalancingPolicy::Config>(
|
1887
|
-
|
1886
|
+
new ParsedGrpcLbConfig(nullptr));
|
1888
1887
|
}
|
1889
1888
|
InlinedVector<grpc_error*, 2> error_list;
|
1890
1889
|
RefCountedPtr<LoadBalancingPolicy::Config> child_policy;
|
@@ -1906,7 +1905,7 @@ class GrpcLbFactory : public LoadBalancingPolicyFactory {
|
|
1906
1905
|
}
|
1907
1906
|
if (error_list.empty()) {
|
1908
1907
|
return RefCountedPtr<LoadBalancingPolicy::Config>(
|
1909
|
-
|
1908
|
+
new ParsedGrpcLbConfig(std::move(child_policy)));
|
1910
1909
|
} else {
|
1911
1910
|
*error = GRPC_ERROR_CREATE_FROM_VECTOR("GrpcLb Parser", &error_list);
|
1912
1911
|
return nullptr;
|