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
data/src/core/lib/iomgr/port.h
CHANGED
@@ -134,6 +134,7 @@
|
|
134
134
|
#define GRPC_POSIX_SOCKET_EV_EPOLL1 1
|
135
135
|
#define GRPC_POSIX_SOCKET_EV_EPOLLEX 1
|
136
136
|
#define GRPC_POSIX_SOCKET_EV_POLL 1
|
137
|
+
#define GRPC_POSIX_SOCKET_IF_NAMETOINDEX 1
|
137
138
|
#define GRPC_POSIX_SOCKET_RESOLVE_ADDRESS 1
|
138
139
|
#define GRPC_POSIX_SOCKET_SOCKADDR 1
|
139
140
|
#define GRPC_POSIX_SOCKET_SOCKET_FACTORY 1
|
@@ -141,6 +142,7 @@
|
|
141
142
|
#define GRPC_POSIX_SOCKET_TCP_CLIENT 1
|
142
143
|
#define GRPC_POSIX_SOCKET_TCP_SERVER 1
|
143
144
|
#define GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON 1
|
145
|
+
#define GRPC_POSIX_SOCKET_UDP_SERVER 1
|
144
146
|
#define GRPC_POSIX_SOCKET_UTILS_COMMON 1
|
145
147
|
#else
|
146
148
|
#define GRPC_POSIX_SOCKET 1
|
@@ -227,6 +229,7 @@
|
|
227
229
|
#define GRPC_POSIX_SOCKET_TCP_CLIENT 1
|
228
230
|
#define GRPC_POSIX_SOCKET_TCP_SERVER 1
|
229
231
|
#define GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON 1
|
232
|
+
#define GRPC_POSIX_SOCKET_UDP_SERVER 1
|
230
233
|
#define GRPC_POSIX_SOCKET_UTILS_COMMON 1
|
231
234
|
#endif
|
232
235
|
|
@@ -79,7 +79,7 @@ void grpc_custom_resolve_callback(grpc_custom_resolver* r,
|
|
79
79
|
return;
|
80
80
|
}
|
81
81
|
if (r->on_done) {
|
82
|
-
|
82
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done, error);
|
83
83
|
}
|
84
84
|
gpr_free(r->host);
|
85
85
|
gpr_free(r->port);
|
@@ -92,7 +92,7 @@ static grpc_error* try_split_host_port(const char* name,
|
|
92
92
|
grpc_core::UniquePtr<char>* port) {
|
93
93
|
/* parse name, splitting it into host and port parts */
|
94
94
|
grpc_error* error;
|
95
|
-
SplitHostPort(name, host, port);
|
95
|
+
grpc_core::SplitHostPort(name, host, port);
|
96
96
|
if (*host == nullptr) {
|
97
97
|
char* msg;
|
98
98
|
gpr_asprintf(&msg, "unparseable host:port: '%s'", name);
|
@@ -151,7 +151,7 @@ static grpc_error* blocking_resolve_address_impl(
|
|
151
151
|
}
|
152
152
|
|
153
153
|
static void resolve_address_impl(const char* name, const char* default_port,
|
154
|
-
grpc_pollset_set* interested_parties
|
154
|
+
grpc_pollset_set* /*interested_parties*/,
|
155
155
|
grpc_closure* on_done,
|
156
156
|
grpc_resolved_addresses** addrs) {
|
157
157
|
grpc_custom_resolver* r = nullptr;
|
@@ -161,7 +161,7 @@ static void resolve_address_impl(const char* name, const char* default_port,
|
|
161
161
|
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
|
162
162
|
err = try_split_host_port(name, default_port, &host, &port);
|
163
163
|
if (err != GRPC_ERROR_NONE) {
|
164
|
-
|
164
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, err);
|
165
165
|
return;
|
166
166
|
}
|
167
167
|
r = (grpc_custom_resolver*)gpr_malloc(sizeof(grpc_custom_resolver));
|
@@ -150,29 +150,28 @@ typedef struct {
|
|
150
150
|
|
151
151
|
/* Callback to be passed to grpc Executor to asynch-ify
|
152
152
|
* grpc_blocking_resolve_address */
|
153
|
-
static void do_request_thread(void* rp, grpc_error* error) {
|
153
|
+
static void do_request_thread(void* rp, grpc_error* /*error*/) {
|
154
154
|
request* r = static_cast<request*>(rp);
|
155
|
-
|
156
|
-
|
155
|
+
grpc_core::ExecCtx::Run(
|
156
|
+
DEBUG_LOCATION, r->on_done,
|
157
|
+
grpc_blocking_resolve_address(r->name, r->default_port, r->addrs_out));
|
157
158
|
gpr_free(r->name);
|
158
159
|
gpr_free(r->default_port);
|
159
160
|
gpr_free(r);
|
160
161
|
}
|
161
162
|
|
162
163
|
static void posix_resolve_address(const char* name, const char* default_port,
|
163
|
-
grpc_pollset_set* interested_parties
|
164
|
+
grpc_pollset_set* /*interested_parties*/,
|
164
165
|
grpc_closure* on_done,
|
165
166
|
grpc_resolved_addresses** addrs) {
|
166
167
|
request* r = static_cast<request*>(gpr_malloc(sizeof(request)));
|
167
|
-
GRPC_CLOSURE_INIT(
|
168
|
-
&r->request_closure, do_request_thread, r,
|
169
|
-
grpc_core::Executor::Scheduler(grpc_core::ExecutorType::RESOLVER,
|
170
|
-
grpc_core::ExecutorJobType::SHORT));
|
168
|
+
GRPC_CLOSURE_INIT(&r->request_closure, do_request_thread, r, nullptr);
|
171
169
|
r->name = gpr_strdup(name);
|
172
170
|
r->default_port = gpr_strdup(default_port);
|
173
171
|
r->on_done = on_done;
|
174
172
|
r->addrs_out = addrs;
|
175
|
-
|
173
|
+
grpc_core::Executor::Run(&r->request_closure, GRPC_ERROR_NONE,
|
174
|
+
grpc_core::ExecutorType::RESOLVER);
|
176
175
|
}
|
177
176
|
|
178
177
|
grpc_address_resolver_vtable grpc_posix_resolver_vtable = {
|
@@ -138,7 +138,7 @@ static void do_request_thread(void* rp, grpc_error* error) {
|
|
138
138
|
} else {
|
139
139
|
GRPC_ERROR_REF(error);
|
140
140
|
}
|
141
|
-
|
141
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done, error);
|
142
142
|
gpr_free(r->name);
|
143
143
|
gpr_free(r->default_port);
|
144
144
|
gpr_free(r);
|
@@ -149,15 +149,13 @@ static void windows_resolve_address(const char* name, const char* default_port,
|
|
149
149
|
grpc_closure* on_done,
|
150
150
|
grpc_resolved_addresses** addresses) {
|
151
151
|
request* r = (request*)gpr_malloc(sizeof(request));
|
152
|
-
GRPC_CLOSURE_INIT(
|
153
|
-
&r->request_closure, do_request_thread, r,
|
154
|
-
grpc_core::Executor::Scheduler(grpc_core::ExecutorType::RESOLVER,
|
155
|
-
grpc_core::ExecutorJobType::SHORT));
|
152
|
+
GRPC_CLOSURE_INIT(&r->request_closure, do_request_thread, r, nullptr);
|
156
153
|
r->name = gpr_strdup(name);
|
157
154
|
r->default_port = gpr_strdup(default_port);
|
158
155
|
r->on_done = on_done;
|
159
156
|
r->addresses = addresses;
|
160
|
-
|
157
|
+
grpc_core::Executor::Run(&r->request_closure, GRPC_ERROR_NONE,
|
158
|
+
grpc_core::ExecutorType::RESOLVER);
|
161
159
|
}
|
162
160
|
|
163
161
|
grpc_address_resolver_vtable grpc_windows_resolver_vtable = {
|
@@ -274,7 +274,7 @@ static bool rq_reclaim_from_per_user_free_pool(
|
|
274
274
|
grpc_resource_quota* resource_quota);
|
275
275
|
static bool rq_reclaim(grpc_resource_quota* resource_quota, bool destructive);
|
276
276
|
|
277
|
-
static void rq_step(void* rq, grpc_error* error) {
|
277
|
+
static void rq_step(void* rq, grpc_error* /*error*/) {
|
278
278
|
grpc_resource_quota* resource_quota = static_cast<grpc_resource_quota*>(rq);
|
279
279
|
resource_quota->step_scheduled = false;
|
280
280
|
do {
|
@@ -333,7 +333,7 @@ static bool rq_alloc(grpc_resource_quota* resource_quota) {
|
|
333
333
|
int64_t aborted_allocations = resource_user->outstanding_allocations;
|
334
334
|
resource_user->outstanding_allocations = 0;
|
335
335
|
resource_user->free_pool += aborted_allocations;
|
336
|
-
|
336
|
+
grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &resource_user->on_allocated);
|
337
337
|
gpr_mu_unlock(&resource_user->mu);
|
338
338
|
ru_unref_by(resource_user, static_cast<gpr_atm>(aborted_allocations));
|
339
339
|
continue;
|
@@ -359,7 +359,7 @@ static bool rq_alloc(grpc_resource_quota* resource_quota) {
|
|
359
359
|
if (resource_user->free_pool >= 0) {
|
360
360
|
resource_user->allocating = false;
|
361
361
|
resource_user->outstanding_allocations = 0;
|
362
|
-
|
362
|
+
grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &resource_user->on_allocated);
|
363
363
|
gpr_mu_unlock(&resource_user->mu);
|
364
364
|
} else {
|
365
365
|
rulist_add_head(resource_user, GRPC_RULIST_AWAITING_ALLOCATION);
|
@@ -424,7 +424,7 @@ static bool rq_reclaim(grpc_resource_quota* resource_quota, bool destructive) {
|
|
424
424
|
resource_quota->debug_only_last_reclaimer_resource_user = resource_user;
|
425
425
|
resource_quota->debug_only_last_initiated_reclaimer = c;
|
426
426
|
resource_user->reclaimers[destructive] = nullptr;
|
427
|
-
|
427
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, c, GRPC_ERROR_NONE);
|
428
428
|
return true;
|
429
429
|
}
|
430
430
|
|
@@ -479,7 +479,7 @@ static grpc_slice ru_slice_create(grpc_resource_user* resource_user,
|
|
479
479
|
* the combiner
|
480
480
|
*/
|
481
481
|
|
482
|
-
static void ru_allocate(void* ru, grpc_error* error) {
|
482
|
+
static void ru_allocate(void* ru, grpc_error* /*error*/) {
|
483
483
|
grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
|
484
484
|
if (rulist_empty(resource_user->resource_quota,
|
485
485
|
GRPC_RULIST_AWAITING_ALLOCATION)) {
|
@@ -488,7 +488,7 @@ static void ru_allocate(void* ru, grpc_error* error) {
|
|
488
488
|
rulist_add_tail(resource_user, GRPC_RULIST_AWAITING_ALLOCATION);
|
489
489
|
}
|
490
490
|
|
491
|
-
static void ru_add_to_free_pool(void* ru, grpc_error* error) {
|
491
|
+
static void ru_add_to_free_pool(void* ru, grpc_error* /*error*/) {
|
492
492
|
grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
|
493
493
|
if (!rulist_empty(resource_user->resource_quota,
|
494
494
|
GRPC_RULIST_AWAITING_ALLOCATION) &&
|
@@ -506,14 +506,14 @@ static bool ru_post_reclaimer(grpc_resource_user* resource_user,
|
|
506
506
|
resource_user->new_reclaimers[destructive] = nullptr;
|
507
507
|
GPR_ASSERT(resource_user->reclaimers[destructive] == nullptr);
|
508
508
|
if (gpr_atm_acq_load(&resource_user->shutdown) > 0) {
|
509
|
-
|
509
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_CANCELLED);
|
510
510
|
return false;
|
511
511
|
}
|
512
512
|
resource_user->reclaimers[destructive] = closure;
|
513
513
|
return true;
|
514
514
|
}
|
515
515
|
|
516
|
-
static void ru_post_benign_reclaimer(void* ru, grpc_error* error) {
|
516
|
+
static void ru_post_benign_reclaimer(void* ru, grpc_error* /*error*/) {
|
517
517
|
grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
|
518
518
|
if (!ru_post_reclaimer(resource_user, false)) return;
|
519
519
|
if (!rulist_empty(resource_user->resource_quota,
|
@@ -527,7 +527,7 @@ static void ru_post_benign_reclaimer(void* ru, grpc_error* error) {
|
|
527
527
|
rulist_add_tail(resource_user, GRPC_RULIST_RECLAIMER_BENIGN);
|
528
528
|
}
|
529
529
|
|
530
|
-
static void ru_post_destructive_reclaimer(void* ru, grpc_error* error) {
|
530
|
+
static void ru_post_destructive_reclaimer(void* ru, grpc_error* /*error*/) {
|
531
531
|
grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
|
532
532
|
if (!ru_post_reclaimer(resource_user, true)) return;
|
533
533
|
if (!rulist_empty(resource_user->resource_quota,
|
@@ -543,14 +543,16 @@ static void ru_post_destructive_reclaimer(void* ru, grpc_error* error) {
|
|
543
543
|
rulist_add_tail(resource_user, GRPC_RULIST_RECLAIMER_DESTRUCTIVE);
|
544
544
|
}
|
545
545
|
|
546
|
-
static void ru_shutdown(void* ru, grpc_error* error) {
|
546
|
+
static void ru_shutdown(void* ru, grpc_error* /*error*/) {
|
547
547
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
|
548
548
|
gpr_log(GPR_INFO, "RU shutdown %p", ru);
|
549
549
|
}
|
550
550
|
grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
|
551
551
|
gpr_mu_lock(&resource_user->mu);
|
552
|
-
|
553
|
-
|
552
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, resource_user->reclaimers[0],
|
553
|
+
GRPC_ERROR_CANCELLED);
|
554
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, resource_user->reclaimers[1],
|
555
|
+
GRPC_ERROR_CANCELLED);
|
554
556
|
resource_user->reclaimers[0] = nullptr;
|
555
557
|
resource_user->reclaimers[1] = nullptr;
|
556
558
|
rulist_remove(resource_user, GRPC_RULIST_RECLAIMER_BENIGN);
|
@@ -561,7 +563,7 @@ static void ru_shutdown(void* ru, grpc_error* error) {
|
|
561
563
|
gpr_mu_unlock(&resource_user->mu);
|
562
564
|
}
|
563
565
|
|
564
|
-
static void ru_destroy(void* ru, grpc_error* error) {
|
566
|
+
static void ru_destroy(void* ru, grpc_error* /*error*/) {
|
565
567
|
grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
|
566
568
|
GPR_ASSERT(gpr_atm_no_barrier_load(&resource_user->refs) == 0);
|
567
569
|
// Free all the remaining thread quota
|
@@ -572,8 +574,10 @@ static void ru_destroy(void* ru, grpc_error* error) {
|
|
572
574
|
for (int i = 0; i < GRPC_RULIST_COUNT; i++) {
|
573
575
|
rulist_remove(resource_user, static_cast<grpc_rulist>(i));
|
574
576
|
}
|
575
|
-
|
576
|
-
|
577
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, resource_user->reclaimers[0],
|
578
|
+
GRPC_ERROR_CANCELLED);
|
579
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, resource_user->reclaimers[1],
|
580
|
+
GRPC_ERROR_CANCELLED);
|
577
581
|
if (resource_user->free_pool != 0) {
|
578
582
|
resource_user->resource_quota->free_pool += resource_user->free_pool;
|
579
583
|
rq_step_sched(resource_user->resource_quota);
|
@@ -597,7 +601,8 @@ static void ru_allocated_slices(void* arg, grpc_error* error) {
|
|
597
601
|
grpc_resource_user_slice_allocator* slice_allocator =
|
598
602
|
static_cast<grpc_resource_user_slice_allocator*>(arg);
|
599
603
|
if (error == GRPC_ERROR_NONE) ru_alloc_slices(slice_allocator);
|
600
|
-
|
604
|
+
grpc_core::Closure::Run(DEBUG_LOCATION, &slice_allocator->on_done,
|
605
|
+
GRPC_ERROR_REF(error));
|
601
606
|
}
|
602
607
|
|
603
608
|
/*******************************************************************************
|
@@ -611,7 +616,7 @@ typedef struct {
|
|
611
616
|
grpc_closure closure;
|
612
617
|
} rq_resize_args;
|
613
618
|
|
614
|
-
static void rq_resize(void* args, grpc_error* error) {
|
619
|
+
static void rq_resize(void* args, grpc_error* /*error*/) {
|
615
620
|
rq_resize_args* a = static_cast<rq_resize_args*>(args);
|
616
621
|
int64_t delta = a->size - a->resource_quota->size;
|
617
622
|
a->resource_quota->size += delta;
|
@@ -622,7 +627,7 @@ static void rq_resize(void* args, grpc_error* error) {
|
|
622
627
|
gpr_free(a);
|
623
628
|
}
|
624
629
|
|
625
|
-
static void rq_reclamation_done(void* rq, grpc_error* error) {
|
630
|
+
static void rq_reclamation_done(void* rq, grpc_error* /*error*/) {
|
626
631
|
grpc_resource_quota* resource_quota = static_cast<grpc_resource_quota*>(rq);
|
627
632
|
resource_quota->reclaiming = false;
|
628
633
|
rq_step_sched(resource_quota);
|
@@ -719,7 +724,7 @@ void grpc_resource_quota_resize(grpc_resource_quota* resource_quota,
|
|
719
724
|
gpr_atm_no_barrier_store(&resource_quota->last_size,
|
720
725
|
(gpr_atm)GPR_MIN((size_t)GPR_ATM_MAX, size));
|
721
726
|
GRPC_CLOSURE_INIT(&a->closure, rq_resize, a, grpc_schedule_on_exec_ctx);
|
722
|
-
|
727
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &a->closure, GRPC_ERROR_NONE);
|
723
728
|
}
|
724
729
|
|
725
730
|
size_t grpc_resource_quota_peek_size(grpc_resource_quota* resource_quota) {
|
@@ -994,8 +999,8 @@ bool grpc_resource_user_alloc_slices(
|
|
994
999
|
size_t count, grpc_slice_buffer* dest) {
|
995
1000
|
if (GPR_UNLIKELY(
|
996
1001
|
gpr_atm_no_barrier_load(&slice_allocator->resource_user->shutdown))) {
|
997
|
-
|
998
|
-
&slice_allocator->on_allocated,
|
1002
|
+
grpc_core::ExecCtx::Run(
|
1003
|
+
DEBUG_LOCATION, &slice_allocator->on_allocated,
|
999
1004
|
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource user shutdown"));
|
1000
1005
|
return false;
|
1001
1006
|
}
|
@@ -84,11 +84,16 @@ grpc_error* grpc_set_socket_no_sigpipe_if_possible(int fd) {
|
|
84
84
|
if ((newval != 0) != (val != 0)) {
|
85
85
|
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to set SO_NOSIGPIPE");
|
86
86
|
}
|
87
|
+
#else
|
88
|
+
// Avoid unused parameter warning for conditional parameter
|
89
|
+
(void)fd;
|
87
90
|
#endif
|
88
91
|
return GRPC_ERROR_NONE;
|
89
92
|
}
|
90
93
|
|
91
94
|
grpc_error* grpc_set_socket_ip_pktinfo_if_possible(int fd) {
|
95
|
+
// Use conditionally-important parameter to avoid warning
|
96
|
+
(void)fd;
|
92
97
|
#ifdef GRPC_HAVE_IP_PKTINFO
|
93
98
|
int get_local_ip = 1;
|
94
99
|
if (0 != setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &get_local_ip,
|
@@ -100,6 +105,8 @@ grpc_error* grpc_set_socket_ip_pktinfo_if_possible(int fd) {
|
|
100
105
|
}
|
101
106
|
|
102
107
|
grpc_error* grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd) {
|
108
|
+
// Use conditionally-important parameter to avoid warning
|
109
|
+
(void)fd;
|
103
110
|
#ifdef GRPC_HAVE_IPV6_RECVPKTINFO
|
104
111
|
int get_local_ip = 1;
|
105
112
|
if (0 != setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &get_local_ip,
|
@@ -256,6 +263,10 @@ void config_default_tcp_user_timeout(bool enable, int timeout, bool is_client) {
|
|
256
263
|
/* Set TCP_USER_TIMEOUT */
|
257
264
|
grpc_error* grpc_set_socket_tcp_user_timeout(
|
258
265
|
int fd, const grpc_channel_args* channel_args, bool is_client) {
|
266
|
+
// Use conditionally-important parameter to avoid warning
|
267
|
+
(void)fd;
|
268
|
+
(void)channel_args;
|
269
|
+
(void)is_client;
|
259
270
|
#ifdef GRPC_HAVE_TCP_USER_TIMEOUT
|
260
271
|
bool enable;
|
261
272
|
int timeout;
|
@@ -124,7 +124,7 @@ static void socket_notify_on_iocp(grpc_winsocket* socket, grpc_closure* closure,
|
|
124
124
|
gpr_mu_lock(&socket->state_mu);
|
125
125
|
if (info->has_pending_iocp) {
|
126
126
|
info->has_pending_iocp = 0;
|
127
|
-
|
127
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
|
128
128
|
} else {
|
129
129
|
info->closure = closure;
|
130
130
|
}
|
@@ -145,7 +145,7 @@ void grpc_socket_become_ready(grpc_winsocket* socket,
|
|
145
145
|
GPR_ASSERT(!info->has_pending_iocp);
|
146
146
|
gpr_mu_lock(&socket->state_mu);
|
147
147
|
if (info->closure) {
|
148
|
-
|
148
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, info->closure, GRPC_ERROR_NONE);
|
149
149
|
info->closure = NULL;
|
150
150
|
} else {
|
151
151
|
info->has_pending_iocp = 1;
|
@@ -96,7 +96,7 @@ static void OnAlarm(void* arg, grpc_error* error) {
|
|
96
96
|
} else {
|
97
97
|
grpc_error* error =
|
98
98
|
GRPC_ERROR_CREATE_FROM_STATIC_STRING("connect() timed out");
|
99
|
-
|
99
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
|
100
100
|
}
|
101
101
|
}
|
102
102
|
|
@@ -137,7 +137,7 @@ static void OnOpen(void* arg, grpc_error* error) {
|
|
137
137
|
GRPC_ERROR_REF(error);
|
138
138
|
}
|
139
139
|
gpr_mu_unlock(&connect->mu);
|
140
|
-
|
140
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
|
141
141
|
}
|
142
142
|
}
|
143
143
|
|
@@ -58,7 +58,7 @@ static void custom_tcp_connect_cleanup(grpc_custom_tcp_connect* connect) {
|
|
58
58
|
}
|
59
59
|
}
|
60
60
|
|
61
|
-
static void custom_close_callback(grpc_custom_socket* socket) {}
|
61
|
+
static void custom_close_callback(grpc_custom_socket* /*socket*/) {}
|
62
62
|
|
63
63
|
static void on_alarm(void* acp, grpc_error* error) {
|
64
64
|
int done;
|
@@ -96,7 +96,7 @@ static void custom_connect_callback_internal(grpc_custom_socket* socket,
|
|
96
96
|
grpc_core::ExecCtx::Get()->Flush();
|
97
97
|
custom_tcp_connect_cleanup(connect);
|
98
98
|
}
|
99
|
-
|
99
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
|
100
100
|
}
|
101
101
|
|
102
102
|
static void custom_connect_callback(grpc_custom_socket* socket,
|
@@ -241,7 +241,7 @@ finish:
|
|
241
241
|
grpc_channel_args_destroy(ac->channel_args);
|
242
242
|
gpr_free(ac);
|
243
243
|
}
|
244
|
-
|
244
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
|
245
245
|
}
|
246
246
|
|
247
247
|
grpc_error* grpc_tcp_client_prepare_fd(const grpc_channel_args* channel_args,
|
@@ -298,12 +298,13 @@ void grpc_tcp_client_create_from_prepared_fd(
|
|
298
298
|
char* addr_str = grpc_sockaddr_to_uri(addr);
|
299
299
|
*ep = grpc_tcp_client_create_from_fd(fdobj, channel_args, addr_str);
|
300
300
|
gpr_free(addr_str);
|
301
|
-
|
301
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
|
302
302
|
return;
|
303
303
|
}
|
304
304
|
if (errno != EWOULDBLOCK && errno != EINPROGRESS) {
|
305
305
|
grpc_fd_orphan(fdobj, nullptr, nullptr, "tcp_client_connect_error");
|
306
|
-
|
306
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure,
|
307
|
+
GRPC_OS_ERROR(errno, "connect"));
|
307
308
|
return;
|
308
309
|
}
|
309
310
|
|
@@ -344,7 +345,7 @@ static void tcp_connect(grpc_closure* closure, grpc_endpoint** ep,
|
|
344
345
|
*ep = nullptr;
|
345
346
|
if ((error = grpc_tcp_client_prepare_fd(channel_args, addr, &mapped_addr,
|
346
347
|
&fdobj)) != GRPC_ERROR_NONE) {
|
347
|
-
|
348
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
|
348
349
|
return;
|
349
350
|
}
|
350
351
|
grpc_tcp_client_create_from_prepared_fd(interested_parties, closure, fdobj,
|
@@ -117,7 +117,7 @@ static void on_connect(void* acp, grpc_error* error) {
|
|
117
117
|
async_connect_unlock_and_cleanup(ac, socket);
|
118
118
|
/* If the connection was aborted, the callback was already called when
|
119
119
|
the deadline was met. */
|
120
|
-
|
120
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, error);
|
121
121
|
}
|
122
122
|
|
123
123
|
/* Tries to issue one async connection, then schedules both an IOCP
|
@@ -225,7 +225,7 @@ failure:
|
|
225
225
|
} else if (sock != INVALID_SOCKET) {
|
226
226
|
closesocket(sock);
|
227
227
|
}
|
228
|
-
|
228
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, final_error);
|
229
229
|
}
|
230
230
|
|
231
231
|
grpc_tcp_client_vtable grpc_windows_tcp_client_vtable = {tcp_connect};
|
@@ -140,7 +140,7 @@ static void call_read_cb(custom_tcp_endpoint* tcp, grpc_error* error) {
|
|
140
140
|
TCP_UNREF(tcp, "read");
|
141
141
|
tcp->read_slices = nullptr;
|
142
142
|
tcp->read_cb = nullptr;
|
143
|
-
|
143
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
|
144
144
|
}
|
145
145
|
|
146
146
|
static void custom_read_callback(grpc_custom_socket* socket, size_t nread,
|
@@ -220,7 +220,7 @@ static void custom_write_callback(grpc_custom_socket* socket,
|
|
220
220
|
gpr_log(GPR_INFO, "write complete on %p: error=%s", tcp->socket, str);
|
221
221
|
}
|
222
222
|
TCP_UNREF(tcp, "write");
|
223
|
-
|
223
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
|
224
224
|
}
|
225
225
|
|
226
226
|
static void endpoint_write(grpc_endpoint* ep, grpc_slice_buffer* write_slices,
|
@@ -241,8 +241,9 @@ static void endpoint_write(grpc_endpoint* ep, grpc_slice_buffer* write_slices,
|
|
241
241
|
}
|
242
242
|
|
243
243
|
if (tcp->shutting_down) {
|
244
|
-
|
245
|
-
|
244
|
+
grpc_core::ExecCtx::Run(
|
245
|
+
DEBUG_LOCATION, cb,
|
246
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("TCP socket is shutting down"));
|
246
247
|
return;
|
247
248
|
}
|
248
249
|
|
@@ -252,7 +253,7 @@ static void endpoint_write(grpc_endpoint* ep, grpc_slice_buffer* write_slices,
|
|
252
253
|
if (tcp->write_slices->count == 0) {
|
253
254
|
// No slices means we don't have to do anything,
|
254
255
|
// and libuv doesn't like empty writes
|
255
|
-
|
256
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
|
256
257
|
return;
|
257
258
|
}
|
258
259
|
tcp->write_cb = cb;
|
@@ -289,10 +290,10 @@ static void endpoint_shutdown(grpc_endpoint* ep, grpc_error* why) {
|
|
289
290
|
gpr_log(GPR_INFO, "TCP %p shutdown why=%s", tcp->socket, str);
|
290
291
|
}
|
291
292
|
tcp->shutting_down = true;
|
292
|
-
//
|
293
|
-
//
|
294
|
-
// tcp->
|
295
|
-
// tcp->write_cb = nullptr;
|
293
|
+
// grpc_core::ExecCtx::Run(DEBUG_LOCATION,tcp->read_cb,
|
294
|
+
// GRPC_ERROR_REF(why));
|
295
|
+
// grpc_core::ExecCtx::Run(DEBUG_LOCATION,tcp->write_cb,
|
296
|
+
// GRPC_ERROR_REF(why)); tcp->read_cb = nullptr; tcp->write_cb = nullptr;
|
296
297
|
grpc_resource_user_shutdown(tcp->resource_user);
|
297
298
|
grpc_custom_socket_vtable->shutdown(tcp->socket);
|
298
299
|
}
|