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
@@ -25,6 +25,7 @@
|
|
25
25
|
#include "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h"
|
26
26
|
|
27
27
|
#define GRPC_ALTS_TRANSPORT_SECURITY_TYPE "alts"
|
28
|
+
#define GRPC_ALTS_URL_SCHEME "https"
|
28
29
|
|
29
30
|
/**
|
30
31
|
* This method creates an ALTS channel security connector.
|
@@ -57,6 +58,10 @@ grpc_core::RefCountedPtr<grpc_server_security_connector>
|
|
57
58
|
grpc_alts_server_security_connector_create(
|
58
59
|
grpc_core::RefCountedPtr<grpc_server_credentials> server_creds);
|
59
60
|
|
61
|
+
/* Initializes rpc_versions. */
|
62
|
+
void grpc_alts_set_rpc_protocol_versions(
|
63
|
+
grpc_gcp_rpc_protocol_versions* rpc_versions);
|
64
|
+
|
60
65
|
namespace grpc_core {
|
61
66
|
namespace internal {
|
62
67
|
|
@@ -97,16 +97,16 @@ class grpc_fake_channel_security_connector final
|
|
97
97
|
}
|
98
98
|
|
99
99
|
void add_handshakers(const grpc_channel_args* args,
|
100
|
-
grpc_pollset_set* interested_parties
|
100
|
+
grpc_pollset_set* /*interested_parties*/,
|
101
101
|
grpc_core::HandshakeManager* handshake_mgr) override {
|
102
102
|
handshake_mgr->Add(grpc_core::SecurityHandshakerCreate(
|
103
103
|
tsi_create_fake_handshaker(/*is_client=*/true), this, args));
|
104
104
|
}
|
105
105
|
|
106
106
|
bool check_call_host(grpc_core::StringView host,
|
107
|
-
grpc_auth_context* auth_context
|
108
|
-
grpc_closure* on_call_host_checked
|
109
|
-
grpc_error** error) override {
|
107
|
+
grpc_auth_context* /*auth_context*/,
|
108
|
+
grpc_closure* /*on_call_host_checked*/,
|
109
|
+
grpc_error** /*error*/) override {
|
110
110
|
grpc_core::StringView authority_hostname;
|
111
111
|
grpc_core::StringView authority_ignored_port;
|
112
112
|
grpc_core::StringView target_hostname;
|
@@ -135,7 +135,7 @@ class grpc_fake_channel_security_connector final
|
|
135
135
|
return true;
|
136
136
|
}
|
137
137
|
|
138
|
-
void cancel_check_call_host(grpc_closure* on_call_host_checked
|
138
|
+
void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
|
139
139
|
grpc_error* error) override {
|
140
140
|
GRPC_ERROR_UNREF(error);
|
141
141
|
}
|
@@ -213,7 +213,7 @@ class grpc_fake_channel_security_connector final
|
|
213
213
|
};
|
214
214
|
|
215
215
|
static void fake_check_peer(
|
216
|
-
grpc_security_connector* sc
|
216
|
+
grpc_security_connector* /*sc*/, tsi_peer peer,
|
217
217
|
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
|
218
218
|
grpc_closure* on_peer_checked) {
|
219
219
|
const char* prop_name;
|
@@ -245,12 +245,12 @@ static void fake_check_peer(
|
|
245
245
|
auth_context->get(), GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
|
246
246
|
GRPC_FAKE_TRANSPORT_SECURITY_TYPE);
|
247
247
|
end:
|
248
|
-
|
248
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
|
249
249
|
tsi_peer_destruct(&peer);
|
250
250
|
}
|
251
251
|
|
252
252
|
void grpc_fake_channel_security_connector::check_peer(
|
253
|
-
tsi_peer peer, grpc_endpoint* ep
|
253
|
+
tsi_peer peer, grpc_endpoint* /*ep*/,
|
254
254
|
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
|
255
255
|
grpc_closure* on_peer_checked) {
|
256
256
|
fake_check_peer(this, peer, auth_context, on_peer_checked);
|
@@ -266,14 +266,14 @@ class grpc_fake_server_security_connector
|
|
266
266
|
std::move(server_creds)) {}
|
267
267
|
~grpc_fake_server_security_connector() override = default;
|
268
268
|
|
269
|
-
void check_peer(tsi_peer peer, grpc_endpoint* ep
|
269
|
+
void check_peer(tsi_peer peer, grpc_endpoint* /*ep*/,
|
270
270
|
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
|
271
271
|
grpc_closure* on_peer_checked) override {
|
272
272
|
fake_check_peer(this, peer, auth_context, on_peer_checked);
|
273
273
|
}
|
274
274
|
|
275
275
|
void add_handshakers(const grpc_channel_args* args,
|
276
|
-
grpc_pollset_set* interested_parties
|
276
|
+
grpc_pollset_set* /*interested_parties*/,
|
277
277
|
grpc_core::HandshakeManager* handshake_mgr) override {
|
278
278
|
handshake_mgr->Add(grpc_core::SecurityHandshakerCreate(
|
279
279
|
tsi_create_fake_handshaker(/*=is_client*/ false), this, args));
|
@@ -144,7 +144,8 @@ grpc_slice CreateRootCertsBundle(const char* certs_directory) {
|
|
144
144
|
grpc_slice LoadSystemRootCerts() {
|
145
145
|
grpc_slice result = grpc_empty_slice();
|
146
146
|
// Prioritize user-specified custom directory if flag is set.
|
147
|
-
UniquePtr<char> custom_dir =
|
147
|
+
grpc_core::UniquePtr<char> custom_dir =
|
148
|
+
GPR_GLOBAL_CONFIG_GET(grpc_system_ssl_roots_dir);
|
148
149
|
if (strlen(custom_dir.get()) > 0) {
|
149
150
|
result = CreateRootCertsBundle(custom_dir.get());
|
150
151
|
}
|
@@ -58,7 +58,7 @@ grpc_core::RefCountedPtr<grpc_auth_context> local_auth_context_create() {
|
|
58
58
|
return ctx;
|
59
59
|
}
|
60
60
|
|
61
|
-
void local_check_peer(grpc_security_connector* sc
|
61
|
+
void local_check_peer(grpc_security_connector* /*sc*/, tsi_peer /*peer*/,
|
62
62
|
grpc_endpoint* ep,
|
63
63
|
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
|
64
64
|
grpc_closure* on_peer_checked,
|
@@ -100,7 +100,7 @@ void local_check_peer(grpc_security_connector* sc, tsi_peer peer,
|
|
100
100
|
if (!is_endpoint_local) {
|
101
101
|
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
102
102
|
"Endpoint is neither UDS or TCP loopback address.");
|
103
|
-
|
103
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
|
104
104
|
return;
|
105
105
|
}
|
106
106
|
/* Create an auth context which is necessary to pass the santiy check in
|
@@ -112,7 +112,7 @@ void local_check_peer(grpc_security_connector* sc, tsi_peer peer,
|
|
112
112
|
error = *auth_context != nullptr ? GRPC_ERROR_NONE
|
113
113
|
: GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
114
114
|
"Could not create local auth context");
|
115
|
-
|
115
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
|
116
116
|
}
|
117
117
|
|
118
118
|
class grpc_local_channel_security_connector final
|
@@ -129,7 +129,7 @@ class grpc_local_channel_security_connector final
|
|
129
129
|
~grpc_local_channel_security_connector() override { gpr_free(target_name_); }
|
130
130
|
|
131
131
|
void add_handshakers(
|
132
|
-
const grpc_channel_args* args, grpc_pollset_set* interested_parties
|
132
|
+
const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
|
133
133
|
grpc_core::HandshakeManager* handshake_manager) override {
|
134
134
|
tsi_handshaker* handshaker = nullptr;
|
135
135
|
GPR_ASSERT(local_tsi_handshaker_create(true /* is_client */, &handshaker) ==
|
@@ -157,8 +157,8 @@ class grpc_local_channel_security_connector final
|
|
157
157
|
}
|
158
158
|
|
159
159
|
bool check_call_host(grpc_core::StringView host,
|
160
|
-
grpc_auth_context* auth_context
|
161
|
-
grpc_closure* on_call_host_checked
|
160
|
+
grpc_auth_context* /*auth_context*/,
|
161
|
+
grpc_closure* /*on_call_host_checked*/,
|
162
162
|
grpc_error** error) override {
|
163
163
|
if (host.empty() || host != target_name_) {
|
164
164
|
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
@@ -167,7 +167,7 @@ class grpc_local_channel_security_connector final
|
|
167
167
|
return true;
|
168
168
|
}
|
169
169
|
|
170
|
-
void cancel_check_call_host(grpc_closure* on_call_host_checked
|
170
|
+
void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
|
171
171
|
grpc_error* error) override {
|
172
172
|
GRPC_ERROR_UNREF(error);
|
173
173
|
}
|
@@ -187,7 +187,7 @@ class grpc_local_server_security_connector final
|
|
187
187
|
~grpc_local_server_security_connector() override = default;
|
188
188
|
|
189
189
|
void add_handshakers(
|
190
|
-
const grpc_channel_args* args, grpc_pollset_set* interested_parties
|
190
|
+
const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
|
191
191
|
grpc_core::HandshakeManager* handshake_manager) override {
|
192
192
|
tsi_handshaker* handshaker = nullptr;
|
193
193
|
GPR_ASSERT(local_tsi_handshaker_create(false /* is_client */,
|
@@ -138,7 +138,7 @@ class grpc_channel_security_connector : public grpc_security_connector {
|
|
138
138
|
private:
|
139
139
|
grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds_;
|
140
140
|
grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds_;
|
141
|
-
|
141
|
+
std::unique_ptr<grpc_channel_args> channel_args_;
|
142
142
|
};
|
143
143
|
|
144
144
|
/* --- server_security_connector object. ---
|
@@ -79,7 +79,7 @@ class grpc_ssl_channel_security_connector final
|
|
79
79
|
grpc_core::StringView host;
|
80
80
|
grpc_core::StringView port;
|
81
81
|
grpc_core::SplitHostPort(target_name, &host, &port);
|
82
|
-
target_name_ = host
|
82
|
+
target_name_ = grpc_core::StringViewToCString(host);
|
83
83
|
}
|
84
84
|
|
85
85
|
~grpc_ssl_channel_security_connector() override {
|
@@ -118,7 +118,7 @@ class grpc_ssl_channel_security_connector final
|
|
118
118
|
}
|
119
119
|
|
120
120
|
void add_handshakers(const grpc_channel_args* args,
|
121
|
-
grpc_pollset_set* interested_parties
|
121
|
+
grpc_pollset_set* /*interested_parties*/,
|
122
122
|
grpc_core::HandshakeManager* handshake_mgr) override {
|
123
123
|
// Instantiate TSI handshaker.
|
124
124
|
tsi_handshaker* tsi_hs = nullptr;
|
@@ -136,7 +136,7 @@ class grpc_ssl_channel_security_connector final
|
|
136
136
|
handshake_mgr->Add(grpc_core::SecurityHandshakerCreate(tsi_hs, this, args));
|
137
137
|
}
|
138
138
|
|
139
|
-
void check_peer(tsi_peer peer, grpc_endpoint* ep
|
139
|
+
void check_peer(tsi_peer peer, grpc_endpoint* /*ep*/,
|
140
140
|
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
|
141
141
|
grpc_closure* on_peer_checked) override {
|
142
142
|
const char* target_name = overridden_target_name_ != nullptr
|
@@ -167,7 +167,7 @@ class grpc_ssl_channel_security_connector final
|
|
167
167
|
}
|
168
168
|
}
|
169
169
|
}
|
170
|
-
|
170
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
|
171
171
|
tsi_peer_destruct(&peer);
|
172
172
|
}
|
173
173
|
|
@@ -188,7 +188,7 @@ class grpc_ssl_channel_security_connector final
|
|
188
188
|
|
189
189
|
bool check_call_host(grpc_core::StringView host,
|
190
190
|
grpc_auth_context* auth_context,
|
191
|
-
grpc_closure* on_call_host_checked
|
191
|
+
grpc_closure* /*on_call_host_checked*/,
|
192
192
|
grpc_error** error) override {
|
193
193
|
grpc_security_status status = GRPC_SECURITY_ERROR;
|
194
194
|
tsi_peer peer = grpc_shallow_peer_from_ssl_auth_context(auth_context);
|
@@ -207,7 +207,7 @@ class grpc_ssl_channel_security_connector final
|
|
207
207
|
return true;
|
208
208
|
}
|
209
209
|
|
210
|
-
void cancel_check_call_host(grpc_closure* on_call_host_checked
|
210
|
+
void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
|
211
211
|
grpc_error* error) override {
|
212
212
|
GRPC_ERROR_UNREF(error);
|
213
213
|
}
|
@@ -281,7 +281,7 @@ class grpc_ssl_server_security_connector
|
|
281
281
|
}
|
282
282
|
|
283
283
|
void add_handshakers(const grpc_channel_args* args,
|
284
|
-
grpc_pollset_set* interested_parties
|
284
|
+
grpc_pollset_set* /*interested_parties*/,
|
285
285
|
grpc_core::HandshakeManager* handshake_mgr) override {
|
286
286
|
// Instantiate TSI handshaker.
|
287
287
|
try_fetch_ssl_server_credentials();
|
@@ -297,12 +297,12 @@ class grpc_ssl_server_security_connector
|
|
297
297
|
handshake_mgr->Add(grpc_core::SecurityHandshakerCreate(tsi_hs, this, args));
|
298
298
|
}
|
299
299
|
|
300
|
-
void check_peer(tsi_peer peer, grpc_endpoint* ep
|
300
|
+
void check_peer(tsi_peer peer, grpc_endpoint* /*ep*/,
|
301
301
|
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
|
302
302
|
grpc_closure* on_peer_checked) override {
|
303
303
|
grpc_error* error = ssl_check_peer(nullptr, &peer, auth_context);
|
304
304
|
tsi_peer_destruct(&peer);
|
305
|
-
|
305
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
|
306
306
|
}
|
307
307
|
|
308
308
|
int cmp(const grpc_security_connector* other) const override {
|
@@ -143,7 +143,7 @@ bool grpc_ssl_check_call_host(grpc_core::StringView host,
|
|
143
143
|
grpc_core::StringView target_name,
|
144
144
|
grpc_core::StringView overridden_target_name,
|
145
145
|
grpc_auth_context* auth_context,
|
146
|
-
grpc_closure* on_call_host_checked
|
146
|
+
grpc_closure* /*on_call_host_checked*/,
|
147
147
|
grpc_error** error) {
|
148
148
|
grpc_security_status status = GRPC_SECURITY_ERROR;
|
149
149
|
tsi_peer peer = grpc_shallow_peer_from_ssl_auth_context(auth_context);
|
@@ -189,9 +189,10 @@ int grpc_ssl_cmp_target_name(
|
|
189
189
|
grpc_core::StringView target_name, grpc_core::StringView other_target_name,
|
190
190
|
grpc_core::StringView overridden_target_name,
|
191
191
|
grpc_core::StringView other_overridden_target_name) {
|
192
|
-
int c = target_name
|
192
|
+
int c = grpc_core::StringViewCmp(target_name, other_target_name);
|
193
193
|
if (c != 0) return c;
|
194
|
-
return overridden_target_name
|
194
|
+
return grpc_core::StringViewCmp(overridden_target_name,
|
195
|
+
other_overridden_target_name);
|
195
196
|
}
|
196
197
|
|
197
198
|
grpc_core::RefCountedPtr<grpc_auth_context> grpc_ssl_peer_to_auth_context(
|
@@ -422,7 +423,7 @@ grpc_slice DefaultSslRootStore::ComputePemRootCerts() {
|
|
422
423
|
const bool not_use_system_roots =
|
423
424
|
GPR_GLOBAL_CONFIG_GET(grpc_not_use_system_ssl_roots);
|
424
425
|
// First try to load the roots from the configuration.
|
425
|
-
UniquePtr<char> default_root_certs_path =
|
426
|
+
grpc_core::UniquePtr<char> default_root_certs_path =
|
426
427
|
GPR_GLOBAL_CONFIG_GET(grpc_default_ssl_roots_file_path);
|
427
428
|
if (strlen(default_root_certs_path.get()) > 0) {
|
428
429
|
GRPC_LOG_IF_ERROR(
|
@@ -80,8 +80,7 @@ grpc_status_code TlsFetchKeyMaterials(
|
|
80
80
|
grpc_status_code status = GRPC_STATUS_OK;
|
81
81
|
/* Use credential reload config to fetch credentials. */
|
82
82
|
if (options.credential_reload_config() != nullptr) {
|
83
|
-
grpc_tls_credential_reload_arg* arg =
|
84
|
-
grpc_core::New<grpc_tls_credential_reload_arg>();
|
83
|
+
grpc_tls_credential_reload_arg* arg = new grpc_tls_credential_reload_arg();
|
85
84
|
arg->key_materials_config = key_materials_config.get();
|
86
85
|
int result = options.credential_reload_config()->Schedule(arg);
|
87
86
|
if (result) {
|
@@ -107,7 +106,7 @@ grpc_status_code TlsFetchKeyMaterials(
|
|
107
106
|
if (arg->destroy_context != nullptr) {
|
108
107
|
arg->destroy_context(arg->context);
|
109
108
|
}
|
110
|
-
|
109
|
+
delete arg;
|
111
110
|
}
|
112
111
|
return status;
|
113
112
|
}
|
@@ -127,7 +126,7 @@ SpiffeChannelSecurityConnector::SpiffeChannelSecurityConnector(
|
|
127
126
|
grpc_core::StringView host;
|
128
127
|
grpc_core::StringView port;
|
129
128
|
grpc_core::SplitHostPort(target_name, &host, &port);
|
130
|
-
target_name_ = host
|
129
|
+
target_name_ = grpc_core::StringViewToCString(host);
|
131
130
|
}
|
132
131
|
|
133
132
|
SpiffeChannelSecurityConnector::~SpiffeChannelSecurityConnector() {
|
@@ -141,7 +140,7 @@ SpiffeChannelSecurityConnector::~SpiffeChannelSecurityConnector() {
|
|
141
140
|
}
|
142
141
|
|
143
142
|
void SpiffeChannelSecurityConnector::add_handshakers(
|
144
|
-
const grpc_channel_args* args, grpc_pollset_set* interested_parties
|
143
|
+
const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
|
145
144
|
grpc_core::HandshakeManager* handshake_mgr) {
|
146
145
|
if (RefreshHandshakerFactory() != GRPC_SECURITY_OK) {
|
147
146
|
gpr_log(GPR_ERROR, "Handshaker factory refresh failed.");
|
@@ -164,7 +163,7 @@ void SpiffeChannelSecurityConnector::add_handshakers(
|
|
164
163
|
}
|
165
164
|
|
166
165
|
void SpiffeChannelSecurityConnector::check_peer(
|
167
|
-
tsi_peer peer, grpc_endpoint* ep
|
166
|
+
tsi_peer peer, grpc_endpoint* /*ep*/,
|
168
167
|
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
|
169
168
|
grpc_closure* on_peer_checked) {
|
170
169
|
const char* target_name = overridden_target_name_ != nullptr
|
@@ -172,7 +171,7 @@ void SpiffeChannelSecurityConnector::check_peer(
|
|
172
171
|
: target_name_.get();
|
173
172
|
grpc_error* error = grpc_ssl_check_alpn(&peer);
|
174
173
|
if (error != GRPC_ERROR_NONE) {
|
175
|
-
|
174
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
|
176
175
|
tsi_peer_destruct(&peer);
|
177
176
|
return;
|
178
177
|
}
|
@@ -213,7 +212,7 @@ void SpiffeChannelSecurityConnector::check_peer(
|
|
213
212
|
error = ProcessServerAuthorizationCheckResult(check_arg_);
|
214
213
|
}
|
215
214
|
}
|
216
|
-
|
215
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
|
217
216
|
tsi_peer_destruct(&peer);
|
218
217
|
}
|
219
218
|
|
@@ -239,7 +238,7 @@ bool SpiffeChannelSecurityConnector::check_call_host(
|
|
239
238
|
}
|
240
239
|
|
241
240
|
void SpiffeChannelSecurityConnector::cancel_check_call_host(
|
242
|
-
grpc_closure* on_call_host_checked
|
241
|
+
grpc_closure* /*on_call_host_checked*/, grpc_error* error) {
|
243
242
|
GRPC_ERROR_UNREF(error);
|
244
243
|
}
|
245
244
|
|
@@ -342,7 +341,7 @@ void SpiffeChannelSecurityConnector::ServerAuthorizationCheckDone(
|
|
342
341
|
grpc_error* error = ProcessServerAuthorizationCheckResult(arg);
|
343
342
|
SpiffeChannelSecurityConnector* connector =
|
344
343
|
static_cast<SpiffeChannelSecurityConnector*>(arg->cb_user_data);
|
345
|
-
|
344
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, connector->on_peer_checked_, error);
|
346
345
|
}
|
347
346
|
|
348
347
|
grpc_error*
|
@@ -381,7 +380,7 @@ grpc_tls_server_authorization_check_arg*
|
|
381
380
|
SpiffeChannelSecurityConnector::ServerAuthorizationCheckArgCreate(
|
382
381
|
void* user_data) {
|
383
382
|
grpc_tls_server_authorization_check_arg* arg =
|
384
|
-
|
383
|
+
new grpc_tls_server_authorization_check_arg();
|
385
384
|
arg->cb = ServerAuthorizationCheckDone;
|
386
385
|
arg->cb_user_data = user_data;
|
387
386
|
arg->status = GRPC_STATUS_OK;
|
@@ -399,7 +398,7 @@ void SpiffeChannelSecurityConnector::ServerAuthorizationCheckArgDestroy(
|
|
399
398
|
if (arg->destroy_context != nullptr) {
|
400
399
|
arg->destroy_context(arg->context);
|
401
400
|
}
|
402
|
-
|
401
|
+
delete arg;
|
403
402
|
}
|
404
403
|
|
405
404
|
SpiffeServerSecurityConnector::SpiffeServerSecurityConnector(
|
@@ -419,7 +418,7 @@ SpiffeServerSecurityConnector::~SpiffeServerSecurityConnector() {
|
|
419
418
|
}
|
420
419
|
|
421
420
|
void SpiffeServerSecurityConnector::add_handshakers(
|
422
|
-
const grpc_channel_args* args, grpc_pollset_set* interested_parties
|
421
|
+
const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
|
423
422
|
grpc_core::HandshakeManager* handshake_mgr) {
|
424
423
|
/* Refresh handshaker factory if needed. */
|
425
424
|
if (RefreshHandshakerFactory() != GRPC_SECURITY_OK) {
|
@@ -439,14 +438,14 @@ void SpiffeServerSecurityConnector::add_handshakers(
|
|
439
438
|
}
|
440
439
|
|
441
440
|
void SpiffeServerSecurityConnector::check_peer(
|
442
|
-
tsi_peer peer, grpc_endpoint* ep
|
441
|
+
tsi_peer peer, grpc_endpoint* /*ep*/,
|
443
442
|
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
|
444
443
|
grpc_closure* on_peer_checked) {
|
445
444
|
grpc_error* error = grpc_ssl_check_alpn(&peer);
|
446
445
|
*auth_context = grpc_ssl_peer_to_auth_context(
|
447
446
|
&peer, GRPC_TLS_SPIFFE_TRANSPORT_SECURITY_TYPE);
|
448
447
|
tsi_peer_destruct(&peer);
|
449
|
-
|
448
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
|
450
449
|
}
|
451
450
|
|
452
451
|
int SpiffeServerSecurityConnector::cmp(
|
@@ -346,7 +346,8 @@ static void client_auth_start_transport_stream_op_batch(
|
|
346
346
|
GRPC_CALL_STACK_REF(calld->owning_call, "check_call_host");
|
347
347
|
GRPC_CLOSURE_INIT(&calld->async_result_closure, on_host_checked, batch,
|
348
348
|
grpc_schedule_on_exec_ctx);
|
349
|
-
grpc_core::StringView call_host(
|
349
|
+
grpc_core::StringView call_host(
|
350
|
+
grpc_core::StringViewFromSlice(calld->host));
|
350
351
|
grpc_error* error = GRPC_ERROR_NONE;
|
351
352
|
if (chand->security_connector->check_call_host(
|
352
353
|
call_host, chand->auth_context.get(),
|
@@ -383,8 +384,8 @@ static void client_auth_set_pollset_or_pollset_set(
|
|
383
384
|
|
384
385
|
/* Destructor for call_data */
|
385
386
|
static void client_auth_destroy_call_elem(
|
386
|
-
grpc_call_element* elem, const grpc_call_final_info* final_info
|
387
|
-
grpc_closure* ignored) {
|
387
|
+
grpc_call_element* elem, const grpc_call_final_info* /*final_info*/,
|
388
|
+
grpc_closure* /*ignored*/) {
|
388
389
|
call_data* calld = static_cast<call_data*>(elem->call_data);
|
389
390
|
calld->destroy();
|
390
391
|
}
|
@@ -104,7 +104,7 @@ struct secure_endpoint {
|
|
104
104
|
|
105
105
|
grpc_core::TraceFlag grpc_trace_secure_endpoint(false, "secure_endpoint");
|
106
106
|
|
107
|
-
static void destroy(secure_endpoint* ep) {
|
107
|
+
static void destroy(secure_endpoint* ep) { delete ep; }
|
108
108
|
|
109
109
|
#ifndef NDEBUG
|
110
110
|
#define SECURE_ENDPOINT_UNREF(ep, reason) \
|
@@ -165,7 +165,7 @@ static void call_read_cb(secure_endpoint* ep, grpc_error* error) {
|
|
165
165
|
}
|
166
166
|
}
|
167
167
|
ep->read_buffer = nullptr;
|
168
|
-
|
168
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, ep->read_cb, error);
|
169
169
|
SECURE_ENDPOINT_UNREF(ep, "read");
|
170
170
|
}
|
171
171
|
|
@@ -363,9 +363,10 @@ static void endpoint_write(grpc_endpoint* secure_ep, grpc_slice_buffer* slices,
|
|
363
363
|
if (result != TSI_OK) {
|
364
364
|
/* TODO(yangg) do different things according to the error type? */
|
365
365
|
grpc_slice_buffer_reset_and_unref_internal(&ep->output_buffer);
|
366
|
-
|
367
|
-
cb,
|
368
|
-
|
366
|
+
grpc_core::ExecCtx::Run(
|
367
|
+
DEBUG_LOCATION, cb,
|
368
|
+
grpc_set_tsi_error_result(
|
369
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Wrap failed"), result));
|
369
370
|
return;
|
370
371
|
}
|
371
372
|
|
@@ -438,8 +439,8 @@ grpc_endpoint* grpc_secure_endpoint_create(
|
|
438
439
|
struct tsi_zero_copy_grpc_protector* zero_copy_protector,
|
439
440
|
grpc_endpoint* transport, grpc_slice* leftover_slices,
|
440
441
|
size_t leftover_nslices) {
|
441
|
-
secure_endpoint* ep =
|
442
|
-
&vtable, protector, zero_copy_protector, transport,
|
443
|
-
|
442
|
+
secure_endpoint* ep =
|
443
|
+
new secure_endpoint(&vtable, protector, zero_copy_protector, transport,
|
444
|
+
leftover_slices, leftover_nslices);
|
444
445
|
return &ep->base;
|
445
446
|
}
|