grpc 1.43.1 → 1.48.0
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 +488 -338
- data/include/grpc/compression.h +1 -1
- data/include/grpc/event_engine/event_engine.h +64 -20
- data/include/grpc/event_engine/memory_allocator.h +0 -15
- data/include/grpc/event_engine/port.h +1 -1
- data/include/grpc/event_engine/slice.h +286 -0
- data/include/grpc/event_engine/slice_buffer.h +118 -0
- data/include/grpc/grpc.h +43 -17
- data/include/grpc/grpc_posix.h +20 -19
- data/include/grpc/grpc_security.h +47 -50
- data/include/grpc/impl/codegen/compression_types.h +2 -3
- data/include/grpc/impl/codegen/connectivity_state.h +2 -1
- data/include/grpc/impl/codegen/gpr_types.h +2 -1
- data/include/grpc/impl/codegen/grpc_types.h +26 -22
- data/include/grpc/impl/codegen/port_platform.h +107 -40
- data/include/grpc/impl/codegen/slice.h +5 -2
- data/include/grpc/slice.h +0 -11
- data/src/core/ext/filters/census/grpc_context.cc +3 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +309 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.h +141 -0
- data/src/core/ext/filters/{client_idle → channel_idle}/idle_filter_state.cc +1 -1
- data/src/core/ext/filters/{client_idle → channel_idle}/idle_filter_state.h +7 -5
- data/src/core/ext/filters/client_channel/backend_metric.cc +20 -15
- data/src/core/ext/filters/client_channel/backend_metric.h +19 -9
- data/src/core/ext/filters/client_channel/backup_poller.cc +20 -14
- data/src/core/ext/filters/client_channel/backup_poller.h +2 -4
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +48 -26
- data/src/core/ext/filters/client_channel/client_channel.cc +413 -301
- data/src/core/ext/filters/client_channel/client_channel.h +83 -45
- data/src/core/ext/filters/client_channel/client_channel_channelz.cc +3 -5
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +12 -2
- data/src/core/ext/filters/client_channel/client_channel_factory.cc +5 -0
- data/src/core/ext/filters/client_channel/client_channel_factory.h +8 -0
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +8 -23
- data/src/core/ext/filters/client_channel/config_selector.cc +1 -0
- data/src/core/ext/filters/client_channel/config_selector.h +12 -10
- data/src/core/ext/filters/client_channel/connector.h +10 -4
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +20 -8
- data/src/core/ext/filters/client_channel/dynamic_filters.h +14 -4
- data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +4 -22
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +6 -15
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +140 -583
- data/src/core/ext/filters/client_channel/health/health_check_client.h +26 -160
- data/src/core/ext/filters/client_channel/http_proxy.cc +98 -112
- data/src/core/ext/filters/client_channel/http_proxy.h +20 -0
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +10 -5
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +7 -5
- data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +49 -0
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +12 -0
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +5 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +15 -12
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +227 -137
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +0 -7
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +4 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +6 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +25 -16
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +10 -7
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +407 -0
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h +57 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +1036 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +54 -0
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +196 -176
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +364 -224
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +381 -233
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +6 -1
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +253 -175
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +261 -234
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +133 -120
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +155 -105
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +172 -84
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +7 -1
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +99 -46
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +55 -30
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +355 -394
- data/src/core/ext/filters/client_channel/lb_policy.cc +19 -16
- data/src/core/ext/filters/client_channel/lb_policy.h +37 -34
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +11 -6
- data/src/core/ext/filters/client_channel/lb_policy_registry.h +6 -1
- data/src/core/ext/filters/client_channel/local_subchannel_pool.cc +4 -0
- data/src/core/ext/filters/client_channel/local_subchannel_pool.h +1 -0
- data/src/core/ext/filters/client_channel/proxy_mapper.h +1 -1
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +1 -0
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +5 -0
- data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +36 -22
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +383 -318
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +30 -13
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +29 -23
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +29 -44
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +172 -240
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +38 -36
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +3 -2
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc +2 -0
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +2 -1
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +123 -254
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +37 -37
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +7 -3
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +144 -77
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +213 -0
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +113 -0
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +56 -50
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +368 -167
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +3 -1
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +19 -28
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +22 -10
- data/src/core/ext/filters/client_channel/retry_filter.cc +322 -201
- data/src/core/ext/filters/client_channel/retry_filter.h +1 -0
- data/src/core/ext/filters/client_channel/retry_service_config.cc +27 -30
- data/src/core/ext/filters/client_channel/retry_service_config.h +28 -13
- data/src/core/ext/filters/client_channel/retry_throttle.cc +10 -31
- data/src/core/ext/filters/client_channel/retry_throttle.h +18 -6
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +30 -11
- data/src/core/ext/filters/client_channel/subchannel.cc +227 -235
- data/src/core/ext/filters/client_channel/subchannel.h +84 -40
- data/src/core/ext/filters/client_channel/subchannel_interface.h +51 -41
- data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +38 -0
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.cc +12 -2
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +6 -3
- data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +473 -0
- data/src/core/ext/filters/client_channel/subchannel_stream_client.h +222 -0
- data/src/core/ext/filters/deadline/deadline_filter.cc +31 -21
- data/src/core/ext/filters/deadline/deadline_filter.h +11 -3
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +173 -402
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +31 -3
- data/src/core/ext/filters/fault_injection/service_config_parser.cc +18 -17
- data/src/core/ext/filters/fault_injection/service_config_parser.h +27 -7
- data/src/core/ext/filters/http/client/http_client_filter.cc +108 -535
- data/src/core/ext/filters/http/client/http_client_filter.h +35 -5
- data/src/core/ext/filters/http/client_authority_filter.cc +44 -112
- data/src/core/ext/filters/http/client_authority_filter.h +28 -6
- data/src/core/ext/filters/http/http_filters_plugin.cc +33 -24
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +101 -320
- data/src/core/ext/filters/http/message_compress/message_compress_filter.h +1 -2
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +59 -133
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.h +1 -0
- data/src/core/ext/filters/http/server/http_server_filter.cc +100 -458
- data/src/core/ext/filters/http/server/http_server_filter.h +37 -3
- data/src/core/ext/filters/message_size/message_size_filter.cc +66 -70
- data/src/core/ext/filters/message_size/message_size_filter.h +25 -5
- data/src/core/ext/filters/rbac/rbac_filter.cc +174 -0
- data/src/core/ext/filters/rbac/rbac_filter.h +84 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +617 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +87 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector.cc +3 -8
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +14 -4
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +97 -199
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.h +1 -0
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +278 -77
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +9 -7
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +288 -56
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +2 -0
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +3 -3
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +2 -1
- data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +512 -710
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +14 -3
- data/src/core/ext/transport/chttp2/transport/context_list.cc +4 -0
- data/src/core/ext/transport/chttp2/transport/context_list.h +4 -1
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +147 -263
- data/src/core/ext/transport/chttp2/transport/flow_control.h +180 -289
- data/src/core/ext/transport/chttp2/transport/frame.h +0 -4
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +59 -212
- data/src/core/ext/transport/chttp2/transport/frame_data.h +13 -36
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +3 -0
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +3 -1
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +9 -4
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +11 -2
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +3 -0
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +12 -42
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +4 -0
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +10 -12
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +3 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +349 -290
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +85 -162
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +4 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +5 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +61 -91
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +8 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +146 -37
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +41 -46
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +0 -1
- data/src/core/ext/transport/chttp2/transport/internal.h +41 -153
- data/src/core/ext/transport/chttp2/transport/parsing.cc +87 -51
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +11 -11
- data/src/core/ext/transport/chttp2/transport/stream_map.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/stream_map.h +1 -0
- data/src/core/ext/transport/chttp2/transport/varint.h +2 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +135 -157
- data/src/core/ext/transport/inproc/inproc_plugin.cc +0 -5
- data/src/core/ext/transport/inproc/inproc_transport.cc +117 -158
- data/src/core/ext/transport/inproc/inproc_transport.h +3 -4
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +117 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +482 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +121 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +553 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +182 -176
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +1248 -685
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +56 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +151 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +62 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +160 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +46 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +124 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +102 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +97 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +106 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +605 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +48 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +103 -0
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +14 -12
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +49 -16
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +13 -11
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +49 -23
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +98 -96
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +669 -386
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +185 -173
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +1269 -664
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +34 -26
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +200 -91
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +252 -238
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +1670 -827
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +10 -8
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +42 -24
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +49 -27
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +272 -99
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +299 -0
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +1381 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +54 -50
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +354 -190
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +11 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +45 -25
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +157 -154
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +1068 -582
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +87 -42
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +525 -167
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +9 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +38 -24
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +11 -29
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +41 -101
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +58 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +151 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +108 -104
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +768 -410
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +115 -84
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +736 -349
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +11 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +57 -31
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +162 -108
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +992 -397
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +8 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +28 -17
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +15 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +83 -49
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +13 -11
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +75 -34
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +15 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +93 -49
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +11 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +46 -26
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +34 -32
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +194 -109
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +51 -48
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +349 -190
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +49 -47
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +357 -188
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +9 -7
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +34 -21
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +72 -61
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +504 -260
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +77 -69
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +560 -301
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +19 -15
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +104 -49
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +12 -10
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +66 -41
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +53 -0
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +136 -0
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +58 -55
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +413 -235
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +62 -60
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +406 -237
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +82 -76
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +562 -294
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +37 -31
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +271 -142
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +503 -475
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +3642 -1901
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +25 -19
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +148 -72
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +222 -0
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +1052 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +44 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +88 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +49 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +103 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +15 -13
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +77 -46
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +52 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +134 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +63 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +250 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +94 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +69 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +213 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c +32 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h +42 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +71 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +218 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +54 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +146 -0
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +8 -6
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +34 -24
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +29 -27
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +188 -113
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +36 -34
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +260 -132
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +64 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +183 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +16 -14
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +86 -43
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +229 -198
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +1553 -734
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +52 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +164 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c +46 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +94 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +3 -1
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +2 -1
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +87 -58
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +554 -235
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +26 -24
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +156 -87
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +98 -71
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +622 -263
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +62 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +160 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +6 -4
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +22 -16
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +67 -65
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +474 -256
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +18 -16
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +107 -62
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +51 -49
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +347 -186
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +48 -0
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +112 -0
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +20 -18
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +124 -82
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +74 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +214 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +16 -14
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +99 -57
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +10 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +50 -31
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +10 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +48 -27
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +9 -7
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +38 -24
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +21 -19
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +117 -69
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +19 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +123 -65
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +14 -12
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +85 -53
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +23 -21
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +150 -83
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +32 -30
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +230 -146
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +36 -34
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +235 -131
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +66 -0
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +201 -0
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +3 -1
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +2 -1
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +42 -0
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +139 -0
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +13 -11
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +62 -36
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +19 -17
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +98 -52
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c +26 -0
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +41 -0
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +10 -8
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +40 -19
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +51 -0
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +127 -0
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +8 -6
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +22 -6
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +109 -103
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +720 -382
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +120 -112
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +795 -402
- data/src/core/ext/upb-generated/google/api/http.upb.c +29 -27
- data/src/core/ext/upb-generated/google/api/http.upb.h +216 -115
- data/src/core/ext/upb-generated/google/api/httpbody.upb.c +46 -0
- data/src/core/ext/upb-generated/google/api/httpbody.upb.h +111 -0
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +9 -7
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +38 -22
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +291 -237
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +2076 -1030
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +9 -7
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +36 -20
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +6 -4
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +22 -16
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +31 -29
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +177 -93
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +9 -7
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +36 -20
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +40 -38
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +240 -149
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +11 -9
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +52 -30
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +84 -0
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +319 -0
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +21 -19
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +103 -48
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +102 -96
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +685 -359
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +16 -13
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +76 -41
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +12 -10
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +56 -35
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +57 -55
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +383 -219
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +22 -20
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +115 -63
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +175 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +764 -0
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +36 -34
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +189 -78
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +14 -12
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +53 -22
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +7 -5
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +15 -6
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +14 -12
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +55 -24
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +13 -11
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +49 -23
- data/src/core/ext/upb-generated/validate/validate.upb.c +339 -312
- data/src/core/ext/upb-generated/validate/validate.upb.h +2726 -1180
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +110 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +278 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +55 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +108 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +38 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +46 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +34 -32
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +171 -80
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +53 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +99 -0
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +8 -6
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +30 -19
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +18 -16
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +98 -55
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +14 -12
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +53 -30
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +46 -0
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +103 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +12 -10
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +55 -30
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +20 -18
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +130 -70
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +12 -10
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +58 -30
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +23 -21
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +101 -46
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c +47 -0
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h +109 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +207 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +878 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +52 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +143 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +65 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +218 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +10 -8
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +42 -24
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c +84 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +127 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +14 -12
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h +67 -67
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c +43 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c +49 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c +142 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c +51 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +8 -6
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +8 -6
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +20 -17
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +46 -46
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +248 -240
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +55 -55
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +58 -51
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +385 -371
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +76 -76
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +23 -16
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c +206 -0
- data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h +105 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +15 -13
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +22 -22
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +85 -80
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +73 -73
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +138 -101
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +26 -16
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +14 -12
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +22 -34
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +4 -9
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +21 -18
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h +43 -43
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +177 -166
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +30 -25
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +14 -12
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +250 -221
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +53 -43
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +12 -9
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +18 -15
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +13 -11
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +18 -15
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +19 -16
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +19 -19
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +18 -15
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +52 -45
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +19 -19
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +153 -147
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h +22 -22
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +19 -16
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c +69 -0
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +17 -14
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h +25 -25
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +17 -14
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +28 -28
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +190 -0
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h +70 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +36 -27
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +826 -803
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +160 -160
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +52 -37
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c +188 -0
- data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h +85 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +54 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c +57 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c +72 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c +99 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c +52 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c +71 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c +57 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c +75 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +77 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +15 -11
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +17 -14
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +18 -15
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +59 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +17 -13
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +197 -172
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +63 -58
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +15 -11
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +169 -140
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +24 -19
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +19 -16
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +217 -199
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +24 -19
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c +58 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +17 -14
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +22 -22
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +16 -13
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +20 -17
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +13 -10
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c +52 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +15 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +14 -12
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +16 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +13 -10
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h +22 -22
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +14 -11
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +10 -8
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c +94 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +12 -10
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +11 -8
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +38 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +11 -9
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c +57 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c +154 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h +95 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c +153 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h +100 -0
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c +39 -0
- data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +82 -82
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +3 -3
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h +28 -28
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c +67 -0
- data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +99 -0
- data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h +75 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +6 -6
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h +70 -70
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c +63 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c +47 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c +35 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +7 -7
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c +41 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +6 -6
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +6 -6
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +6 -6
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c +126 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h +80 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c +52 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +4 -4
- data/src/core/ext/xds/certificate_provider_factory.h +6 -1
- data/src/core/ext/xds/certificate_provider_registry.cc +8 -8
- data/src/core/ext/xds/certificate_provider_registry.h +3 -1
- data/src/core/ext/xds/certificate_provider_store.cc +12 -0
- data/src/core/ext/xds/certificate_provider_store.h +18 -0
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +13 -4
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +10 -2
- data/src/core/ext/xds/upb_utils.h +66 -0
- data/src/core/ext/xds/xds_api.cc +376 -3718
- data/src/core/ext/xds/xds_api.h +71 -619
- data/src/core/ext/xds/xds_bootstrap.cc +250 -141
- data/src/core/ext/xds/xds_bootstrap.h +39 -23
- data/src/core/ext/xds/xds_certificate_provider.cc +17 -3
- data/src/core/ext/xds/xds_certificate_provider.h +25 -1
- data/src/core/ext/xds/xds_channel_stack_modifier.cc +24 -18
- data/src/core/ext/xds/xds_channel_stack_modifier.h +9 -4
- data/src/core/ext/xds/xds_client.cc +850 -1160
- data/src/core/ext/xds/xds_client.h +129 -156
- data/src/core/ext/xds/xds_client_stats.cc +18 -19
- data/src/core/ext/xds/xds_client_stats.h +9 -7
- data/src/core/ext/xds/xds_cluster.cc +554 -0
- data/src/core/ext/xds/xds_cluster.h +119 -0
- data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +151 -0
- data/src/core/ext/xds/xds_cluster_specifier_plugin.h +72 -0
- data/src/core/ext/xds/xds_common_types.cc +402 -0
- data/src/core/ext/xds/xds_common_types.h +103 -0
- data/src/core/ext/xds/xds_endpoint.cc +381 -0
- data/src/core/ext/xds/xds_endpoint.h +143 -0
- data/src/core/ext/xds/xds_http_fault_filter.cc +17 -15
- data/src/core/ext/xds/xds_http_fault_filter.h +6 -4
- data/src/core/ext/xds/xds_http_filters.cc +18 -5
- data/src/core/ext/xds/xds_http_filters.h +7 -7
- data/src/core/ext/xds/xds_http_rbac_filter.cc +579 -0
- data/src/core/ext/xds/xds_http_rbac_filter.h +61 -0
- data/src/core/ext/xds/xds_lb_policy_registry.cc +291 -0
- data/src/core/ext/xds/xds_lb_policy_registry.h +72 -0
- data/src/core/ext/xds/xds_listener.cc +1067 -0
- data/src/core/ext/xds/xds_listener.h +229 -0
- data/src/core/ext/{transport/chttp2/transport/hpack_utils.h → xds/xds_resource_type.cc} +12 -9
- data/src/core/ext/xds/xds_resource_type.h +98 -0
- data/src/core/ext/xds/xds_resource_type_impl.h +91 -0
- data/src/core/ext/xds/xds_route_config.cc +1150 -0
- data/src/core/ext/xds/xds_route_config.h +227 -0
- data/src/core/ext/xds/xds_routing.cc +28 -9
- data/src/core/ext/xds/xds_routing.h +15 -7
- data/src/core/ext/xds/xds_server_config_fetcher.cc +234 -129
- data/src/core/lib/address_utils/parse_address.cc +25 -8
- data/src/core/lib/address_utils/parse_address.h +8 -2
- data/src/core/lib/address_utils/sockaddr_utils.cc +82 -51
- data/src/core/lib/address_utils/sockaddr_utils.h +9 -19
- data/src/core/lib/avl/avl.h +71 -6
- data/src/core/lib/backoff/backoff.cc +9 -38
- data/src/core/lib/backoff/backoff.h +12 -12
- data/src/core/lib/channel/call_finalization.h +90 -0
- data/src/core/lib/channel/call_tracer.h +15 -6
- data/src/core/lib/channel/channel_args.cc +202 -45
- data/src/core/lib/channel/channel_args.h +243 -9
- data/src/core/lib/channel/channel_args_preconditioning.cc +6 -10
- data/src/core/lib/channel/channel_args_preconditioning.h +4 -4
- data/src/core/lib/channel/channel_fwd.h +26 -0
- data/src/core/lib/channel/channel_stack.cc +55 -10
- data/src/core/lib/channel/channel_stack.h +83 -14
- data/src/core/lib/channel/channel_stack_builder.cc +19 -276
- data/src/core/lib/channel/channel_stack_builder.h +104 -150
- data/src/core/lib/channel/channel_stack_builder_impl.cc +97 -0
- data/src/core/lib/channel/channel_stack_builder_impl.h +46 -0
- data/src/core/lib/channel/channel_trace.cc +11 -19
- data/src/core/lib/channel/channel_trace.h +6 -3
- data/src/core/lib/channel/channelz.cc +11 -14
- data/src/core/lib/channel/channelz.h +15 -7
- data/src/core/lib/channel/channelz_registry.cc +11 -19
- data/src/core/lib/channel/channelz_registry.h +10 -9
- data/src/core/lib/channel/connected_channel.cc +26 -30
- data/src/core/lib/channel/connected_channel.h +4 -1
- data/src/core/lib/channel/context.h +11 -0
- data/src/core/lib/channel/promise_based_filter.cc +1263 -0
- data/src/core/lib/channel/promise_based_filter.h +572 -0
- data/src/core/lib/channel/status_util.cc +2 -0
- data/src/core/lib/channel/status_util.h +0 -3
- data/src/core/lib/compression/compression.cc +26 -113
- data/src/core/lib/compression/compression_internal.cc +170 -204
- data/src/core/lib/compression/compression_internal.h +68 -72
- data/src/core/lib/compression/message_compress.cc +14 -12
- data/src/core/lib/compression/message_compress.h +4 -5
- data/src/core/lib/config/core_configuration.cc +11 -2
- data/src/core/lib/config/core_configuration.h +41 -1
- data/src/core/lib/debug/stats.cc +9 -9
- data/src/core/lib/debug/stats.h +2 -1
- data/src/core/lib/debug/stats_data.cc +4 -7
- data/src/core/lib/debug/stats_data.h +18 -25
- data/src/core/lib/debug/trace.h +13 -12
- data/src/core/lib/event_engine/channel_args_endpoint_config.cc +4 -2
- data/src/core/lib/event_engine/channel_args_endpoint_config.h +3 -2
- data/src/core/lib/{iomgr/event_engine/resolved_address_internal.h → event_engine/default_event_engine_factory.cc} +10 -12
- data/src/core/lib/event_engine/event_engine.cc +40 -10
- data/src/core/lib/event_engine/event_engine_factory.h +8 -0
- data/src/core/lib/event_engine/handle_containers.h +67 -0
- data/src/core/lib/event_engine/iomgr_engine/iomgr_engine.cc +159 -0
- data/src/core/lib/event_engine/iomgr_engine/iomgr_engine.h +122 -0
- data/src/core/lib/event_engine/iomgr_engine/thread_pool.cc +123 -0
- data/src/core/lib/event_engine/iomgr_engine/thread_pool.h +70 -0
- data/src/core/lib/event_engine/iomgr_engine/time_averaged_stats.cc +62 -0
- data/src/core/lib/event_engine/iomgr_engine/time_averaged_stats.h +81 -0
- data/src/core/lib/event_engine/iomgr_engine/timer.cc +312 -0
- data/src/core/lib/event_engine/iomgr_engine/timer.h +193 -0
- data/src/core/lib/event_engine/iomgr_engine/timer_heap.cc +107 -0
- data/src/core/lib/event_engine/iomgr_engine/timer_heap.h +56 -0
- data/src/core/lib/event_engine/iomgr_engine/timer_manager.cc +254 -0
- data/src/core/lib/event_engine/iomgr_engine/timer_manager.h +111 -0
- data/src/core/lib/event_engine/memory_allocator.cc +20 -16
- data/src/core/lib/{iomgr/event_engine → event_engine}/promise.h +27 -9
- data/src/core/lib/{iomgr/event_engine/resolved_address_internal.cc → event_engine/resolved_address.cc} +13 -13
- data/src/core/lib/event_engine/slice.cc +102 -0
- data/src/core/lib/event_engine/slice_buffer.cc +50 -0
- data/src/core/{ext/filters/max_age/max_age_filter.h → lib/event_engine/trace.cc} +3 -11
- data/src/core/lib/{iomgr/endpoint_pair_event_engine.cc → event_engine/trace.h} +12 -14
- data/src/core/lib/gpr/log.cc +5 -0
- data/src/core/lib/gpr/sync_posix.cc +1 -0
- data/src/core/lib/gpr/time.cc +2 -1
- data/src/core/lib/gpr/time_posix.cc +6 -9
- data/src/core/lib/gpr/time_windows.cc +10 -7
- data/src/core/lib/gpr/tls.h +4 -5
- data/src/core/lib/gpr/useful.h +18 -0
- data/src/core/lib/gprpp/bitset.h +24 -1
- data/src/core/lib/gprpp/chunked_vector.h +49 -3
- data/src/core/lib/gprpp/construct_destruct.h +1 -0
- data/src/core/lib/gprpp/cpp_impl_of.h +4 -0
- data/src/core/lib/gprpp/debug_location.h +2 -0
- data/src/core/lib/gprpp/dual_ref_counted.h +1 -4
- data/src/core/lib/gprpp/examine_stack.h +0 -1
- data/src/core/lib/gprpp/fork.cc +3 -6
- data/src/core/lib/gprpp/global_config.h +2 -4
- data/src/core/lib/gprpp/global_config_env.cc +3 -2
- data/src/core/lib/gprpp/global_config_env.h +3 -1
- data/src/core/lib/gprpp/global_config_generic.h +0 -4
- data/src/core/lib/gprpp/host_port.cc +2 -0
- data/src/core/lib/gprpp/manual_constructor.h +0 -68
- data/src/core/lib/gprpp/match.h +75 -0
- data/src/core/lib/gprpp/memory.h +1 -5
- data/src/core/lib/gprpp/orphanable.h +1 -4
- data/src/core/lib/gprpp/overload.h +59 -0
- 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/single_set_ptr.h +87 -0
- data/src/core/lib/gprpp/stat.h +0 -2
- data/src/core/lib/gprpp/stat_posix.cc +7 -2
- data/src/core/lib/gprpp/status_helper.cc +74 -48
- data/src/core/lib/gprpp/status_helper.h +10 -19
- data/src/core/lib/gprpp/sync.h +3 -1
- data/src/core/lib/gprpp/table.h +21 -0
- data/src/core/lib/gprpp/thd.h +2 -5
- data/src/core/lib/gprpp/thd_posix.cc +4 -2
- data/src/core/lib/gprpp/thd_windows.cc +2 -0
- data/src/core/lib/gprpp/time.cc +214 -0
- data/src/core/lib/gprpp/time.h +301 -0
- data/src/core/lib/gprpp/time_util.cc +4 -0
- data/src/core/lib/gprpp/time_util.h +1 -1
- data/src/core/lib/gprpp/unique_type_name.h +104 -0
- data/src/core/lib/http/format_request.cc +62 -29
- data/src/core/lib/http/format_request.h +10 -7
- data/src/core/lib/http/httpcli.cc +325 -244
- data/src/core/lib/http/httpcli.h +232 -91
- data/src/core/lib/http/httpcli_security_connector.cc +79 -79
- data/src/core/lib/http/httpcli_ssl_credentials.h +39 -0
- data/src/core/lib/http/parser.cc +85 -15
- data/src/core/lib/http/parser.h +18 -2
- data/src/core/lib/iomgr/buffer_list.h +5 -5
- data/src/core/lib/iomgr/call_combiner.cc +17 -6
- data/src/core/lib/iomgr/closure.h +29 -9
- data/src/core/lib/iomgr/combiner.cc +25 -3
- data/src/core/lib/iomgr/endpoint.cc +4 -4
- data/src/core/lib/iomgr/endpoint.h +7 -5
- data/src/core/lib/iomgr/endpoint_cfstream.cc +9 -6
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +2 -1
- data/src/core/lib/iomgr/error.cc +24 -19
- data/src/core/lib/iomgr/error.h +9 -7
- data/src/core/lib/iomgr/ev_apple.cc +6 -5
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +65 -25
- data/src/core/lib/iomgr/ev_epoll1_linux.h +1 -1
- data/src/core/lib/iomgr/ev_poll_posix.cc +84 -59
- data/src/core/lib/iomgr/ev_poll_posix.h +2 -2
- data/src/core/lib/iomgr/ev_posix.cc +58 -100
- data/src/core/lib/iomgr/ev_posix.h +6 -4
- data/src/core/lib/iomgr/exec_ctx.cc +25 -97
- data/src/core/lib/iomgr/exec_ctx.h +8 -25
- data/src/core/lib/iomgr/executor.cc +10 -1
- data/src/core/lib/iomgr/fork_posix.cc +1 -0
- data/src/core/lib/iomgr/internal_errqueue.cc +38 -47
- data/src/core/lib/iomgr/internal_errqueue.h +1 -6
- data/src/core/lib/iomgr/iocp_windows.cc +9 -9
- data/src/core/lib/iomgr/iocp_windows.h +1 -1
- data/src/core/lib/iomgr/iomgr.cc +7 -1
- data/src/core/lib/iomgr/{event_engine/pollset.h → iomgr_fwd.h} +9 -9
- data/src/core/lib/iomgr/iomgr_posix.cc +3 -2
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +3 -2
- data/src/core/lib/iomgr/iomgr_windows.cc +2 -2
- data/src/core/lib/iomgr/load_file.cc +1 -1
- data/src/core/lib/iomgr/polling_entity.h +6 -0
- data/src/core/lib/iomgr/pollset.cc +1 -1
- data/src/core/lib/iomgr/pollset.h +4 -4
- data/src/core/lib/iomgr/pollset_set.h +1 -2
- data/src/core/lib/iomgr/pollset_windows.cc +2 -2
- data/src/core/lib/iomgr/port.h +26 -12
- data/src/core/lib/iomgr/resolve_address.cc +12 -23
- data/src/core/lib/iomgr/resolve_address.h +56 -46
- data/src/core/lib/iomgr/resolve_address_impl.h +58 -0
- data/src/core/lib/iomgr/resolve_address_posix.cc +76 -66
- data/src/core/lib/iomgr/resolve_address_posix.h +50 -0
- data/src/core/lib/iomgr/resolve_address_windows.cc +87 -75
- data/src/core/lib/iomgr/resolve_address_windows.h +50 -0
- data/src/core/{ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc → lib/iomgr/resolved_address.h} +21 -10
- data/src/core/lib/iomgr/sockaddr.h +2 -3
- data/src/core/lib/iomgr/sockaddr_posix.h +2 -0
- data/src/core/lib/iomgr/sockaddr_utils_posix.cc +62 -0
- data/src/core/lib/iomgr/sockaddr_windows.h +2 -0
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +3 -19
- data/src/core/lib/iomgr/tcp_client.cc +12 -7
- data/src/core/lib/iomgr/tcp_client.h +24 -12
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +24 -10
- data/src/core/lib/iomgr/tcp_client_posix.cc +157 -32
- data/src/core/lib/iomgr/tcp_client_posix.h +2 -2
- data/src/core/lib/iomgr/tcp_client_windows.cc +27 -16
- data/src/core/lib/iomgr/tcp_posix.cc +167 -64
- data/src/core/lib/iomgr/tcp_server_posix.cc +57 -34
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +42 -38
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +10 -6
- data/src/core/lib/iomgr/tcp_server_windows.cc +20 -12
- data/src/core/lib/iomgr/tcp_windows.cc +29 -19
- data/src/core/lib/iomgr/timer.cc +2 -2
- data/src/core/lib/iomgr/timer.h +11 -6
- data/src/core/lib/iomgr/timer_generic.cc +96 -77
- data/src/core/lib/iomgr/timer_manager.cc +15 -14
- data/src/core/lib/iomgr/unix_sockets_posix.cc +22 -34
- data/src/core/lib/iomgr/unix_sockets_posix.h +4 -7
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +6 -15
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +2 -2
- data/src/core/lib/iomgr/wakeup_fd_posix.cc +15 -12
- data/src/core/lib/iomgr/wakeup_fd_posix.h +0 -2
- data/src/core/lib/iomgr/work_serializer.cc +15 -10
- data/src/core/lib/iomgr/work_serializer.h +2 -3
- data/src/core/lib/json/json.h +1 -2
- data/src/core/lib/json/json_reader.cc +9 -1
- data/src/core/lib/json/json_util.cc +11 -4
- data/src/core/lib/json/json_util.h +15 -6
- data/src/core/lib/json/json_writer.cc +6 -1
- data/src/core/lib/matchers/matchers.cc +7 -4
- data/src/core/lib/matchers/matchers.h +2 -0
- data/src/core/lib/promise/activity.cc +15 -10
- data/src/core/lib/promise/activity.h +192 -157
- data/src/core/lib/promise/arena_promise.h +198 -0
- data/src/core/lib/promise/call_push_pull.h +148 -0
- data/src/core/lib/promise/context.h +1 -1
- data/src/core/lib/promise/detail/basic_seq.h +94 -5
- data/src/core/lib/promise/detail/promise_factory.h +1 -2
- data/src/core/lib/promise/detail/status.h +6 -0
- data/src/core/lib/promise/intra_activity_waiter.h +49 -0
- data/src/core/lib/promise/latch.h +103 -0
- data/src/core/lib/promise/loop.h +36 -8
- data/src/core/lib/promise/poll.h +6 -0
- data/src/core/lib/promise/promise.h +96 -0
- data/src/core/lib/promise/race.h +0 -1
- data/src/core/lib/promise/seq.h +19 -3
- data/src/core/lib/promise/sleep.cc +81 -0
- data/src/core/lib/promise/sleep.h +76 -0
- data/src/core/lib/promise/try_seq.h +157 -0
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver.cc +22 -25
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver.h +46 -44
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver_factory.h +36 -33
- data/src/core/lib/resolver/resolver_registry.cc +149 -0
- data/src/core/lib/resolver/resolver_registry.h +124 -0
- data/src/core/{ext/filters/client_channel → lib/resolver}/server_address.cc +18 -4
- data/src/core/{ext/filters/client_channel → lib/resolver}/server_address.h +17 -10
- data/src/core/lib/resource_quota/api.cc +19 -31
- data/src/core/lib/resource_quota/api.h +5 -3
- data/src/core/lib/{gprpp → resource_quota}/arena.cc +16 -19
- data/src/core/lib/{gprpp → resource_quota}/arena.h +25 -15
- data/src/core/lib/resource_quota/memory_quota.cc +170 -146
- data/src/core/lib/resource_quota/memory_quota.h +131 -90
- data/src/core/lib/resource_quota/resource_quota.h +16 -0
- data/src/core/lib/resource_quota/thread_quota.cc +2 -0
- data/src/core/lib/resource_quota/thread_quota.h +4 -0
- data/src/core/lib/security/authorization/authorization_policy_provider.h +14 -0
- data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +4 -0
- data/src/core/lib/security/authorization/evaluate_args.cc +34 -23
- data/src/core/lib/security/authorization/evaluate_args.h +7 -4
- data/src/core/lib/security/authorization/grpc_authorization_engine.cc +66 -0
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +69 -0
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +121 -0
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +61 -0
- data/src/core/lib/security/authorization/matchers.cc +235 -0
- data/src/core/lib/security/authorization/matchers.h +218 -0
- data/src/core/lib/security/authorization/rbac_policy.cc +447 -0
- data/src/core/lib/security/authorization/rbac_policy.h +178 -0
- data/src/core/lib/security/context/security_context.cc +9 -4
- data/src/core/lib/security/context/security_context.h +23 -4
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +16 -7
- data/src/core/lib/security/credentials/alts/alts_credentials.h +16 -1
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +1 -3
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc +1 -4
- data/src/core/lib/security/credentials/call_creds_util.cc +97 -0
- data/src/core/lib/security/credentials/call_creds_util.h +43 -0
- data/src/core/lib/security/credentials/channel_creds_registry.h +103 -0
- data/src/core/lib/security/credentials/channel_creds_registry_init.cc +80 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +31 -86
- data/src/core/lib/security/credentials/composite/composite_credentials.h +41 -13
- data/src/core/lib/security/credentials/credentials.cc +6 -11
- data/src/core/lib/security/credentials/credentials.h +90 -87
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +154 -39
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +19 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +9 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +78 -42
- data/src/core/lib/security/credentials/external/external_account_credentials.h +16 -9
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +12 -5
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +6 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +55 -17
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +11 -0
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +40 -32
- data/src/core/lib/security/credentials/fake/fake_credentials.h +35 -22
- data/src/core/lib/security/credentials/google_default/credentials_generic.cc +1 -0
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +69 -35
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +20 -5
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +32 -30
- data/src/core/lib/security/credentials/iam/iam_credentials.h +25 -9
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +35 -26
- data/src/core/lib/security/credentials/insecure/insecure_credentials.h +62 -0
- data/src/core/lib/security/credentials/jwt/json_token.cc +9 -8
- data/src/core/lib/security/credentials/jwt/json_token.h +2 -2
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +44 -49
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +30 -12
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +81 -43
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +5 -3
- data/src/core/lib/security/credentials/local/local_credentials.cc +16 -9
- data/src/core/lib/security/credentials/local/local_credentials.h +17 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +175 -171
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +81 -34
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +104 -156
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +80 -27
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +18 -14
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +27 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +6 -6
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +9 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +39 -10
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +56 -4
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +43 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +72 -10
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +29 -5
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +67 -80
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +26 -8
- data/src/core/lib/security/credentials/tls/tls_credentials.h +11 -1
- data/src/core/lib/security/credentials/tls/tls_utils.cc +2 -0
- data/src/core/lib/security/credentials/tls/tls_utils.h +1 -1
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +65 -51
- data/src/core/lib/security/credentials/xds/xds_credentials.h +51 -6
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +30 -16
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +7 -4
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +22 -14
- data/src/core/lib/security/security_connector/fake/fake_security_connector.h +2 -4
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +15 -16
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +21 -11
- data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +5 -3
- data/src/core/lib/security/security_connector/{load_system_roots_linux.cc → load_system_roots_supported.cc} +27 -19
- data/src/core/lib/security/security_connector/{load_system_roots_linux.h → load_system_roots_supported.h} +5 -5
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +32 -21
- data/src/core/lib/security/security_connector/local/local_security_connector.h +6 -2
- data/src/core/lib/security/security_connector/security_connector.cc +22 -32
- data/src/core/lib/security/security_connector/security_connector.h +44 -28
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +29 -20
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +4 -2
- data/src/core/lib/security/security_connector/ssl_utils.cc +41 -33
- data/src/core/lib/security/security_connector/ssl_utils.h +23 -24
- data/src/core/lib/security/security_connector/ssl_utils_config.h +1 -1
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +46 -28
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +29 -9
- data/src/core/lib/security/transport/auth_filters.h +45 -5
- data/src/core/lib/security/transport/client_auth_filter.cc +112 -368
- data/src/core/lib/security/transport/secure_endpoint.cc +267 -137
- data/src/core/lib/security/transport/secure_endpoint.h +5 -4
- data/src/core/lib/security/transport/security_handshaker.cc +69 -26
- data/src/core/lib/security/transport/security_handshaker.h +5 -1
- data/src/core/lib/security/transport/server_auth_filter.cc +70 -41
- data/src/core/lib/security/util/json_util.cc +3 -2
- data/src/core/lib/security/util/json_util.h +0 -2
- data/src/core/lib/service_config/service_config.h +78 -0
- data/src/core/{ext → lib}/service_config/service_config_call_data.h +11 -7
- data/src/core/{ext/service_config/service_config.cc → lib/service_config/service_config_impl.cc} +33 -23
- data/src/core/{ext/service_config/service_config.h → lib/service_config/service_config_impl.h} +24 -21
- data/src/core/{ext → lib}/service_config/service_config_parser.cc +39 -29
- data/src/core/{ext → lib}/service_config/service_config_parser.h +45 -29
- data/src/core/lib/slice/b64.cc +1 -1
- data/src/core/lib/slice/b64.h +2 -0
- data/src/core/lib/slice/percent_encoding.cc +4 -1
- data/src/core/lib/slice/percent_encoding.h +0 -6
- data/src/core/lib/slice/slice.cc +78 -180
- data/src/core/lib/slice/slice.h +77 -29
- data/src/core/lib/slice/slice_api.cc +1 -1
- data/src/core/lib/slice/slice_buffer.cc +79 -23
- data/src/core/lib/slice/slice_buffer.h +137 -0
- data/src/core/lib/{iomgr/is_epollexclusive_available.h → slice/slice_buffer_api.cc} +11 -12
- data/src/core/lib/slice/slice_internal.h +16 -34
- data/src/core/lib/slice/slice_refcount.cc +18 -0
- data/src/core/lib/slice/slice_refcount.h +6 -86
- data/src/core/lib/slice/slice_refcount_base.h +18 -139
- data/src/core/lib/slice/slice_string_helpers.cc +0 -16
- data/src/core/lib/slice/slice_string_helpers.h +1 -8
- data/src/core/lib/surface/builtins.cc +11 -6
- data/src/core/lib/surface/byte_buffer.cc +7 -1
- data/src/core/lib/surface/byte_buffer_reader.cc +4 -4
- data/src/core/lib/surface/call.cc +1113 -1275
- data/src/core/lib/surface/call.h +26 -22
- data/src/core/lib/surface/call_details.cc +4 -4
- data/src/core/lib/surface/call_log_batch.cc +7 -1
- data/src/core/lib/surface/call_test_only.h +4 -1
- data/src/core/lib/surface/channel.cc +220 -289
- data/src/core/lib/surface/channel.h +100 -62
- data/src/core/lib/surface/channel_init.cc +2 -3
- data/src/core/lib/surface/channel_init.h +4 -6
- data/src/core/lib/surface/channel_ping.cc +8 -2
- data/src/core/lib/surface/channel_stack_type.cc +0 -2
- data/src/core/lib/surface/channel_stack_type.h +0 -2
- data/src/core/lib/surface/completion_queue.cc +39 -29
- data/src/core/lib/surface/completion_queue.h +7 -2
- data/src/core/lib/surface/completion_queue_factory.cc +1 -0
- data/src/core/lib/surface/completion_queue_factory.h +1 -3
- data/src/core/lib/surface/event_string.cc +1 -7
- data/src/core/lib/surface/event_string.h +1 -1
- data/src/core/lib/surface/init.cc +66 -26
- data/src/core/lib/surface/init.h +0 -10
- data/src/core/lib/surface/lame_client.cc +63 -109
- data/src/core/lib/surface/lame_client.h +41 -3
- data/src/core/lib/surface/metadata_array.cc +2 -0
- data/src/core/lib/surface/server.cc +106 -126
- data/src/core/lib/surface/server.h +48 -16
- data/src/core/lib/surface/validate_metadata.cc +3 -6
- data/src/core/lib/surface/validate_metadata.h +3 -0
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.cc +12 -11
- data/src/core/lib/transport/bdp_estimator.h +4 -5
- data/src/core/lib/transport/connectivity_state.cc +6 -4
- data/src/core/lib/transport/connectivity_state.h +2 -3
- data/src/core/lib/transport/error_utils.cc +21 -11
- data/src/core/lib/transport/error_utils.h +7 -2
- data/src/core/lib/{channel → transport}/handshaker.cc +13 -8
- data/src/core/lib/{channel → transport}/handshaker.h +14 -7
- data/src/core/lib/{channel → transport}/handshaker_factory.h +9 -10
- data/src/core/lib/{channel → transport}/handshaker_registry.cc +5 -1
- data/src/core/lib/{channel → transport}/handshaker_registry.h +5 -4
- data/src/core/{ext/filters/client_channel → lib/transport}/http_connect_handshaker.cc +37 -26
- data/src/core/{ext/filters/client_channel → lib/transport}/http_connect_handshaker.h +3 -3
- data/src/core/lib/transport/metadata_batch.cc +260 -72
- data/src/core/lib/transport/metadata_batch.h +932 -799
- data/src/core/lib/transport/parsed_metadata.cc +4 -0
- data/src/core/lib/transport/parsed_metadata.h +124 -98
- data/src/core/lib/transport/status_conversion.cc +4 -2
- data/src/core/lib/transport/status_conversion.h +3 -3
- data/src/core/lib/transport/tcp_connect_handshaker.cc +253 -0
- data/src/core/lib/transport/tcp_connect_handshaker.h +39 -0
- data/src/core/lib/transport/timeout_encoding.cc +203 -70
- data/src/core/lib/transport/timeout_encoding.h +44 -10
- data/src/core/lib/transport/transport.cc +21 -21
- data/src/core/lib/transport/transport.h +151 -19
- data/src/core/lib/transport/transport_fwd.h +20 -0
- data/src/core/lib/transport/transport_impl.h +25 -0
- data/src/core/lib/transport/transport_op_string.cc +21 -64
- data/src/core/lib/uri/uri_parser.cc +238 -56
- data/src/core/lib/uri/uri_parser.h +37 -25
- data/src/core/plugin_registry/grpc_plugin_registry.cc +32 -91
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +85 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +27 -22
- data/src/core/tsi/alts/handshaker/alts_shared_resource.cc +9 -1
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +22 -14
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +2 -2
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +1 -1
- data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +2 -2
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +2 -2
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +9 -1
- data/src/core/tsi/fake_transport_security.cc +13 -1
- data/src/core/tsi/fake_transport_security.h +6 -0
- data/src/core/tsi/local_transport_security.cc +3 -11
- data/src/core/tsi/local_transport_security.h +1 -4
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +141 -0
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.h +81 -0
- data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +2 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +3 -5
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +2 -0
- data/src/core/tsi/ssl_transport_security.cc +180 -52
- data/src/core/tsi/ssl_transport_security.h +46 -8
- data/src/core/tsi/transport_security_grpc.cc +3 -2
- data/src/core/tsi/transport_security_grpc.h +5 -2
- data/src/core/tsi/transport_security_interface.h +2 -0
- data/src/ruby/ext/grpc/ext-export-truffleruby.clang +2 -0
- data/src/ruby/ext/grpc/ext-export-truffleruby.gcc +7 -0
- data/src/ruby/ext/grpc/ext-export.clang +1 -0
- data/src/ruby/ext/grpc/ext-export.gcc +1 -0
- data/src/ruby/ext/grpc/extconf.rb +59 -21
- data/src/ruby/ext/grpc/rb_channel.c +5 -2
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +20 -24
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +31 -37
- data/src/ruby/ext/grpc/rb_server.c +7 -4
- data/src/ruby/lib/grpc/errors.rb +1 -1
- data/src/ruby/lib/grpc/generic/active_call.rb +7 -1
- data/src/ruby/lib/grpc/grpc.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -0
- data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +2 -1
- data/src/ruby/pb/test/client.rb +769 -0
- data/src/ruby/pb/test/server.rb +252 -0
- data/src/ruby/pb/test/xds_client.rb +415 -0
- data/src/ruby/spec/generic/client_stub_spec.rb +23 -23
- data/third_party/abseil-cpp/absl/algorithm/container.h +1 -1
- data/third_party/abseil-cpp/absl/base/attributes.h +49 -22
- data/third_party/abseil-cpp/absl/base/casts.h +61 -68
- data/third_party/abseil-cpp/absl/base/config.h +182 -41
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +12 -42
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.h +67 -2
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +3 -3
- data/third_party/abseil-cpp/absl/base/internal/endian.h +17 -62
- data/third_party/abseil-cpp/absl/base/internal/fast_type_id.h +50 -0
- data/third_party/abseil-cpp/absl/base/internal/invoke.h +54 -0
- data/third_party/abseil-cpp/absl/base/internal/prefetch.h +138 -0
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +29 -22
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +13 -12
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +3 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +8 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +2 -5
- data/third_party/abseil-cpp/absl/base/internal/strerror.cc +88 -0
- data/third_party/abseil-cpp/absl/base/internal/strerror.h +39 -0
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +0 -1
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +2 -1
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +6 -7
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +12 -3
- data/third_party/abseil-cpp/absl/base/log_severity.cc +28 -0
- data/third_party/abseil-cpp/absl/base/log_severity.h +51 -0
- data/third_party/abseil-cpp/absl/base/optimization.h +19 -11
- data/third_party/abseil-cpp/absl/base/options.h +1 -1
- data/third_party/abseil-cpp/absl/base/thread_annotations.h +2 -2
- data/third_party/abseil-cpp/absl/container/fixed_array.h +2 -0
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +11 -4
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +510 -0
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +20 -9
- data/third_party/abseil-cpp/absl/container/internal/common.h +6 -5
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +10 -28
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +68 -20
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +29 -11
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +59 -38
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +4 -0
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +515 -184
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +45 -88
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +4 -0
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +3 -2
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +8 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +8 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +2 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +8 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +20 -18
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +8 -3
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +15 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize.cc +6 -1
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +46 -7
- data/third_party/abseil-cpp/absl/functional/bind_front.h +10 -1
- data/third_party/abseil-cpp/absl/functional/function_ref.h +2 -1
- data/third_party/abseil-cpp/absl/hash/hash.h +82 -8
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +218 -23
- data/third_party/abseil-cpp/absl/numeric/bits.h +2 -1
- data/third_party/abseil-cpp/absl/numeric/int128.cc +4 -2
- data/third_party/abseil-cpp/absl/numeric/int128.h +2 -2
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +21 -6
- data/third_party/abseil-cpp/absl/random/bernoulli_distribution.h +200 -0
- data/third_party/abseil-cpp/absl/random/beta_distribution.h +427 -0
- data/third_party/abseil-cpp/absl/random/discrete_distribution.cc +98 -0
- data/third_party/abseil-cpp/absl/random/discrete_distribution.h +247 -0
- data/third_party/abseil-cpp/absl/random/distributions.h +452 -0
- data/third_party/abseil-cpp/absl/random/exponential_distribution.h +165 -0
- data/third_party/abseil-cpp/absl/random/gaussian_distribution.cc +104 -0
- data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +275 -0
- data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +95 -0
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +269 -0
- data/third_party/abseil-cpp/absl/random/internal/fastmath.h +57 -0
- data/third_party/abseil-cpp/absl/random/internal/generate_real.h +144 -0
- data/third_party/abseil-cpp/absl/random/internal/iostream_state_saver.h +245 -0
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +161 -0
- data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +308 -0
- data/third_party/abseil-cpp/absl/random/internal/platform.h +171 -0
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc +253 -0
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +131 -0
- data/third_party/abseil-cpp/absl/random/internal/randen.cc +91 -0
- data/third_party/abseil-cpp/absl/random/internal/randen.h +96 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +225 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.h +33 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +264 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc +526 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.h +50 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_round_keys.cc +462 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_slow.cc +471 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_slow.h +40 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_traits.h +88 -0
- data/third_party/abseil-cpp/absl/random/internal/salted_seed_seq.h +165 -0
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +267 -0
- data/third_party/abseil-cpp/absl/random/internal/seed_material.h +104 -0
- data/third_party/abseil-cpp/absl/random/internal/traits.h +149 -0
- data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +244 -0
- data/third_party/abseil-cpp/absl/random/internal/wide_multiply.h +96 -0
- data/third_party/abseil-cpp/absl/random/log_uniform_int_distribution.h +256 -0
- data/third_party/abseil-cpp/absl/random/poisson_distribution.h +261 -0
- data/third_party/abseil-cpp/absl/random/random.h +189 -0
- data/third_party/abseil-cpp/absl/random/seed_gen_exception.cc +46 -0
- data/third_party/abseil-cpp/absl/random/seed_gen_exception.h +55 -0
- data/third_party/abseil-cpp/absl/random/seed_sequences.cc +29 -0
- data/third_party/abseil-cpp/absl/random/seed_sequences.h +111 -0
- data/third_party/abseil-cpp/absl/random/uniform_int_distribution.h +275 -0
- data/third_party/abseil-cpp/absl/random/uniform_real_distribution.h +202 -0
- data/third_party/abseil-cpp/absl/random/zipf_distribution.h +272 -0
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +17 -0
- data/third_party/abseil-cpp/absl/status/status.cc +174 -2
- data/third_party/abseil-cpp/absl/status/status.h +22 -12
- data/third_party/abseil-cpp/absl/status/statusor.h +9 -3
- data/third_party/abseil-cpp/absl/strings/ascii.h +4 -4
- data/third_party/abseil-cpp/absl/strings/cord.cc +194 -913
- data/third_party/abseil-cpp/absl/strings/cord.h +202 -81
- data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +188 -0
- data/third_party/abseil-cpp/absl/strings/cord_analysis.h +44 -0
- data/third_party/abseil-cpp/absl/strings/cord_buffer.cc +30 -0
- data/third_party/abseil-cpp/absl/strings/cord_buffer.h +572 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_data_edge.h +63 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +20 -32
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +123 -88
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +149 -49
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +44 -59
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +3 -1
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc +3 -2
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h +5 -4
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +7 -74
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.cc +54 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.h +102 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +58 -17
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +13 -11
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +11 -38
- data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +1 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +6 -5
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +38 -7
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +7 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +4 -5
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +5 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/output.h +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +9 -6
- data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +10 -2
- data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/numbers.cc +8 -8
- data/third_party/abseil-cpp/absl/strings/numbers.h +26 -23
- data/third_party/abseil-cpp/absl/strings/str_cat.h +20 -13
- data/third_party/abseil-cpp/absl/strings/str_join.h +9 -15
- data/third_party/abseil-cpp/absl/strings/str_split.h +1 -2
- data/third_party/abseil-cpp/absl/strings/string_view.cc +2 -13
- data/third_party/abseil-cpp/absl/strings/string_view.h +3 -2
- data/third_party/abseil-cpp/absl/strings/strip.h +8 -6
- data/third_party/abseil-cpp/absl/strings/substitute.h +10 -2
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +9 -6
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.h +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +1 -6
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +0 -25
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +10 -4
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +75 -40
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +17 -9
- data/third_party/abseil-cpp/absl/synchronization/notification.h +3 -2
- data/third_party/abseil-cpp/absl/time/duration.cc +5 -4
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +11 -7
- data/third_party/abseil-cpp/absl/time/time.h +16 -12
- data/third_party/abseil-cpp/absl/types/internal/optional.h +8 -0
- data/third_party/abseil-cpp/absl/types/internal/variant.h +3 -3
- data/third_party/abseil-cpp/absl/types/optional.h +17 -14
- data/third_party/abseil-cpp/absl/types/span.h +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +13 -0
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +21 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +12 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +1 -2
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c +29 -0
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/base64.h +8 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +13 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +10 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +9 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +6 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +23 -2
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +4 -0
- data/third_party/cares/cares/{ares.h → include/ares.h} +73 -1
- data/third_party/cares/cares/{ares_dns.h → include/ares_dns.h} +9 -0
- data/third_party/cares/cares/{ares_version.h → include/ares_version.h} +3 -3
- data/third_party/cares/cares/{ares__close_sockets.c → src/lib/ares__close_sockets.c} +2 -2
- data/third_party/cares/cares/{ares__get_hostent.c → src/lib/ares__get_hostent.c} +1 -2
- data/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c +260 -0
- data/third_party/cares/cares/src/lib/ares__readaddrinfo.c +264 -0
- data/third_party/cares/cares/src/lib/ares__sortaddrinfo.c +499 -0
- data/third_party/cares/cares/src/lib/ares_android.c +444 -0
- data/third_party/cares/cares/src/lib/ares_android.h +27 -0
- data/third_party/cares/cares/{ares_create_query.c → src/lib/ares_create_query.c} +8 -17
- data/third_party/cares/cares/{ares_data.c → src/lib/ares_data.c} +18 -0
- data/third_party/cares/cares/{ares_data.h → src/lib/ares_data.h} +2 -0
- data/third_party/cares/cares/{ares_expand_name.c → src/lib/ares_expand_name.c} +114 -23
- data/third_party/cares/cares/{ares_expand_string.c → src/lib/ares_expand_string.c} +2 -5
- data/third_party/cares/cares/{ares_free_hostent.c → src/lib/ares_free_hostent.c} +6 -4
- data/third_party/cares/cares/src/lib/ares_freeaddrinfo.c +59 -0
- data/third_party/cares/cares/src/lib/ares_getaddrinfo.c +772 -0
- data/third_party/cares/cares/{ares_getenv.c → src/lib/ares_getenv.c} +0 -2
- data/third_party/cares/cares/{ares_gethostbyaddr.c → src/lib/ares_gethostbyaddr.c} +2 -9
- data/third_party/cares/cares/{ares_gethostbyname.c → src/lib/ares_gethostbyname.c} +25 -20
- data/third_party/cares/cares/{ares_getnameinfo.c → src/lib/ares_getnameinfo.c} +4 -10
- data/third_party/cares/cares/{ares_init.c → src/lib/ares_init.c} +79 -40
- data/third_party/cares/cares/{ares_ipv6.h → src/lib/ares_ipv6.h} +7 -0
- data/third_party/cares/cares/{ares_library_init.c → src/lib/ares_library_init.c} +7 -2
- data/third_party/cares/cares/{ares_library_init.h → src/lib/ares_library_init.h} +1 -1
- data/third_party/cares/cares/src/lib/ares_nameser.h +482 -0
- data/third_party/cares/cares/src/lib/ares_parse_a_reply.c +209 -0
- data/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c +212 -0
- data/third_party/cares/cares/src/lib/ares_parse_caa_reply.c +199 -0
- data/third_party/cares/cares/{ares_parse_mx_reply.c → src/lib/ares_parse_mx_reply.c} +2 -8
- data/third_party/cares/cares/{ares_parse_naptr_reply.c → src/lib/ares_parse_naptr_reply.c} +2 -13
- data/third_party/cares/cares/{ares_parse_ns_reply.c → src/lib/ares_parse_ns_reply.c} +5 -11
- data/third_party/cares/cares/{ares_parse_ptr_reply.c → src/lib/ares_parse_ptr_reply.c} +53 -46
- data/third_party/cares/cares/src/lib/ares_parse_soa_reply.c +179 -0
- data/third_party/cares/cares/{ares_parse_srv_reply.c → src/lib/ares_parse_srv_reply.c} +2 -13
- data/third_party/cares/cares/{ares_parse_txt_reply.c → src/lib/ares_parse_txt_reply.c} +3 -9
- data/third_party/cares/cares/{ares_private.h → src/lib/ares_private.h} +52 -11
- data/third_party/cares/cares/{ares_process.c → src/lib/ares_process.c} +127 -52
- data/third_party/cares/cares/{ares_query.c → src/lib/ares_query.c} +3 -9
- data/third_party/cares/cares/{ares_search.c → src/lib/ares_search.c} +5 -7
- data/third_party/cares/cares/{ares_send.c → src/lib/ares_send.c} +2 -8
- data/third_party/cares/cares/{ares_setup.h → src/lib/ares_setup.h} +4 -1
- data/third_party/cares/cares/{ares_strsplit.c → src/lib/ares_strsplit.c} +4 -0
- data/third_party/cares/cares/src/lib/ares_writev.h +36 -0
- data/third_party/cares/cares/src/lib/config-dos.h +115 -0
- data/third_party/cares/cares/{inet_net_pton.c → src/lib/inet_net_pton.c} +2 -8
- data/third_party/cares/cares/{inet_ntop.c → src/lib/inet_ntop.c} +2 -8
- data/third_party/upb/third_party/utf8_range/naive.c +92 -0
- data/third_party/upb/third_party/utf8_range/range2-neon.c +157 -0
- data/third_party/upb/third_party/utf8_range/range2-sse.c +170 -0
- data/third_party/upb/third_party/utf8_range/utf8_range.h +9 -0
- data/third_party/upb/upb/decode.c +542 -319
- data/third_party/upb/upb/decode.h +43 -17
- data/third_party/upb/upb/decode_fast.c +303 -301
- data/third_party/upb/upb/decode_fast.h +18 -18
- data/third_party/upb/upb/decode_internal.h +73 -56
- data/third_party/upb/upb/def.c +1926 -1078
- data/third_party/upb/upb/def.h +329 -288
- data/third_party/upb/upb/def.hpp +129 -172
- data/third_party/upb/upb/encode.c +208 -175
- data/third_party/upb/upb/encode.h +15 -17
- data/third_party/upb/upb/json_encode.c +776 -0
- data/third_party/upb/upb/json_encode.h +62 -0
- data/third_party/upb/upb/msg.c +142 -124
- data/third_party/upb/upb/msg.h +39 -33
- data/third_party/upb/upb/msg_internal.h +342 -280
- data/third_party/upb/upb/port_def.inc +8 -0
- data/third_party/upb/upb/port_undef.inc +1 -0
- data/third_party/upb/upb/reflection.c +239 -199
- data/third_party/upb/upb/reflection.h +87 -67
- data/third_party/upb/upb/reflection.hpp +6 -6
- data/third_party/upb/upb/table.c +231 -147
- data/third_party/upb/upb/table_internal.h +129 -95
- data/third_party/upb/upb/text_encode.c +113 -90
- data/third_party/upb/upb/text_encode.h +10 -10
- data/third_party/upb/upb/upb.c +111 -72
- data/third_party/upb/upb/upb.h +157 -151
- data/third_party/upb/upb/upb.hpp +31 -28
- data/third_party/upb/upb/upb_internal.h +21 -11
- data/third_party/xxhash/xxhash.h +607 -352
- data/third_party/zlib/crc32.c +966 -292
- data/third_party/zlib/crc32.h +9441 -436
- data/third_party/zlib/deflate.c +78 -30
- data/third_party/zlib/deflate.h +12 -15
- data/third_party/zlib/gzguts.h +3 -2
- data/third_party/zlib/gzlib.c +5 -3
- data/third_party/zlib/gzread.c +5 -7
- data/third_party/zlib/gzwrite.c +25 -13
- data/third_party/zlib/infback.c +2 -1
- data/third_party/zlib/inffast.c +14 -14
- data/third_party/zlib/inflate.c +39 -8
- data/third_party/zlib/inflate.h +3 -2
- data/third_party/zlib/inftrees.c +3 -3
- data/third_party/zlib/trees.c +27 -48
- data/third_party/zlib/zlib.h +123 -100
- data/third_party/zlib/zutil.c +2 -2
- data/third_party/zlib/zutil.h +12 -9
- metadata +502 -247
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +0 -44
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +0 -83
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc +0 -31
- data/src/core/ext/filters/client_channel/resolver_registry.cc +0 -194
- data/src/core/ext/filters/client_channel/resolver_registry.h +0 -88
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +0 -264
- data/src/core/ext/filters/max_age/max_age_filter.cc +0 -560
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +0 -122
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +0 -92
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +0 -192
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +0 -52
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +0 -79
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +0 -125
- data/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +0 -37
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h +0 -107
- data/src/core/ext/transport/chttp2/transport/hpack_utils.cc +0 -46
- data/src/core/ext/transport/chttp2/transport/popularity_count.h +0 -60
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c +0 -38
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +0 -64
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +0 -38
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +0 -64
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +0 -38
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +0 -64
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +0 -38
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +0 -64
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +0 -38
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +0 -64
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c +0 -102
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.h +0 -306
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c +0 -56
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.h +0 -135
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c +0 -115
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.h +0 -371
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c +0 -67
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +0 -68
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +0 -67
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +0 -75
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c +0 -69
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h +0 -35
- data/src/core/lib/compression/algorithm_metadata.h +0 -62
- data/src/core/lib/compression/compression_args.cc +0 -140
- data/src/core/lib/compression/compression_args.h +0 -58
- data/src/core/lib/compression/stream_compression.cc +0 -81
- data/src/core/lib/compression/stream_compression.h +0 -117
- data/src/core/lib/compression/stream_compression_gzip.cc +0 -231
- data/src/core/lib/compression/stream_compression_gzip.h +0 -28
- data/src/core/lib/compression/stream_compression_identity.cc +0 -91
- data/src/core/lib/compression/stream_compression_identity.h +0 -29
- data/src/core/lib/event_engine/event_engine_factory.cc +0 -49
- data/src/core/lib/event_engine/sockaddr.cc +0 -40
- data/src/core/lib/event_engine/sockaddr.h +0 -44
- data/src/core/lib/iomgr/ev_epollex_linux.cc +0 -1654
- data/src/core/lib/iomgr/ev_epollex_linux.h +0 -30
- data/src/core/lib/iomgr/event_engine/closure.cc +0 -77
- data/src/core/lib/iomgr/event_engine/closure.h +0 -42
- data/src/core/lib/iomgr/event_engine/endpoint.cc +0 -172
- data/src/core/lib/iomgr/event_engine/endpoint.h +0 -52
- data/src/core/lib/iomgr/event_engine/iomgr.cc +0 -84
- data/src/core/lib/iomgr/event_engine/pollset.cc +0 -88
- data/src/core/lib/iomgr/event_engine/resolver.cc +0 -115
- data/src/core/lib/iomgr/event_engine/tcp.cc +0 -295
- data/src/core/lib/iomgr/event_engine/timer.cc +0 -63
- data/src/core/lib/iomgr/iomgr_custom.cc +0 -79
- data/src/core/lib/iomgr/iomgr_custom.h +0 -49
- data/src/core/lib/iomgr/is_epollexclusive_available.cc +0 -119
- data/src/core/lib/iomgr/pollset_custom.cc +0 -105
- data/src/core/lib/iomgr/pollset_custom.h +0 -37
- data/src/core/lib/iomgr/pollset_set_custom.cc +0 -47
- data/src/core/lib/iomgr/pollset_set_custom.h +0 -26
- data/src/core/lib/iomgr/resolve_address_custom.cc +0 -169
- data/src/core/lib/iomgr/resolve_address_custom.h +0 -44
- data/src/core/lib/iomgr/sys_epoll_wrapper.h +0 -30
- data/src/core/lib/iomgr/tcp_client_custom.cc +0 -146
- data/src/core/lib/iomgr/tcp_custom.cc +0 -350
- data/src/core/lib/iomgr/tcp_custom.h +0 -85
- data/src/core/lib/iomgr/tcp_server_custom.cc +0 -457
- data/src/core/lib/iomgr/timer_custom.cc +0 -96
- data/src/core/lib/iomgr/timer_custom.h +0 -43
- data/src/core/lib/security/authorization/sdk_server_authz_filter.cc +0 -173
- data/src/core/lib/security/authorization/sdk_server_authz_filter.h +0 -67
- data/src/core/lib/security/credentials/credentials_metadata.cc +0 -61
- data/src/core/lib/slice/slice_intern.cc +0 -367
- data/src/core/lib/slice/slice_split.cc +0 -100
- data/src/core/lib/slice/slice_split.h +0 -40
- data/src/core/lib/slice/slice_utils.h +0 -200
- data/src/core/lib/slice/static_slice.cc +0 -377
- data/src/core/lib/slice/static_slice.h +0 -300
- data/src/core/lib/surface/init_secure.cc +0 -103
- data/src/core/lib/transport/byte_stream.cc +0 -162
- data/src/core/lib/transport/byte_stream.h +0 -166
- data/src/core/lib/transport/metadata.cc +0 -714
- data/src/core/lib/transport/metadata.h +0 -449
- data/src/core/lib/transport/static_metadata.cc +0 -1032
- data/src/core/lib/transport/static_metadata.h +0 -322
- data/src/core/lib/transport/status_metadata.cc +0 -63
- data/src/core/lib/transport/status_metadata.h +0 -48
- data/third_party/abseil-cpp/absl/container/internal/have_sse.h +0 -50
- data/third_party/cares/cares/ares_getopt.c +0 -122
- data/third_party/cares/cares/ares_getopt.h +0 -53
- data/third_party/cares/cares/ares_parse_a_reply.c +0 -264
- data/third_party/cares/cares/ares_parse_aaaa_reply.c +0 -264
- data/third_party/cares/cares/ares_parse_soa_reply.c +0 -133
- /data/third_party/cares/cares/{ares_rules.h → include/ares_rules.h} +0 -0
- /data/third_party/cares/cares/{ares__read_line.c → src/lib/ares__read_line.c} +0 -0
- /data/third_party/cares/cares/{ares__timeval.c → src/lib/ares__timeval.c} +0 -0
- /data/third_party/cares/cares/{ares_cancel.c → src/lib/ares_cancel.c} +0 -0
- /data/third_party/cares/cares/{ares_destroy.c → src/lib/ares_destroy.c} +0 -0
- /data/third_party/cares/cares/{ares_fds.c → src/lib/ares_fds.c} +0 -0
- /data/third_party/cares/cares/{ares_free_string.c → src/lib/ares_free_string.c} +0 -0
- /data/third_party/cares/cares/{ares_getenv.h → src/lib/ares_getenv.h} +0 -0
- /data/third_party/cares/cares/{ares_getsock.c → src/lib/ares_getsock.c} +0 -0
- /data/third_party/cares/cares/{ares_inet_net_pton.h → src/lib/ares_inet_net_pton.h} +0 -0
- /data/third_party/cares/cares/{ares_iphlpapi.h → src/lib/ares_iphlpapi.h} +0 -0
- /data/third_party/cares/cares/{ares_llist.c → src/lib/ares_llist.c} +0 -0
- /data/third_party/cares/cares/{ares_llist.h → src/lib/ares_llist.h} +0 -0
- /data/third_party/cares/cares/{ares_mkquery.c → src/lib/ares_mkquery.c} +0 -0
- /data/third_party/cares/cares/{ares_nowarn.c → src/lib/ares_nowarn.c} +0 -0
- /data/third_party/cares/cares/{ares_nowarn.h → src/lib/ares_nowarn.h} +0 -0
- /data/third_party/cares/cares/{ares_options.c → src/lib/ares_options.c} +0 -0
- /data/third_party/cares/cares/{ares_platform.c → src/lib/ares_platform.c} +0 -0
- /data/third_party/cares/cares/{ares_platform.h → src/lib/ares_platform.h} +0 -0
- /data/third_party/cares/cares/{ares_strcasecmp.c → src/lib/ares_strcasecmp.c} +0 -0
- /data/third_party/cares/cares/{ares_strcasecmp.h → src/lib/ares_strcasecmp.h} +0 -0
- /data/third_party/cares/cares/{ares_strdup.c → src/lib/ares_strdup.c} +0 -0
- /data/third_party/cares/cares/{ares_strdup.h → src/lib/ares_strdup.h} +0 -0
- /data/third_party/cares/cares/{ares_strerror.c → src/lib/ares_strerror.c} +0 -0
- /data/third_party/cares/cares/{ares_strsplit.h → src/lib/ares_strsplit.h} +0 -0
- /data/third_party/cares/cares/{ares_timeout.c → src/lib/ares_timeout.c} +0 -0
- /data/third_party/cares/cares/{ares_version.c → src/lib/ares_version.c} +0 -0
- /data/third_party/cares/cares/{ares_writev.c → src/lib/ares_writev.c} +0 -0
- /data/third_party/cares/cares/{bitncmp.c → src/lib/bitncmp.c} +0 -0
- /data/third_party/cares/cares/{bitncmp.h → src/lib/bitncmp.h} +0 -0
- /data/third_party/cares/cares/{config-win32.h → src/lib/config-win32.h} +0 -0
- /data/third_party/cares/cares/{setup_once.h → src/lib/setup_once.h} +0 -0
- /data/third_party/cares/cares/{windows_port.c → src/lib/windows_port.c} +0 -0
@@ -20,39 +20,54 @@
|
|
20
20
|
|
21
21
|
#include "src/core/lib/surface/call.h"
|
22
22
|
|
23
|
-
#include <assert.h>
|
24
23
|
#include <limits.h>
|
25
|
-
#include <stdio.h>
|
26
24
|
#include <stdlib.h>
|
27
|
-
#include <string.h>
|
28
25
|
|
26
|
+
#include <algorithm>
|
27
|
+
#include <atomic>
|
28
|
+
#include <new>
|
29
29
|
#include <string>
|
30
|
+
#include <utility>
|
30
31
|
|
32
|
+
#include "absl/base/thread_annotations.h"
|
33
|
+
#include "absl/meta/type_traits.h"
|
34
|
+
#include "absl/status/status.h"
|
31
35
|
#include "absl/strings/str_cat.h"
|
32
36
|
#include "absl/strings/str_format.h"
|
37
|
+
#include "absl/strings/string_view.h"
|
33
38
|
|
39
|
+
#include <grpc/byte_buffer.h>
|
34
40
|
#include <grpc/compression.h>
|
35
41
|
#include <grpc/grpc.h>
|
42
|
+
#include <grpc/impl/codegen/gpr_types.h>
|
43
|
+
#include <grpc/impl/codegen/propagation_bits.h>
|
36
44
|
#include <grpc/slice.h>
|
45
|
+
#include <grpc/slice_buffer.h>
|
46
|
+
#include <grpc/status.h>
|
37
47
|
#include <grpc/support/alloc.h>
|
48
|
+
#include <grpc/support/atm.h>
|
38
49
|
#include <grpc/support/log.h>
|
39
50
|
#include <grpc/support/string_util.h>
|
40
51
|
|
41
52
|
#include "src/core/lib/channel/channel_stack.h"
|
42
|
-
#include "src/core/lib/
|
53
|
+
#include "src/core/lib/channel/channelz.h"
|
54
|
+
#include "src/core/lib/channel/context.h"
|
55
|
+
#include "src/core/lib/compression/compression_internal.h"
|
43
56
|
#include "src/core/lib/debug/stats.h"
|
44
57
|
#include "src/core/lib/gpr/alloc.h"
|
45
|
-
#include "src/core/lib/gpr/string.h"
|
46
58
|
#include "src/core/lib/gpr/time_precise.h"
|
47
|
-
#include "src/core/lib/
|
48
|
-
#include "src/core/lib/gprpp/
|
49
|
-
#include "src/core/lib/gprpp/manual_constructor.h"
|
59
|
+
#include "src/core/lib/gprpp/cpp_impl_of.h"
|
60
|
+
#include "src/core/lib/gprpp/debug_location.h"
|
50
61
|
#include "src/core/lib/gprpp/ref_counted.h"
|
51
|
-
#include "src/core/lib/
|
62
|
+
#include "src/core/lib/gprpp/sync.h"
|
63
|
+
#include "src/core/lib/iomgr/call_combiner.h"
|
64
|
+
#include "src/core/lib/iomgr/exec_ctx.h"
|
65
|
+
#include "src/core/lib/iomgr/polling_entity.h"
|
52
66
|
#include "src/core/lib/profiling/timers.h"
|
53
|
-
#include "src/core/lib/
|
54
|
-
#include "src/core/lib/slice/
|
55
|
-
#include "src/core/lib/slice/
|
67
|
+
#include "src/core/lib/resource_quota/arena.h"
|
68
|
+
#include "src/core/lib/slice/slice_buffer.h"
|
69
|
+
#include "src/core/lib/slice/slice_internal.h"
|
70
|
+
#include "src/core/lib/slice/slice_refcount.h"
|
56
71
|
#include "src/core/lib/surface/api_trace.h"
|
57
72
|
#include "src/core/lib/surface/call_test_only.h"
|
58
73
|
#include "src/core/lib/surface/channel.h"
|
@@ -60,188 +75,341 @@
|
|
60
75
|
#include "src/core/lib/surface/server.h"
|
61
76
|
#include "src/core/lib/surface/validate_metadata.h"
|
62
77
|
#include "src/core/lib/transport/error_utils.h"
|
63
|
-
#include "src/core/lib/transport/
|
64
|
-
#include "src/core/lib/transport/static_metadata.h"
|
65
|
-
#include "src/core/lib/transport/status_metadata.h"
|
78
|
+
#include "src/core/lib/transport/metadata_batch.h"
|
66
79
|
#include "src/core/lib/transport/transport.h"
|
67
80
|
|
68
|
-
|
69
|
-
|
70
|
-
api:
|
71
|
-
- initial metadata send
|
72
|
-
- message send
|
73
|
-
- status/close send (depending on client/server)
|
74
|
-
- initial metadata recv
|
75
|
-
- message recv
|
76
|
-
- status/close recv (depending on client/server) */
|
77
|
-
#define MAX_CONCURRENT_BATCHES 6
|
78
|
-
|
79
|
-
#define MAX_SEND_EXTRA_METADATA_COUNT 3
|
80
|
-
|
81
|
-
// Used to create arena for the first call.
|
82
|
-
#define ESTIMATED_MDELEM_COUNT 16
|
83
|
-
|
84
|
-
struct batch_control {
|
85
|
-
batch_control() = default;
|
86
|
-
|
87
|
-
grpc_call* call = nullptr;
|
88
|
-
grpc_transport_stream_op_batch op;
|
89
|
-
/* Share memory for cq_completion and notify_tag as they are never needed
|
90
|
-
simultaneously. Each byte used in this data structure count as six bytes
|
91
|
-
per call, so any savings we can make are worthwhile,
|
92
|
-
|
93
|
-
We use notify_tag to determine whether or not to send notification to the
|
94
|
-
completion queue. Once we've made that determination, we can reuse the
|
95
|
-
memory for cq_completion. */
|
96
|
-
union {
|
97
|
-
grpc_cq_completion cq_completion;
|
98
|
-
struct {
|
99
|
-
/* Any given op indicates completion by either (a) calling a closure or
|
100
|
-
(b) sending a notification on the call's completion queue. If
|
101
|
-
\a is_closure is true, \a tag indicates a closure to be invoked;
|
102
|
-
otherwise, \a tag indicates the tag to be used in the notification to
|
103
|
-
be sent to the completion queue. */
|
104
|
-
void* tag;
|
105
|
-
bool is_closure;
|
106
|
-
} notify_tag;
|
107
|
-
} completion_data;
|
108
|
-
grpc_closure start_batch;
|
109
|
-
grpc_closure finish_batch;
|
110
|
-
std::atomic<intptr_t> steps_to_complete{0};
|
111
|
-
AtomicError batch_error;
|
112
|
-
void set_num_steps_to_complete(uintptr_t steps) {
|
113
|
-
steps_to_complete.store(steps, std::memory_order_release);
|
114
|
-
}
|
115
|
-
bool completed_batch_step() {
|
116
|
-
return steps_to_complete.fetch_sub(1, std::memory_order_acq_rel) == 1;
|
117
|
-
}
|
118
|
-
};
|
81
|
+
grpc_core::TraceFlag grpc_call_error_trace(false, "call_error");
|
82
|
+
grpc_core::TraceFlag grpc_compression_trace(false, "compression");
|
119
83
|
|
120
|
-
|
121
|
-
parent_call() { gpr_mu_init(&child_list_mu); }
|
122
|
-
~parent_call() { gpr_mu_destroy(&child_list_mu); }
|
84
|
+
namespace grpc_core {
|
123
85
|
|
124
|
-
|
125
|
-
|
126
|
-
}
|
86
|
+
class Call : public CppImplOf<Call, grpc_call> {
|
87
|
+
public:
|
88
|
+
Arena* arena() { return arena_; }
|
89
|
+
bool is_client() const { return is_client_; }
|
90
|
+
|
91
|
+
virtual void ContextSet(grpc_context_index elem, void* value,
|
92
|
+
void (*destroy)(void* value)) = 0;
|
93
|
+
virtual void* ContextGet(grpc_context_index elem) const = 0;
|
94
|
+
virtual bool Completed() = 0;
|
95
|
+
void CancelWithStatus(grpc_status_code status, const char* description);
|
96
|
+
virtual void CancelWithError(grpc_error_handle error) = 0;
|
97
|
+
virtual void SetCompletionQueue(grpc_completion_queue* cq) = 0;
|
98
|
+
virtual char* GetPeer() = 0;
|
99
|
+
virtual grpc_call_error StartBatch(const grpc_op* ops, size_t nops,
|
100
|
+
void* notify_tag,
|
101
|
+
bool is_notify_tag_closure) = 0;
|
102
|
+
virtual bool failed_before_recv_message() const = 0;
|
103
|
+
virtual bool is_trailers_only() const = 0;
|
104
|
+
virtual absl::string_view GetServerAuthority() const = 0;
|
105
|
+
virtual void ExternalRef() = 0;
|
106
|
+
virtual void ExternalUnref() = 0;
|
107
|
+
virtual void InternalRef(const char* reason) = 0;
|
108
|
+
virtual void InternalUnref(const char* reason) = 0;
|
109
|
+
|
110
|
+
virtual grpc_compression_algorithm test_only_compression_algorithm() = 0;
|
111
|
+
virtual uint32_t test_only_message_flags() = 0;
|
112
|
+
virtual uint32_t test_only_encodings_accepted_by_peer() = 0;
|
113
|
+
virtual grpc_compression_algorithm compression_for_level(
|
114
|
+
grpc_compression_level level) = 0;
|
115
|
+
|
116
|
+
// This should return nullptr for the promise stack (and alternative means
|
117
|
+
// for that functionality be invented)
|
118
|
+
virtual grpc_call_stack* call_stack() = 0;
|
119
|
+
|
120
|
+
protected:
|
121
|
+
Call(Arena* arena, bool is_client, Timestamp send_deadline)
|
122
|
+
: arena_(arena), send_deadline_(send_deadline), is_client_(is_client) {
|
123
|
+
GPR_DEBUG_ASSERT(arena_ != nullptr);
|
124
|
+
}
|
125
|
+
~Call() = default;
|
126
|
+
|
127
|
+
struct ParentCall {
|
128
|
+
Mutex child_list_mu;
|
129
|
+
Call* first_child ABSL_GUARDED_BY(child_list_mu) = nullptr;
|
130
|
+
};
|
131
|
+
|
132
|
+
struct ChildCall {
|
133
|
+
explicit ChildCall(Call* parent) : parent(parent) {}
|
134
|
+
Call* parent;
|
135
|
+
/** siblings: children of the same parent form a list, and this list is
|
136
|
+
protected under
|
137
|
+
parent->mu */
|
138
|
+
Call* sibling_next = nullptr;
|
139
|
+
Call* sibling_prev = nullptr;
|
140
|
+
};
|
141
|
+
|
142
|
+
ParentCall* GetOrCreateParentCall();
|
143
|
+
ParentCall* parent_call();
|
144
|
+
|
145
|
+
absl::Status InitParent(Call* parent, uint32_t propagation_mask);
|
146
|
+
void PublishToParent(Call* parent);
|
147
|
+
void MaybeUnpublishFromParent();
|
148
|
+
void PropagateCancellationToChildren();
|
149
|
+
|
150
|
+
Timestamp send_deadline() const { return send_deadline_; }
|
151
|
+
void set_send_deadline(Timestamp send_deadline) {
|
152
|
+
send_deadline_ = send_deadline;
|
153
|
+
}
|
127
154
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
155
|
+
private:
|
156
|
+
Arena* const arena_;
|
157
|
+
std::atomic<ParentCall*> parent_call_{nullptr};
|
158
|
+
ChildCall* child_ = nullptr;
|
159
|
+
Timestamp send_deadline_;
|
160
|
+
const bool is_client_;
|
161
|
+
// flag indicating that cancellation is inherited
|
162
|
+
bool cancellation_is_inherited_ = false;
|
136
163
|
};
|
137
164
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
struct grpc_call {
|
142
|
-
grpc_call(grpc_core::Arena* arena, const grpc_call_create_args& args)
|
143
|
-
: arena(arena),
|
144
|
-
cq(args.cq),
|
145
|
-
channel(args.channel),
|
146
|
-
is_client(args.server_transport_data == nullptr),
|
147
|
-
stream_op_payload(context) {}
|
148
|
-
|
149
|
-
~grpc_call() {
|
165
|
+
class FilterStackCall final : public Call {
|
166
|
+
public:
|
167
|
+
~FilterStackCall() {
|
150
168
|
for (int i = 0; i < GRPC_CONTEXT_COUNT; ++i) {
|
151
|
-
if (
|
152
|
-
|
169
|
+
if (context_[i].destroy) {
|
170
|
+
context_[i].destroy(context_[i].value);
|
153
171
|
}
|
154
172
|
}
|
155
|
-
gpr_free(static_cast<void*>(const_cast<char*>(
|
173
|
+
gpr_free(static_cast<void*>(const_cast<char*>(final_info_.error_string)));
|
174
|
+
}
|
175
|
+
|
176
|
+
bool Completed() override {
|
177
|
+
return gpr_atm_acq_load(&received_final_op_atm_) != 0;
|
178
|
+
}
|
179
|
+
|
180
|
+
// TODO(ctiller): return absl::StatusOr<SomeSmartPointer<Call>>?
|
181
|
+
static grpc_error_handle Create(grpc_call_create_args* args,
|
182
|
+
grpc_call** out_call);
|
183
|
+
|
184
|
+
static Call* FromTopElem(grpc_call_element* elem) {
|
185
|
+
return FromCallStack(grpc_call_stack_from_top_element(elem));
|
186
|
+
}
|
187
|
+
|
188
|
+
grpc_call_stack* call_stack() override {
|
189
|
+
return reinterpret_cast<grpc_call_stack*>(
|
190
|
+
reinterpret_cast<char*>(this) +
|
191
|
+
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(*this)));
|
156
192
|
}
|
157
193
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
194
|
+
grpc_call_element* call_elem(size_t idx) {
|
195
|
+
return grpc_call_stack_element(call_stack(), idx);
|
196
|
+
}
|
197
|
+
|
198
|
+
CallCombiner* call_combiner() { return &call_combiner_; }
|
199
|
+
|
200
|
+
void CancelWithError(grpc_error_handle error) override;
|
201
|
+
void SetCompletionQueue(grpc_completion_queue* cq) override;
|
202
|
+
char* GetPeer() override;
|
203
|
+
grpc_call_error StartBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
204
|
+
bool is_notify_tag_closure) override;
|
205
|
+
void ExternalRef() override { ext_ref_.Ref(); }
|
206
|
+
void ExternalUnref() override;
|
207
|
+
void InternalRef(const char* reason) override {
|
208
|
+
GRPC_CALL_STACK_REF(call_stack(), reason);
|
209
|
+
}
|
210
|
+
void InternalUnref(const char* reason) override {
|
211
|
+
GRPC_CALL_STACK_UNREF(call_stack(), reason);
|
212
|
+
}
|
213
|
+
|
214
|
+
void ContextSet(grpc_context_index elem, void* value,
|
215
|
+
void (*destroy)(void* value)) override;
|
216
|
+
void* ContextGet(grpc_context_index elem) const override {
|
217
|
+
return context_[elem].value;
|
218
|
+
}
|
219
|
+
|
220
|
+
grpc_compression_algorithm compression_for_level(
|
221
|
+
grpc_compression_level level) override {
|
222
|
+
return encodings_accepted_by_peer_.CompressionAlgorithmForLevel(level);
|
223
|
+
}
|
224
|
+
|
225
|
+
bool is_trailers_only() const override {
|
226
|
+
bool result = is_trailers_only_;
|
227
|
+
GPR_DEBUG_ASSERT(!result || recv_initial_metadata_.TransportSize() == 0);
|
228
|
+
return result;
|
229
|
+
}
|
230
|
+
|
231
|
+
bool failed_before_recv_message() const override {
|
232
|
+
return call_failed_before_recv_message_;
|
233
|
+
}
|
234
|
+
|
235
|
+
absl::string_view GetServerAuthority() const override {
|
236
|
+
const Slice* authority_metadata =
|
237
|
+
recv_initial_metadata_.get_pointer(HttpAuthorityMetadata());
|
238
|
+
if (authority_metadata == nullptr) return "";
|
239
|
+
return authority_metadata->as_string_view();
|
240
|
+
}
|
241
|
+
|
242
|
+
grpc_compression_algorithm test_only_compression_algorithm() override {
|
243
|
+
return incoming_compression_algorithm_;
|
244
|
+
}
|
245
|
+
|
246
|
+
uint32_t test_only_message_flags() override {
|
247
|
+
return test_only_last_message_flags_;
|
248
|
+
}
|
249
|
+
|
250
|
+
uint32_t test_only_encodings_accepted_by_peer() override {
|
251
|
+
return encodings_accepted_by_peer_.ToLegacyBitmask();
|
252
|
+
}
|
253
|
+
|
254
|
+
static size_t InitialSizeEstimate() {
|
255
|
+
return sizeof(FilterStackCall) +
|
256
|
+
sizeof(BatchControl) * kMaxConcurrentBatches;
|
257
|
+
}
|
258
|
+
|
259
|
+
private:
|
260
|
+
// The maximum number of concurrent batches possible.
|
261
|
+
// Based upon the maximum number of individually queueable ops in the batch
|
262
|
+
// api:
|
263
|
+
// - initial metadata send
|
264
|
+
// - message send
|
265
|
+
// - status/close send (depending on client/server)
|
266
|
+
// - initial metadata recv
|
267
|
+
// - message recv
|
268
|
+
// - status/close recv (depending on client/server)
|
269
|
+
static constexpr size_t kMaxConcurrentBatches = 6;
|
270
|
+
|
271
|
+
static constexpr gpr_atm kRecvNone = 0;
|
272
|
+
static constexpr gpr_atm kRecvInitialMetadataFirst = 1;
|
273
|
+
|
274
|
+
struct BatchControl {
|
275
|
+
FilterStackCall* call_ = nullptr;
|
276
|
+
grpc_transport_stream_op_batch op_;
|
277
|
+
/* Share memory for cq_completion and notify_tag as they are never needed
|
278
|
+
simultaneously. Each byte used in this data structure count as six bytes
|
279
|
+
per call, so any savings we can make are worthwhile,
|
280
|
+
|
281
|
+
We use notify_tag to determine whether or not to send notification to the
|
282
|
+
completion queue. Once we've made that determination, we can reuse the
|
283
|
+
memory for cq_completion. */
|
284
|
+
union {
|
285
|
+
grpc_cq_completion cq_completion;
|
286
|
+
struct {
|
287
|
+
/* Any given op indicates completion by either (a) calling a closure or
|
288
|
+
(b) sending a notification on the call's completion queue. If
|
289
|
+
\a is_closure is true, \a tag indicates a closure to be invoked;
|
290
|
+
otherwise, \a tag indicates the tag to be used in the notification to
|
291
|
+
be sent to the completion queue. */
|
292
|
+
void* tag;
|
293
|
+
bool is_closure;
|
294
|
+
} notify_tag;
|
295
|
+
} completion_data_;
|
296
|
+
grpc_closure start_batch_;
|
297
|
+
grpc_closure finish_batch_;
|
298
|
+
std::atomic<intptr_t> steps_to_complete_{0};
|
299
|
+
AtomicError batch_error_;
|
300
|
+
void set_num_steps_to_complete(uintptr_t steps) {
|
301
|
+
steps_to_complete_.store(steps, std::memory_order_release);
|
302
|
+
}
|
303
|
+
bool completed_batch_step() {
|
304
|
+
return steps_to_complete_.fetch_sub(1, std::memory_order_acq_rel) == 1;
|
305
|
+
}
|
306
|
+
|
307
|
+
void PostCompletion();
|
308
|
+
void FinishStep();
|
309
|
+
void ProcessDataAfterMetadata();
|
310
|
+
void ReceivingStreamReady(grpc_error_handle error);
|
311
|
+
void ValidateFilteredMetadata();
|
312
|
+
void ReceivingInitialMetadataReady(grpc_error_handle error);
|
313
|
+
void ReceivingTrailingMetadataReady(grpc_error_handle error);
|
314
|
+
void FinishBatch(grpc_error_handle error);
|
315
|
+
};
|
316
|
+
|
317
|
+
FilterStackCall(Arena* arena, const grpc_call_create_args& args)
|
318
|
+
: Call(arena, args.server_transport_data == nullptr, args.send_deadline),
|
319
|
+
cq_(args.cq),
|
320
|
+
channel_(args.channel->Ref()),
|
321
|
+
stream_op_payload_(context_) {}
|
322
|
+
|
323
|
+
static void ReleaseCall(void* call, grpc_error_handle);
|
324
|
+
static void DestroyCall(void* call, grpc_error_handle);
|
325
|
+
|
326
|
+
static FilterStackCall* FromCallStack(grpc_call_stack* call_stack) {
|
327
|
+
return reinterpret_cast<FilterStackCall*>(
|
328
|
+
reinterpret_cast<char*>(call_stack) -
|
329
|
+
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(FilterStackCall)));
|
330
|
+
}
|
331
|
+
|
332
|
+
void ExecuteBatch(grpc_transport_stream_op_batch* batch,
|
333
|
+
grpc_closure* start_batch_closure);
|
334
|
+
void SetFinalStatus(grpc_error_handle error);
|
335
|
+
BatchControl* ReuseOrAllocateBatchControl(const grpc_op* ops);
|
336
|
+
void HandleCompressionAlgorithmDisabled(
|
337
|
+
grpc_compression_algorithm compression_algorithm) GPR_ATTRIBUTE_NOINLINE;
|
338
|
+
void HandleCompressionAlgorithmNotAccepted(
|
339
|
+
grpc_compression_algorithm compression_algorithm) GPR_ATTRIBUTE_NOINLINE;
|
340
|
+
bool PrepareApplicationMetadata(size_t count, grpc_metadata* metadata,
|
341
|
+
bool is_trailing);
|
342
|
+
void PublishAppMetadata(grpc_metadata_batch* b, bool is_trailing);
|
343
|
+
void RecvInitialFilter(grpc_metadata_batch* b);
|
344
|
+
void RecvTrailingFilter(grpc_metadata_batch* b,
|
345
|
+
grpc_error_handle batch_error);
|
346
|
+
|
347
|
+
RefCount ext_ref_;
|
348
|
+
CallCombiner call_combiner_;
|
349
|
+
grpc_completion_queue* cq_;
|
350
|
+
grpc_polling_entity pollent_;
|
351
|
+
RefCountedPtr<Channel> channel_;
|
352
|
+
gpr_cycle_counter start_time_ = gpr_get_cycle_counter();
|
167
353
|
|
168
|
-
/* client or server call */
|
169
|
-
bool is_client;
|
170
354
|
/** has grpc_call_unref been called */
|
171
|
-
bool
|
172
|
-
/** flag indicating that cancellation is inherited */
|
173
|
-
bool cancellation_is_inherited = false;
|
355
|
+
bool destroy_called_ = false;
|
174
356
|
// Trailers-only response status
|
175
|
-
bool
|
357
|
+
bool is_trailers_only_ = false;
|
176
358
|
/** which ops are in-flight */
|
177
|
-
bool
|
178
|
-
bool
|
179
|
-
bool
|
180
|
-
bool
|
181
|
-
bool
|
182
|
-
bool
|
183
|
-
gpr_atm
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
grpc_transport_stream_op_batch_payload stream_op_payload;
|
359
|
+
bool sent_initial_metadata_ = false;
|
360
|
+
bool sending_message_ = false;
|
361
|
+
bool sent_final_op_ = false;
|
362
|
+
bool received_initial_metadata_ = false;
|
363
|
+
bool receiving_message_ = false;
|
364
|
+
bool requested_final_op_ = false;
|
365
|
+
gpr_atm received_final_op_atm_ = 0;
|
366
|
+
|
367
|
+
BatchControl* active_batches_[kMaxConcurrentBatches] = {};
|
368
|
+
grpc_transport_stream_op_batch_payload stream_op_payload_;
|
188
369
|
|
189
370
|
/* first idx: is_receiving, second idx: is_trailing */
|
190
|
-
grpc_metadata_batch
|
191
|
-
grpc_metadata_batch
|
192
|
-
grpc_metadata_batch
|
193
|
-
grpc_metadata_batch
|
371
|
+
grpc_metadata_batch send_initial_metadata_{arena()};
|
372
|
+
grpc_metadata_batch send_trailing_metadata_{arena()};
|
373
|
+
grpc_metadata_batch recv_initial_metadata_{arena()};
|
374
|
+
grpc_metadata_batch recv_trailing_metadata_{arena()};
|
194
375
|
|
195
376
|
/* Buffered read metadata waiting to be returned to the application.
|
196
377
|
Element 0 is initial metadata, element 1 is trailing metadata. */
|
197
|
-
grpc_metadata_array*
|
198
|
-
|
199
|
-
grpc_metadata compression_md;
|
378
|
+
grpc_metadata_array* buffered_metadata_[2] = {};
|
200
379
|
|
201
380
|
// A char* indicating the peer name.
|
202
|
-
gpr_atm
|
381
|
+
gpr_atm peer_string_ = 0;
|
203
382
|
|
204
383
|
/* Call data useful used for reporting. Only valid after the call has
|
205
384
|
* completed */
|
206
|
-
grpc_call_final_info
|
385
|
+
grpc_call_final_info final_info_;
|
207
386
|
|
208
387
|
/* Compression algorithm for *incoming* data */
|
209
|
-
|
210
|
-
|
211
|
-
/* Stream compression algorithm for *incoming* data */
|
212
|
-
grpc_stream_compression_algorithm incoming_stream_compression_algorithm =
|
213
|
-
GRPC_STREAM_COMPRESS_NONE;
|
388
|
+
grpc_compression_algorithm incoming_compression_algorithm_ =
|
389
|
+
GRPC_COMPRESS_NONE;
|
214
390
|
/* Supported encodings (compression algorithms), a bitset.
|
215
391
|
* Always support no compression. */
|
216
|
-
|
217
|
-
/* Supported stream encodings (stream compression algorithms), a bitset */
|
218
|
-
uint32_t stream_encodings_accepted_by_peer = 0;
|
392
|
+
CompressionAlgorithmSet encodings_accepted_by_peer_{GRPC_COMPRESS_NONE};
|
219
393
|
|
220
394
|
/* Contexts for various subsystems (security, tracing, ...). */
|
221
|
-
grpc_call_context_element
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
grpc_slice receiving_slice = grpc_empty_slice();
|
235
|
-
grpc_closure receiving_slice_ready;
|
236
|
-
grpc_closure receiving_stream_ready;
|
237
|
-
grpc_closure receiving_initial_metadata_ready;
|
238
|
-
grpc_closure receiving_trailing_metadata_ready;
|
239
|
-
uint32_t test_only_last_message_flags = 0;
|
395
|
+
grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {};
|
396
|
+
|
397
|
+
SliceBuffer send_slice_buffer_;
|
398
|
+
absl::optional<SliceBuffer> receiving_slice_buffer_;
|
399
|
+
uint32_t receiving_stream_flags_;
|
400
|
+
|
401
|
+
bool call_failed_before_recv_message_ = false;
|
402
|
+
grpc_byte_buffer** receiving_buffer_ = nullptr;
|
403
|
+
grpc_slice receiving_slice_ = grpc_empty_slice();
|
404
|
+
grpc_closure receiving_stream_ready_;
|
405
|
+
grpc_closure receiving_initial_metadata_ready_;
|
406
|
+
grpc_closure receiving_trailing_metadata_ready_;
|
407
|
+
uint32_t test_only_last_message_flags_ = 0;
|
240
408
|
// Status about operation of call
|
241
|
-
bool
|
242
|
-
gpr_atm
|
409
|
+
bool sent_server_trailing_metadata_ = false;
|
410
|
+
gpr_atm cancelled_with_error_ = 0;
|
243
411
|
|
244
|
-
grpc_closure
|
412
|
+
grpc_closure release_call_;
|
245
413
|
|
246
414
|
union {
|
247
415
|
struct {
|
@@ -252,10 +420,10 @@ struct grpc_call {
|
|
252
420
|
struct {
|
253
421
|
int* cancelled;
|
254
422
|
// backpointer to owning server if this is a server side call.
|
255
|
-
|
423
|
+
Server* core_server;
|
256
424
|
} server;
|
257
|
-
}
|
258
|
-
AtomicError
|
425
|
+
} final_op_;
|
426
|
+
AtomicError status_error_;
|
259
427
|
|
260
428
|
/* recv_state can contain one of the following values:
|
261
429
|
RECV_NONE : : no initial metadata and messages received
|
@@ -273,226 +441,176 @@ struct grpc_call {
|
|
273
441
|
|
274
442
|
For 1, 4: See receiving_initial_metadata_ready() function
|
275
443
|
For 2, 3: See receiving_stream_ready() function */
|
276
|
-
gpr_atm
|
444
|
+
gpr_atm recv_state_ = 0;
|
277
445
|
};
|
278
446
|
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
#define CALL_STACK_FROM_CALL(call) \
|
283
|
-
(grpc_call_stack*)((char*)(call) + \
|
284
|
-
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call)))
|
285
|
-
#define CALL_FROM_CALL_STACK(call_stack) \
|
286
|
-
(grpc_call*)(((char*)(call_stack)) - \
|
287
|
-
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call)))
|
288
|
-
|
289
|
-
#define CALL_ELEM_FROM_CALL(call, idx) \
|
290
|
-
grpc_call_stack_element(CALL_STACK_FROM_CALL(call), idx)
|
291
|
-
#define CALL_FROM_TOP_ELEM(top_elem) \
|
292
|
-
CALL_FROM_CALL_STACK(grpc_call_stack_from_top_element(top_elem))
|
293
|
-
|
294
|
-
static void execute_batch(grpc_call* call,
|
295
|
-
grpc_transport_stream_op_batch* batch,
|
296
|
-
grpc_closure* start_batch_closure);
|
297
|
-
|
298
|
-
static void cancel_with_status(grpc_call* c, grpc_status_code status,
|
299
|
-
const char* description);
|
300
|
-
static void cancel_with_error(grpc_call* c, grpc_error_handle error);
|
301
|
-
static void destroy_call(void* call_stack, grpc_error_handle error);
|
302
|
-
static void receiving_slice_ready(void* bctlp, grpc_error_handle error);
|
303
|
-
static void set_final_status(grpc_call* call, grpc_error_handle error);
|
304
|
-
static void process_data_after_md(batch_control* bctl);
|
305
|
-
static void post_batch_completion(batch_control* bctl);
|
306
|
-
|
307
|
-
static void add_init_error(grpc_error_handle* composite,
|
308
|
-
grpc_error_handle new_err) {
|
309
|
-
if (new_err == GRPC_ERROR_NONE) return;
|
310
|
-
if (*composite == GRPC_ERROR_NONE) {
|
311
|
-
*composite = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Call creation failed");
|
312
|
-
}
|
313
|
-
*composite = grpc_error_add_child(*composite, new_err);
|
314
|
-
}
|
315
|
-
|
316
|
-
void* grpc_call_arena_alloc(grpc_call* call, size_t size) {
|
317
|
-
return call->arena->Alloc(size);
|
318
|
-
}
|
319
|
-
|
320
|
-
static parent_call* get_or_create_parent_call(grpc_call* call) {
|
321
|
-
parent_call* p =
|
322
|
-
reinterpret_cast<parent_call*>(gpr_atm_acq_load(&call->parent_call_atm));
|
447
|
+
Call::ParentCall* Call::GetOrCreateParentCall() {
|
448
|
+
ParentCall* p = parent_call_.load(std::memory_order_acquire);
|
323
449
|
if (p == nullptr) {
|
324
|
-
p =
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
p
|
330
|
-
|
450
|
+
p = arena_->New<ParentCall>();
|
451
|
+
ParentCall* expected = nullptr;
|
452
|
+
if (!parent_call_.compare_exchange_strong(expected, p,
|
453
|
+
std::memory_order_release,
|
454
|
+
std::memory_order_relaxed)) {
|
455
|
+
p->~ParentCall();
|
456
|
+
p = expected;
|
331
457
|
}
|
332
458
|
}
|
333
459
|
return p;
|
334
460
|
}
|
335
461
|
|
336
|
-
|
337
|
-
return
|
338
|
-
gpr_atm_acq_load(&call->parent_call_atm));
|
462
|
+
Call::ParentCall* Call::parent_call() {
|
463
|
+
return parent_call_.load(std::memory_order_acquire);
|
339
464
|
}
|
340
465
|
|
341
|
-
|
342
|
-
|
343
|
-
|
466
|
+
absl::Status Call::InitParent(Call* parent, uint32_t propagation_mask) {
|
467
|
+
child_ = arena()->New<ChildCall>(parent);
|
468
|
+
|
469
|
+
parent->InternalRef("child");
|
470
|
+
GPR_ASSERT(is_client_);
|
471
|
+
GPR_ASSERT(!parent->is_client_);
|
472
|
+
|
473
|
+
if (propagation_mask & GRPC_PROPAGATE_DEADLINE) {
|
474
|
+
send_deadline_ = std::min(send_deadline_, parent->send_deadline_);
|
475
|
+
}
|
476
|
+
/* for now GRPC_PROPAGATE_TRACING_CONTEXT *MUST* be passed with
|
477
|
+
* GRPC_PROPAGATE_STATS_CONTEXT */
|
478
|
+
/* TODO(ctiller): This should change to use the appropriate census start_op
|
479
|
+
* call. */
|
480
|
+
if (propagation_mask & GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT) {
|
481
|
+
if (0 == (propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT)) {
|
482
|
+
return absl::UnknownError(
|
483
|
+
"Census tracing propagation requested without Census context "
|
484
|
+
"propagation");
|
485
|
+
}
|
486
|
+
ContextSet(GRPC_CONTEXT_TRACING, parent->ContextGet(GRPC_CONTEXT_TRACING),
|
487
|
+
nullptr);
|
488
|
+
} else if (propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT) {
|
489
|
+
return absl::UnknownError(
|
490
|
+
"Census context propagation requested without Census tracing "
|
491
|
+
"propagation");
|
492
|
+
}
|
493
|
+
if (propagation_mask & GRPC_PROPAGATE_CANCELLATION) {
|
494
|
+
cancellation_is_inherited_ = true;
|
495
|
+
}
|
496
|
+
return absl::OkStatus();
|
497
|
+
}
|
498
|
+
|
499
|
+
void Call::PublishToParent(Call* parent) {
|
500
|
+
ChildCall* cc = child_;
|
501
|
+
ParentCall* pc = parent->GetOrCreateParentCall();
|
502
|
+
MutexLock lock(&pc->child_list_mu);
|
503
|
+
if (pc->first_child == nullptr) {
|
504
|
+
pc->first_child = this;
|
505
|
+
cc->sibling_next = cc->sibling_prev = this;
|
506
|
+
} else {
|
507
|
+
cc->sibling_next = pc->first_child;
|
508
|
+
cc->sibling_prev = pc->first_child->child_->sibling_prev;
|
509
|
+
cc->sibling_next->child_->sibling_prev =
|
510
|
+
cc->sibling_prev->child_->sibling_next = this;
|
511
|
+
}
|
512
|
+
if (parent->Completed()) {
|
513
|
+
CancelWithError(GRPC_ERROR_CANCELLED);
|
514
|
+
}
|
344
515
|
}
|
345
516
|
|
346
|
-
grpc_error_handle
|
347
|
-
|
517
|
+
grpc_error_handle FilterStackCall::Create(grpc_call_create_args* args,
|
518
|
+
grpc_call** out_call) {
|
348
519
|
GPR_TIMER_SCOPE("grpc_call_create", 0);
|
349
520
|
|
350
|
-
|
521
|
+
Channel* channel = args->channel.get();
|
522
|
+
|
523
|
+
auto add_init_error = [](grpc_error_handle* composite,
|
524
|
+
grpc_error_handle new_err) {
|
525
|
+
if (GRPC_ERROR_IS_NONE(new_err)) return;
|
526
|
+
if (GRPC_ERROR_IS_NONE(*composite)) {
|
527
|
+
*composite = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Call creation failed");
|
528
|
+
}
|
529
|
+
*composite = grpc_error_add_child(*composite, new_err);
|
530
|
+
};
|
351
531
|
|
352
|
-
|
353
|
-
|
532
|
+
Arena* arena;
|
533
|
+
FilterStackCall* call;
|
354
534
|
grpc_error_handle error = GRPC_ERROR_NONE;
|
355
|
-
grpc_channel_stack* channel_stack =
|
356
|
-
|
357
|
-
size_t initial_size = grpc_channel_get_call_size_estimate(args->channel);
|
535
|
+
grpc_channel_stack* channel_stack = channel->channel_stack();
|
536
|
+
size_t initial_size = channel->CallSizeEstimate();
|
358
537
|
GRPC_STATS_INC_CALL_INITIAL_SIZE(initial_size);
|
359
|
-
size_t call_and_stack_size =
|
360
|
-
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call)) +
|
361
|
-
channel_stack->call_stack_size;
|
362
538
|
size_t call_alloc_size =
|
363
|
-
|
539
|
+
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(FilterStackCall)) +
|
540
|
+
channel_stack->call_stack_size;
|
364
541
|
|
365
|
-
std::pair<
|
366
|
-
|
542
|
+
std::pair<Arena*, void*> arena_with_call = Arena::CreateWithAlloc(
|
543
|
+
initial_size, call_alloc_size, channel->allocator());
|
367
544
|
arena = arena_with_call.first;
|
368
|
-
call = new (arena_with_call.second)
|
369
|
-
|
545
|
+
call = new (arena_with_call.second) FilterStackCall(arena, *args);
|
546
|
+
GPR_DEBUG_ASSERT(FromC(call->c_ptr()) == call);
|
547
|
+
GPR_DEBUG_ASSERT(FromCallStack(call->call_stack()) == call);
|
548
|
+
*out_call = call->c_ptr();
|
370
549
|
grpc_slice path = grpc_empty_slice();
|
371
|
-
if (call->is_client) {
|
372
|
-
call->
|
373
|
-
call->
|
374
|
-
call->
|
550
|
+
if (call->is_client()) {
|
551
|
+
call->final_op_.client.status_details = nullptr;
|
552
|
+
call->final_op_.client.status = nullptr;
|
553
|
+
call->final_op_.client.error_string = nullptr;
|
375
554
|
GRPC_STATS_INC_CLIENT_CALLS_CREATED();
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
path = grpc_slice_ref_internal(
|
383
|
-
GRPC_MDVALUE(args->add_initial_metadata[i]));
|
384
|
-
}
|
555
|
+
path = grpc_slice_ref_internal(args->path->c_slice());
|
556
|
+
call->send_initial_metadata_.Set(HttpPathMetadata(),
|
557
|
+
std::move(*args->path));
|
558
|
+
if (args->authority.has_value()) {
|
559
|
+
call->send_initial_metadata_.Set(HttpAuthorityMetadata(),
|
560
|
+
std::move(*args->authority));
|
385
561
|
}
|
386
|
-
call->send_extra_metadata_count =
|
387
|
-
static_cast<int>(args->add_initial_metadata_count);
|
388
562
|
} else {
|
389
563
|
GRPC_STATS_INC_SERVER_CALLS_CREATED();
|
390
|
-
call->
|
391
|
-
call->
|
392
|
-
GPR_ASSERT(args->add_initial_metadata_count == 0);
|
393
|
-
call->send_extra_metadata_count = 0;
|
564
|
+
call->final_op_.server.cancelled = nullptr;
|
565
|
+
call->final_op_.server.core_server = args->server;
|
394
566
|
}
|
395
567
|
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
call->child = new (reinterpret_cast<char*>(arena_with_call.second) +
|
401
|
-
call_and_stack_size) child_call(args->parent);
|
402
|
-
|
403
|
-
GRPC_CALL_INTERNAL_REF(args->parent, "child");
|
404
|
-
GPR_ASSERT(call->is_client);
|
405
|
-
GPR_ASSERT(!args->parent->is_client);
|
406
|
-
|
407
|
-
if (args->propagation_mask & GRPC_PROPAGATE_DEADLINE) {
|
408
|
-
send_deadline = std::min(send_deadline, args->parent->send_deadline);
|
409
|
-
}
|
410
|
-
/* for now GRPC_PROPAGATE_TRACING_CONTEXT *MUST* be passed with
|
411
|
-
* GRPC_PROPAGATE_STATS_CONTEXT */
|
412
|
-
/* TODO(ctiller): This should change to use the appropriate census start_op
|
413
|
-
* call. */
|
414
|
-
if (args->propagation_mask & GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT) {
|
415
|
-
if (0 == (args->propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT)) {
|
416
|
-
add_init_error(&error, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
417
|
-
"Census tracing propagation requested "
|
418
|
-
"without Census context propagation"));
|
419
|
-
}
|
420
|
-
grpc_call_context_set(call, GRPC_CONTEXT_TRACING,
|
421
|
-
args->parent->context[GRPC_CONTEXT_TRACING].value,
|
422
|
-
nullptr);
|
423
|
-
} else if (args->propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT) {
|
424
|
-
add_init_error(&error, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
425
|
-
"Census context propagation requested "
|
426
|
-
"without Census tracing propagation"));
|
427
|
-
}
|
428
|
-
if (args->propagation_mask & GRPC_PROPAGATE_CANCELLATION) {
|
429
|
-
call->cancellation_is_inherited = true;
|
430
|
-
if (gpr_atm_acq_load(&args->parent->received_final_op_atm)) {
|
431
|
-
immediately_cancel = true;
|
432
|
-
}
|
433
|
-
}
|
568
|
+
Call* parent = Call::FromC(args->parent);
|
569
|
+
if (parent != nullptr) {
|
570
|
+
add_init_error(&error, absl_status_to_grpc_error(call->InitParent(
|
571
|
+
parent, args->propagation_mask)));
|
434
572
|
}
|
435
|
-
call->send_deadline = send_deadline;
|
436
573
|
/* initial refcount dropped by grpc_call_unref */
|
437
|
-
grpc_call_element_args call_args = {
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
call->arena,
|
444
|
-
&call->call_combiner};
|
445
|
-
add_init_error(&error, grpc_call_stack_init(channel_stack, 1, destroy_call,
|
574
|
+
grpc_call_element_args call_args = {
|
575
|
+
call->call_stack(), args->server_transport_data,
|
576
|
+
call->context_, path,
|
577
|
+
call->start_time_, call->send_deadline(),
|
578
|
+
call->arena(), &call->call_combiner_};
|
579
|
+
add_init_error(&error, grpc_call_stack_init(channel_stack, 1, DestroyCall,
|
446
580
|
call, &call_args));
|
447
581
|
// Publish this call to parent only after the call stack has been initialized.
|
448
|
-
if (
|
449
|
-
|
450
|
-
parent_call* pc = get_or_create_parent_call(args->parent);
|
451
|
-
gpr_mu_lock(&pc->child_list_mu);
|
452
|
-
if (pc->first_child == nullptr) {
|
453
|
-
pc->first_child = call;
|
454
|
-
cc->sibling_next = cc->sibling_prev = call;
|
455
|
-
} else {
|
456
|
-
cc->sibling_next = pc->first_child;
|
457
|
-
cc->sibling_prev = pc->first_child->child->sibling_prev;
|
458
|
-
cc->sibling_next->child->sibling_prev =
|
459
|
-
cc->sibling_prev->child->sibling_next = call;
|
460
|
-
}
|
461
|
-
gpr_mu_unlock(&pc->child_list_mu);
|
582
|
+
if (parent != nullptr) {
|
583
|
+
call->PublishToParent(parent);
|
462
584
|
}
|
463
585
|
|
464
|
-
if (error
|
465
|
-
|
466
|
-
}
|
467
|
-
if (immediately_cancel) {
|
468
|
-
cancel_with_error(call, GRPC_ERROR_CANCELLED);
|
586
|
+
if (!GRPC_ERROR_IS_NONE(error)) {
|
587
|
+
call->CancelWithError(GRPC_ERROR_REF(error));
|
469
588
|
}
|
470
589
|
if (args->cq != nullptr) {
|
471
590
|
GPR_ASSERT(args->pollset_set_alternative == nullptr &&
|
472
591
|
"Only one of 'cq' and 'pollset_set_alternative' should be "
|
473
592
|
"non-nullptr.");
|
474
593
|
GRPC_CQ_INTERNAL_REF(args->cq, "bind");
|
475
|
-
call->
|
594
|
+
call->pollent_ =
|
476
595
|
grpc_polling_entity_create_from_pollset(grpc_cq_pollset(args->cq));
|
477
596
|
}
|
478
597
|
if (args->pollset_set_alternative != nullptr) {
|
479
|
-
call->
|
598
|
+
call->pollent_ = grpc_polling_entity_create_from_pollset_set(
|
480
599
|
args->pollset_set_alternative);
|
481
600
|
}
|
482
|
-
if (!grpc_polling_entity_is_empty(&call->
|
483
|
-
grpc_call_stack_set_pollset_or_pollset_set(
|
484
|
-
&call->
|
601
|
+
if (!grpc_polling_entity_is_empty(&call->pollent_)) {
|
602
|
+
grpc_call_stack_set_pollset_or_pollset_set(call->call_stack(),
|
603
|
+
&call->pollent_);
|
485
604
|
}
|
486
605
|
|
487
|
-
if (call->is_client) {
|
488
|
-
|
489
|
-
grpc_channel_get_channelz_node(call->channel);
|
606
|
+
if (call->is_client()) {
|
607
|
+
channelz::ChannelNode* channelz_channel = channel->channelz_node();
|
490
608
|
if (channelz_channel != nullptr) {
|
491
609
|
channelz_channel->RecordCallStarted();
|
492
610
|
}
|
493
|
-
} else if (call->
|
494
|
-
|
495
|
-
call->
|
611
|
+
} else if (call->final_op_.server.core_server != nullptr) {
|
612
|
+
channelz::ServerNode* channelz_node =
|
613
|
+
call->final_op_.server.core_server->channelz_node();
|
496
614
|
if (channelz_node != nullptr) {
|
497
615
|
channelz_node->RecordCallStarted();
|
498
616
|
}
|
@@ -503,269 +621,208 @@ grpc_error_handle grpc_call_create(const grpc_call_create_args* args,
|
|
503
621
|
return error;
|
504
622
|
}
|
505
623
|
|
506
|
-
void
|
507
|
-
grpc_completion_queue* cq) {
|
624
|
+
void FilterStackCall::SetCompletionQueue(grpc_completion_queue* cq) {
|
508
625
|
GPR_ASSERT(cq);
|
509
626
|
|
510
|
-
if (grpc_polling_entity_pollset_set(&
|
627
|
+
if (grpc_polling_entity_pollset_set(&pollent_) != nullptr) {
|
511
628
|
gpr_log(GPR_ERROR, "A pollset_set is already registered for this call.");
|
512
629
|
abort();
|
513
630
|
}
|
514
|
-
|
631
|
+
cq_ = cq;
|
515
632
|
GRPC_CQ_INTERNAL_REF(cq, "bind");
|
516
|
-
|
517
|
-
grpc_call_stack_set_pollset_or_pollset_set(
|
518
|
-
&call->pollent);
|
633
|
+
pollent_ = grpc_polling_entity_create_from_pollset(grpc_cq_pollset(cq));
|
634
|
+
grpc_call_stack_set_pollset_or_pollset_set(call_stack(), &pollent_);
|
519
635
|
}
|
520
636
|
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
#endif
|
528
|
-
void grpc_call_internal_ref(grpc_call* c REF_ARG) {
|
529
|
-
GRPC_CALL_STACK_REF(CALL_STACK_FROM_CALL(c), REF_REASON);
|
530
|
-
}
|
531
|
-
void grpc_call_internal_unref(grpc_call* c REF_ARG) {
|
532
|
-
GRPC_CALL_STACK_UNREF(CALL_STACK_FROM_CALL(c), REF_REASON);
|
533
|
-
}
|
534
|
-
|
535
|
-
static void release_call(void* call, grpc_error_handle /*error*/) {
|
536
|
-
grpc_call* c = static_cast<grpc_call*>(call);
|
537
|
-
grpc_channel* channel = c->channel;
|
538
|
-
grpc_core::Arena* arena = c->arena;
|
539
|
-
c->~grpc_call();
|
540
|
-
grpc_channel_update_call_size_estimate(channel, arena->Destroy());
|
541
|
-
GRPC_CHANNEL_INTERNAL_UNREF(channel, "call");
|
637
|
+
void FilterStackCall::ReleaseCall(void* call, grpc_error_handle /*error*/) {
|
638
|
+
auto* c = static_cast<FilterStackCall*>(call);
|
639
|
+
RefCountedPtr<Channel> channel = std::move(c->channel_);
|
640
|
+
Arena* arena = c->arena();
|
641
|
+
c->~FilterStackCall();
|
642
|
+
channel->UpdateCallSizeEstimate(arena->Destroy());
|
542
643
|
}
|
543
644
|
|
544
|
-
|
645
|
+
void FilterStackCall::DestroyCall(void* call, grpc_error_handle /*error*/) {
|
545
646
|
GPR_TIMER_SCOPE("destroy_call", 0);
|
546
|
-
|
547
|
-
c->
|
548
|
-
c->
|
549
|
-
c->
|
550
|
-
|
647
|
+
auto* c = static_cast<FilterStackCall*>(call);
|
648
|
+
c->recv_initial_metadata_.Clear();
|
649
|
+
c->recv_trailing_metadata_.Clear();
|
650
|
+
c->receiving_slice_buffer_.reset();
|
651
|
+
ParentCall* pc = c->parent_call();
|
551
652
|
if (pc != nullptr) {
|
552
|
-
pc->~
|
653
|
+
pc->~ParentCall();
|
553
654
|
}
|
554
|
-
|
555
|
-
|
556
|
-
}
|
557
|
-
if (c->cq) {
|
558
|
-
GRPC_CQ_INTERNAL_UNREF(c->cq, "bind");
|
655
|
+
if (c->cq_) {
|
656
|
+
GRPC_CQ_INTERNAL_UNREF(c->cq_, "bind");
|
559
657
|
}
|
560
658
|
|
561
|
-
grpc_error_handle status_error = c->
|
562
|
-
grpc_error_get_status(status_error, c->send_deadline,
|
563
|
-
&c->
|
564
|
-
&(c->
|
565
|
-
c->
|
566
|
-
c->
|
567
|
-
gpr_cycle_counter_sub(gpr_get_cycle_counter(), c->
|
568
|
-
grpc_call_stack_destroy(
|
569
|
-
GRPC_CLOSURE_INIT(&c->
|
659
|
+
grpc_error_handle status_error = c->status_error_.get();
|
660
|
+
grpc_error_get_status(status_error, c->send_deadline(),
|
661
|
+
&c->final_info_.final_status, nullptr, nullptr,
|
662
|
+
&(c->final_info_.error_string));
|
663
|
+
c->status_error_.set(GRPC_ERROR_NONE);
|
664
|
+
c->final_info_.stats.latency =
|
665
|
+
gpr_cycle_counter_sub(gpr_get_cycle_counter(), c->start_time_);
|
666
|
+
grpc_call_stack_destroy(c->call_stack(), &c->final_info_,
|
667
|
+
GRPC_CLOSURE_INIT(&c->release_call_, ReleaseCall, c,
|
570
668
|
grpc_schedule_on_exec_ctx));
|
571
669
|
}
|
572
670
|
|
573
|
-
void
|
574
|
-
|
575
|
-
|
576
|
-
if (GPR_LIKELY(!c->ext_ref.Unref())) return;
|
577
|
-
|
578
|
-
GPR_TIMER_SCOPE("grpc_call_unref", 0);
|
579
|
-
|
580
|
-
child_call* cc = c->child;
|
581
|
-
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
582
|
-
grpc_core::ExecCtx exec_ctx;
|
583
|
-
|
584
|
-
GRPC_API_TRACE("grpc_call_unref(c=%p)", 1, (c));
|
671
|
+
void Call::MaybeUnpublishFromParent() {
|
672
|
+
ChildCall* cc = child_;
|
673
|
+
if (cc == nullptr) return;
|
585
674
|
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
if (
|
675
|
+
ParentCall* pc = cc->parent->parent_call();
|
676
|
+
{
|
677
|
+
MutexLock lock(&pc->child_list_mu);
|
678
|
+
if (this == pc->first_child) {
|
590
679
|
pc->first_child = cc->sibling_next;
|
591
|
-
if (
|
680
|
+
if (this == pc->first_child) {
|
592
681
|
pc->first_child = nullptr;
|
593
682
|
}
|
594
683
|
}
|
595
|
-
cc->sibling_prev->
|
596
|
-
cc->sibling_next->
|
597
|
-
gpr_mu_unlock(&pc->child_list_mu);
|
598
|
-
GRPC_CALL_INTERNAL_UNREF(cc->parent, "child");
|
684
|
+
cc->sibling_prev->child_->sibling_next = cc->sibling_next;
|
685
|
+
cc->sibling_next->child_->sibling_prev = cc->sibling_prev;
|
599
686
|
}
|
687
|
+
cc->parent->InternalUnref("child");
|
688
|
+
}
|
689
|
+
|
690
|
+
void FilterStackCall::ExternalUnref() {
|
691
|
+
if (GPR_LIKELY(!ext_ref_.Unref())) return;
|
692
|
+
|
693
|
+
GPR_TIMER_SCOPE("grpc_call_unref", 0);
|
694
|
+
|
695
|
+
ApplicationCallbackExecCtx callback_exec_ctx;
|
696
|
+
ExecCtx exec_ctx;
|
697
|
+
|
698
|
+
GRPC_API_TRACE("grpc_call_unref(c=%p)", 1, (this));
|
600
699
|
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
700
|
+
MaybeUnpublishFromParent();
|
701
|
+
|
702
|
+
GPR_ASSERT(!destroy_called_);
|
703
|
+
destroy_called_ = true;
|
704
|
+
bool cancel = gpr_atm_acq_load(&received_final_op_atm_) == 0;
|
605
705
|
if (cancel) {
|
606
|
-
|
706
|
+
CancelWithError(GRPC_ERROR_CANCELLED);
|
607
707
|
} else {
|
608
708
|
// Unset the call combiner cancellation closure. This has the
|
609
709
|
// effect of scheduling the previously set cancellation closure, if
|
610
710
|
// any, so that it can release any internal references it may be
|
611
711
|
// holding to the call stack.
|
612
|
-
|
712
|
+
call_combiner_.SetNotifyOnCancel(nullptr);
|
613
713
|
}
|
614
|
-
|
615
|
-
}
|
616
|
-
|
617
|
-
grpc_call_error grpc_call_cancel(grpc_call* call, void* reserved) {
|
618
|
-
GRPC_API_TRACE("grpc_call_cancel(call=%p, reserved=%p)", 2, (call, reserved));
|
619
|
-
GPR_ASSERT(!reserved);
|
620
|
-
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
621
|
-
grpc_core::ExecCtx exec_ctx;
|
622
|
-
cancel_with_error(call, GRPC_ERROR_CANCELLED);
|
623
|
-
return GRPC_CALL_OK;
|
714
|
+
InternalUnref("destroy");
|
624
715
|
}
|
625
716
|
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
static_cast<grpc_transport_stream_op_batch*>(arg);
|
633
|
-
grpc_call* call = static_cast<grpc_call*>(batch->handler_private.extra_arg);
|
634
|
-
grpc_call_element* elem = CALL_ELEM_FROM_CALL(call, 0);
|
635
|
-
GRPC_CALL_LOG_OP(GPR_INFO, elem, batch);
|
636
|
-
elem->filter->start_transport_stream_op_batch(elem, batch);
|
717
|
+
char* FilterStackCall::GetPeer() {
|
718
|
+
char* peer_string = reinterpret_cast<char*>(gpr_atm_acq_load(&peer_string_));
|
719
|
+
if (peer_string != nullptr) return gpr_strdup(peer_string);
|
720
|
+
peer_string = grpc_channel_get_target(channel_->c_ptr());
|
721
|
+
if (peer_string != nullptr) return peer_string;
|
722
|
+
return gpr_strdup("unknown");
|
637
723
|
}
|
638
724
|
|
639
725
|
// start_batch_closure points to a caller-allocated closure to be used
|
640
726
|
// for entering the call combiner.
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
727
|
+
void FilterStackCall::ExecuteBatch(grpc_transport_stream_op_batch* batch,
|
728
|
+
grpc_closure* start_batch_closure) {
|
729
|
+
// This is called via the call combiner to start sending a batch down
|
730
|
+
// the filter stack.
|
731
|
+
auto execute_batch_in_call_combiner = [](void* arg, grpc_error_handle) {
|
732
|
+
GPR_TIMER_SCOPE("execute_batch_in_call_combiner", 0);
|
733
|
+
grpc_transport_stream_op_batch* batch =
|
734
|
+
static_cast<grpc_transport_stream_op_batch*>(arg);
|
735
|
+
auto* call =
|
736
|
+
static_cast<FilterStackCall*>(batch->handler_private.extra_arg);
|
737
|
+
grpc_call_element* elem = call->call_elem(0);
|
738
|
+
GRPC_CALL_LOG_OP(GPR_INFO, elem, batch);
|
739
|
+
elem->filter->start_transport_stream_op_batch(elem, batch);
|
740
|
+
};
|
741
|
+
batch->handler_private.extra_arg = this;
|
645
742
|
GRPC_CLOSURE_INIT(start_batch_closure, execute_batch_in_call_combiner, batch,
|
646
743
|
grpc_schedule_on_exec_ctx);
|
647
|
-
GRPC_CALL_COMBINER_START(
|
744
|
+
GRPC_CALL_COMBINER_START(call_combiner(), start_batch_closure,
|
648
745
|
GRPC_ERROR_NONE, "executing batch");
|
649
746
|
}
|
650
747
|
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
if (peer_string != nullptr) return gpr_strdup(peer_string);
|
655
|
-
peer_string = grpc_channel_get_target(call->channel);
|
656
|
-
if (peer_string != nullptr) return peer_string;
|
657
|
-
return gpr_strdup("unknown");
|
658
|
-
}
|
659
|
-
|
660
|
-
grpc_call* grpc_call_from_top_element(grpc_call_element* surface_element) {
|
661
|
-
return CALL_FROM_TOP_ELEM(surface_element);
|
662
|
-
}
|
663
|
-
|
664
|
-
/*******************************************************************************
|
665
|
-
* CANCELLATION
|
666
|
-
*/
|
667
|
-
|
668
|
-
grpc_call_error grpc_call_cancel_with_status(grpc_call* c,
|
669
|
-
grpc_status_code status,
|
670
|
-
const char* description,
|
671
|
-
void* reserved) {
|
672
|
-
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
673
|
-
grpc_core::ExecCtx exec_ctx;
|
674
|
-
GRPC_API_TRACE(
|
675
|
-
"grpc_call_cancel_with_status("
|
676
|
-
"c=%p, status=%d, description=%s, reserved=%p)",
|
677
|
-
4, (c, (int)status, description, reserved));
|
678
|
-
GPR_ASSERT(reserved == nullptr);
|
679
|
-
cancel_with_status(c, status, description);
|
680
|
-
return GRPC_CALL_OK;
|
681
|
-
}
|
682
|
-
|
683
|
-
struct cancel_state {
|
684
|
-
grpc_call* call;
|
748
|
+
namespace {
|
749
|
+
struct CancelState {
|
750
|
+
FilterStackCall* call;
|
685
751
|
grpc_closure start_batch;
|
686
752
|
grpc_closure finish_batch;
|
687
753
|
};
|
754
|
+
} // namespace
|
755
|
+
|
688
756
|
// The on_complete callback used when sending a cancel_stream batch down
|
689
757
|
// the filter stack. Yields the call combiner when the batch is done.
|
690
758
|
static void done_termination(void* arg, grpc_error_handle /*error*/) {
|
691
|
-
|
692
|
-
GRPC_CALL_COMBINER_STOP(
|
759
|
+
CancelState* state = static_cast<CancelState*>(arg);
|
760
|
+
GRPC_CALL_COMBINER_STOP(state->call->call_combiner(),
|
693
761
|
"on_complete for cancel_stream op");
|
694
|
-
|
695
|
-
|
762
|
+
state->call->InternalUnref("termination");
|
763
|
+
delete state;
|
696
764
|
}
|
697
765
|
|
698
|
-
|
699
|
-
if (!gpr_atm_rel_cas(&
|
766
|
+
void FilterStackCall::CancelWithError(grpc_error_handle error) {
|
767
|
+
if (!gpr_atm_rel_cas(&cancelled_with_error_, 0, 1)) {
|
700
768
|
GRPC_ERROR_UNREF(error);
|
701
769
|
return;
|
702
770
|
}
|
703
|
-
|
771
|
+
InternalRef("termination");
|
704
772
|
// Inform the call combiner of the cancellation, so that it can cancel
|
705
773
|
// any in-flight asynchronous actions that may be holding the call
|
706
774
|
// combiner. This ensures that the cancel_stream batch can be sent
|
707
775
|
// down the filter stack in a timely manner.
|
708
|
-
|
709
|
-
|
710
|
-
state->call =
|
776
|
+
call_combiner_.Cancel(GRPC_ERROR_REF(error));
|
777
|
+
CancelState* state = new CancelState;
|
778
|
+
state->call = this;
|
711
779
|
GRPC_CLOSURE_INIT(&state->finish_batch, done_termination, state,
|
712
780
|
grpc_schedule_on_exec_ctx);
|
713
781
|
grpc_transport_stream_op_batch* op =
|
714
782
|
grpc_make_transport_stream_op(&state->finish_batch);
|
715
783
|
op->cancel_stream = true;
|
716
784
|
op->payload->cancel_stream.cancel_error = error;
|
717
|
-
|
785
|
+
ExecuteBatch(op, &state->start_batch);
|
718
786
|
}
|
719
787
|
|
720
|
-
void
|
721
|
-
cancel_with_error(call, GRPC_ERROR_CANCELLED);
|
722
|
-
}
|
723
|
-
|
724
|
-
static grpc_error_handle error_from_status(grpc_status_code status,
|
725
|
-
const char* description) {
|
788
|
+
void Call::CancelWithStatus(grpc_status_code status, const char* description) {
|
726
789
|
// copying 'description' is needed to ensure the grpc_call_cancel_with_status
|
727
790
|
// guarantee that can be short-lived.
|
728
|
-
|
791
|
+
CancelWithError(grpc_error_set_int(
|
729
792
|
grpc_error_set_str(GRPC_ERROR_CREATE_FROM_COPIED_STRING(description),
|
730
793
|
GRPC_ERROR_STR_GRPC_MESSAGE, description),
|
731
|
-
GRPC_ERROR_INT_GRPC_STATUS, status);
|
732
|
-
}
|
733
|
-
|
734
|
-
static void cancel_with_status(grpc_call* c, grpc_status_code status,
|
735
|
-
const char* description) {
|
736
|
-
cancel_with_error(c, error_from_status(status, description));
|
794
|
+
GRPC_ERROR_INT_GRPC_STATUS, status));
|
737
795
|
}
|
738
796
|
|
739
|
-
|
797
|
+
void FilterStackCall::SetFinalStatus(grpc_error_handle error) {
|
740
798
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_call_error_trace)) {
|
741
|
-
gpr_log(GPR_DEBUG, "set_final_status %s",
|
799
|
+
gpr_log(GPR_DEBUG, "set_final_status %s", is_client() ? "CLI" : "SVR");
|
742
800
|
gpr_log(GPR_DEBUG, "%s", grpc_error_std_string(error).c_str());
|
743
801
|
}
|
744
|
-
if (
|
802
|
+
if (is_client()) {
|
745
803
|
std::string status_details;
|
746
|
-
grpc_error_get_status(error,
|
747
|
-
|
748
|
-
|
749
|
-
*
|
804
|
+
grpc_error_get_status(error, send_deadline(), final_op_.client.status,
|
805
|
+
&status_details, nullptr,
|
806
|
+
final_op_.client.error_string);
|
807
|
+
*final_op_.client.status_details =
|
750
808
|
grpc_slice_from_cpp_string(std::move(status_details));
|
751
|
-
|
809
|
+
status_error_.set(error);
|
752
810
|
GRPC_ERROR_UNREF(error);
|
753
|
-
|
754
|
-
grpc_channel_get_channelz_node(call->channel);
|
811
|
+
channelz::ChannelNode* channelz_channel = channel_->channelz_node();
|
755
812
|
if (channelz_channel != nullptr) {
|
756
|
-
if (*
|
813
|
+
if (*final_op_.client.status != GRPC_STATUS_OK) {
|
757
814
|
channelz_channel->RecordCallFailed();
|
758
815
|
} else {
|
759
816
|
channelz_channel->RecordCallSucceeded();
|
760
817
|
}
|
761
818
|
}
|
762
819
|
} else {
|
763
|
-
*
|
764
|
-
error
|
765
|
-
|
766
|
-
|
820
|
+
*final_op_.server.cancelled =
|
821
|
+
!GRPC_ERROR_IS_NONE(error) || !sent_server_trailing_metadata_;
|
822
|
+
channelz::ServerNode* channelz_node =
|
823
|
+
final_op_.server.core_server->channelz_node();
|
767
824
|
if (channelz_node != nullptr) {
|
768
|
-
if (*
|
825
|
+
if (*final_op_.server.cancelled || !status_error_.ok()) {
|
769
826
|
channelz_node->RecordCallFailed();
|
770
827
|
} else {
|
771
828
|
channelz_node->RecordCallSucceeded();
|
@@ -775,205 +832,40 @@ static void set_final_status(grpc_call* call, grpc_error_handle error) {
|
|
775
832
|
}
|
776
833
|
}
|
777
834
|
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
call->incoming_message_compression_algorithm = algo;
|
786
|
-
}
|
787
|
-
|
788
|
-
static void set_incoming_stream_compression_algorithm(
|
789
|
-
grpc_call* call, grpc_stream_compression_algorithm algo) {
|
790
|
-
GPR_ASSERT(algo < GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT);
|
791
|
-
call->incoming_stream_compression_algorithm = algo;
|
792
|
-
}
|
793
|
-
|
794
|
-
grpc_compression_algorithm grpc_call_test_only_get_compression_algorithm(
|
795
|
-
grpc_call* call) {
|
796
|
-
grpc_compression_algorithm algorithm = GRPC_COMPRESS_NONE;
|
797
|
-
grpc_compression_algorithm_from_message_stream_compression_algorithm(
|
798
|
-
&algorithm, call->incoming_message_compression_algorithm,
|
799
|
-
call->incoming_stream_compression_algorithm);
|
800
|
-
return algorithm;
|
801
|
-
}
|
802
|
-
|
803
|
-
static grpc_compression_algorithm compression_algorithm_for_level_locked(
|
804
|
-
grpc_call* call, grpc_compression_level level) {
|
805
|
-
return grpc_compression_algorithm_for_level(level,
|
806
|
-
call->encodings_accepted_by_peer);
|
807
|
-
}
|
808
|
-
|
809
|
-
uint32_t grpc_call_test_only_get_message_flags(grpc_call* call) {
|
810
|
-
uint32_t flags;
|
811
|
-
flags = call->test_only_last_message_flags;
|
812
|
-
return flags;
|
813
|
-
}
|
814
|
-
|
815
|
-
static void destroy_encodings_accepted_by_peer(void* /*p*/) {}
|
816
|
-
|
817
|
-
static void set_encodings_accepted_by_peer(grpc_call* /*call*/,
|
818
|
-
grpc_mdelem mdel,
|
819
|
-
uint32_t* encodings_accepted_by_peer,
|
820
|
-
bool stream_encoding) {
|
821
|
-
size_t i;
|
822
|
-
uint32_t algorithm;
|
823
|
-
grpc_slice_buffer accept_encoding_parts;
|
824
|
-
grpc_slice accept_encoding_slice;
|
825
|
-
void* accepted_user_data;
|
826
|
-
|
827
|
-
accepted_user_data =
|
828
|
-
grpc_mdelem_get_user_data(mdel, destroy_encodings_accepted_by_peer);
|
829
|
-
if (accepted_user_data != nullptr) {
|
830
|
-
*encodings_accepted_by_peer = static_cast<uint32_t>(
|
831
|
-
reinterpret_cast<uintptr_t>(accepted_user_data) - 1);
|
832
|
-
return;
|
833
|
-
}
|
834
|
-
|
835
|
-
*encodings_accepted_by_peer = 0;
|
836
|
-
|
837
|
-
accept_encoding_slice = GRPC_MDVALUE(mdel);
|
838
|
-
grpc_slice_buffer_init(&accept_encoding_parts);
|
839
|
-
grpc_slice_split_without_space(accept_encoding_slice, ",",
|
840
|
-
&accept_encoding_parts);
|
841
|
-
|
842
|
-
grpc_core::SetBit(encodings_accepted_by_peer, GRPC_COMPRESS_NONE);
|
843
|
-
for (i = 0; i < accept_encoding_parts.count; i++) {
|
844
|
-
int r;
|
845
|
-
grpc_slice accept_encoding_entry_slice = accept_encoding_parts.slices[i];
|
846
|
-
if (!stream_encoding) {
|
847
|
-
r = grpc_message_compression_algorithm_parse(
|
848
|
-
accept_encoding_entry_slice,
|
849
|
-
reinterpret_cast<grpc_message_compression_algorithm*>(&algorithm));
|
850
|
-
} else {
|
851
|
-
r = grpc_stream_compression_algorithm_parse(
|
852
|
-
accept_encoding_entry_slice,
|
853
|
-
reinterpret_cast<grpc_stream_compression_algorithm*>(&algorithm));
|
854
|
-
}
|
855
|
-
if (r) {
|
856
|
-
grpc_core::SetBit(encodings_accepted_by_peer, algorithm);
|
857
|
-
} else {
|
858
|
-
char* accept_encoding_entry_str =
|
859
|
-
grpc_slice_to_c_string(accept_encoding_entry_slice);
|
860
|
-
gpr_log(GPR_DEBUG,
|
861
|
-
"Unknown entry in accept encoding metadata: '%s'. Ignoring.",
|
862
|
-
accept_encoding_entry_str);
|
863
|
-
gpr_free(accept_encoding_entry_str);
|
864
|
-
}
|
865
|
-
}
|
866
|
-
|
867
|
-
grpc_slice_buffer_destroy_internal(&accept_encoding_parts);
|
868
|
-
|
869
|
-
grpc_mdelem_set_user_data(
|
870
|
-
mdel, destroy_encodings_accepted_by_peer,
|
871
|
-
reinterpret_cast<void*>(
|
872
|
-
static_cast<uintptr_t>(*encodings_accepted_by_peer) + 1));
|
873
|
-
}
|
874
|
-
|
875
|
-
uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call* call) {
|
876
|
-
uint32_t encodings_accepted_by_peer;
|
877
|
-
encodings_accepted_by_peer = call->encodings_accepted_by_peer;
|
878
|
-
return encodings_accepted_by_peer;
|
879
|
-
}
|
880
|
-
|
881
|
-
grpc_stream_compression_algorithm
|
882
|
-
grpc_call_test_only_get_incoming_stream_encodings(grpc_call* call) {
|
883
|
-
return call->incoming_stream_compression_algorithm;
|
884
|
-
}
|
885
|
-
|
886
|
-
static grpc_linked_mdelem* linked_from_md(grpc_metadata* md) {
|
887
|
-
return reinterpret_cast<grpc_linked_mdelem*>(&md->internal_data);
|
888
|
-
}
|
889
|
-
|
890
|
-
static grpc_metadata* get_md_elem(grpc_metadata* metadata,
|
891
|
-
grpc_metadata* additional_metadata, int i,
|
892
|
-
int count) {
|
893
|
-
grpc_metadata* res =
|
894
|
-
i < count ? &metadata[i] : &additional_metadata[i - count];
|
895
|
-
GPR_ASSERT(res);
|
896
|
-
return res;
|
897
|
-
}
|
898
|
-
|
899
|
-
static int prepare_application_metadata(grpc_call* call, int count,
|
900
|
-
grpc_metadata* metadata,
|
901
|
-
int is_trailing,
|
902
|
-
grpc_metadata* additional_metadata,
|
903
|
-
int additional_metadata_count) {
|
904
|
-
int total_count = count + additional_metadata_count;
|
905
|
-
int i;
|
906
|
-
grpc_metadata_batch* batch = is_trailing ? &call->send_trailing_metadata
|
907
|
-
: &call->send_initial_metadata;
|
908
|
-
for (i = 0; i < total_count; i++) {
|
909
|
-
grpc_metadata* md = get_md_elem(metadata, additional_metadata, i, count);
|
910
|
-
grpc_linked_mdelem* l = linked_from_md(md);
|
911
|
-
GPR_ASSERT(sizeof(grpc_linked_mdelem) == sizeof(md->internal_data));
|
835
|
+
bool FilterStackCall::PrepareApplicationMetadata(size_t count,
|
836
|
+
grpc_metadata* metadata,
|
837
|
+
bool is_trailing) {
|
838
|
+
grpc_metadata_batch* batch =
|
839
|
+
is_trailing ? &send_trailing_metadata_ : &send_initial_metadata_;
|
840
|
+
for (size_t i = 0; i < count; i++) {
|
841
|
+
grpc_metadata* md = &metadata[i];
|
912
842
|
if (!GRPC_LOG_IF_ERROR("validate_metadata",
|
913
843
|
grpc_validate_header_key_is_legal(md->key))) {
|
914
|
-
|
844
|
+
return false;
|
915
845
|
} else if (!grpc_is_binary_header_internal(md->key) &&
|
916
846
|
!GRPC_LOG_IF_ERROR(
|
917
847
|
"validate_metadata",
|
918
848
|
grpc_validate_header_nonbin_value_is_legal(md->value))) {
|
919
|
-
|
849
|
+
return false;
|
920
850
|
} else if (GRPC_SLICE_LENGTH(md->value) >= UINT32_MAX) {
|
921
851
|
// HTTP2 hpack encoding has a maximum limit.
|
922
|
-
|
852
|
+
return false;
|
853
|
+
} else if (grpc_slice_str_cmp(md->key, "content-length") == 0) {
|
854
|
+
// Filter "content-length metadata"
|
855
|
+
continue;
|
923
856
|
}
|
924
|
-
|
857
|
+
batch->Append(StringViewFromSlice(md->key),
|
858
|
+
Slice(grpc_slice_ref_internal(md->value)),
|
859
|
+
[md](absl::string_view error, const Slice& value) {
|
860
|
+
gpr_log(GPR_DEBUG, "Append error: %s",
|
861
|
+
absl::StrCat("key=", StringViewFromSlice(md->key),
|
862
|
+
" error=", error,
|
863
|
+
" value=", value.as_string_view())
|
864
|
+
.c_str());
|
865
|
+
});
|
925
866
|
}
|
926
|
-
if (i != total_count) {
|
927
|
-
for (int j = 0; j < i; j++) {
|
928
|
-
grpc_metadata* md = get_md_elem(metadata, additional_metadata, j, count);
|
929
|
-
grpc_linked_mdelem* l = linked_from_md(md);
|
930
|
-
GRPC_MDELEM_UNREF(l->md);
|
931
|
-
}
|
932
|
-
return 0;
|
933
|
-
}
|
934
|
-
for (i = 0; i < total_count; i++) {
|
935
|
-
grpc_metadata* md = get_md_elem(metadata, additional_metadata, i, count);
|
936
|
-
grpc_linked_mdelem* l = linked_from_md(md);
|
937
|
-
grpc_error_handle error = batch->LinkTail(l);
|
938
|
-
if (error != GRPC_ERROR_NONE) {
|
939
|
-
GRPC_MDELEM_UNREF(l->md);
|
940
|
-
}
|
941
|
-
GRPC_LOG_IF_ERROR("prepare_application_metadata", error);
|
942
|
-
}
|
943
|
-
|
944
|
-
return 1;
|
945
|
-
}
|
946
|
-
|
947
|
-
static grpc_message_compression_algorithm decode_message_compression(
|
948
|
-
grpc_mdelem md) {
|
949
|
-
grpc_message_compression_algorithm algorithm =
|
950
|
-
grpc_message_compression_algorithm_from_slice(GRPC_MDVALUE(md));
|
951
|
-
if (algorithm == GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT) {
|
952
|
-
char* md_c_str = grpc_slice_to_c_string(GRPC_MDVALUE(md));
|
953
|
-
gpr_log(GPR_ERROR,
|
954
|
-
"Invalid incoming message compression algorithm: '%s'. "
|
955
|
-
"Interpreting incoming data as uncompressed.",
|
956
|
-
md_c_str);
|
957
|
-
gpr_free(md_c_str);
|
958
|
-
return GRPC_MESSAGE_COMPRESS_NONE;
|
959
|
-
}
|
960
|
-
return algorithm;
|
961
|
-
}
|
962
867
|
|
963
|
-
|
964
|
-
grpc_mdelem md) {
|
965
|
-
grpc_stream_compression_algorithm algorithm =
|
966
|
-
grpc_stream_compression_algorithm_from_slice(GRPC_MDVALUE(md));
|
967
|
-
if (algorithm == GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT) {
|
968
|
-
char* md_c_str = grpc_slice_to_c_string(GRPC_MDVALUE(md));
|
969
|
-
gpr_log(GPR_ERROR,
|
970
|
-
"Invalid incoming stream compression algorithm: '%s'. Interpreting "
|
971
|
-
"incoming data as uncompressed.",
|
972
|
-
md_c_str);
|
973
|
-
gpr_free(md_c_str);
|
974
|
-
return GRPC_STREAM_COMPRESS_NONE;
|
975
|
-
}
|
976
|
-
return algorithm;
|
868
|
+
return true;
|
977
869
|
}
|
978
870
|
|
979
871
|
namespace {
|
@@ -981,19 +873,46 @@ class PublishToAppEncoder {
|
|
981
873
|
public:
|
982
874
|
explicit PublishToAppEncoder(grpc_metadata_array* dest) : dest_(dest) {}
|
983
875
|
|
984
|
-
void Encode(
|
985
|
-
|
986
|
-
|
987
|
-
void Encode(grpc_core::TeMetadata, grpc_core::TeMetadata::ValueType) {}
|
876
|
+
void Encode(const Slice& key, const Slice& value) {
|
877
|
+
Append(key.c_slice(), value.c_slice());
|
878
|
+
}
|
988
879
|
|
880
|
+
// Catch anything that is not explicitly handled, and do not publish it to the
|
881
|
+
// application. If new metadata is added to a batch that needs to be
|
882
|
+
// published, it should be called out here.
|
989
883
|
template <typename Which>
|
990
|
-
void Encode(Which, const
|
991
|
-
|
992
|
-
|
993
|
-
|
884
|
+
void Encode(Which, const typename Which::ValueType&) {}
|
885
|
+
|
886
|
+
void Encode(UserAgentMetadata, const Slice& slice) {
|
887
|
+
Append(UserAgentMetadata::key(), slice);
|
888
|
+
}
|
889
|
+
|
890
|
+
void Encode(HostMetadata, const Slice& slice) {
|
891
|
+
Append(HostMetadata::key(), slice);
|
892
|
+
}
|
893
|
+
|
894
|
+
void Encode(GrpcPreviousRpcAttemptsMetadata, uint32_t count) {
|
895
|
+
Append(GrpcPreviousRpcAttemptsMetadata::key(), count);
|
896
|
+
}
|
897
|
+
|
898
|
+
void Encode(GrpcRetryPushbackMsMetadata, Duration count) {
|
899
|
+
Append(GrpcRetryPushbackMsMetadata::key(), count.millis());
|
900
|
+
}
|
901
|
+
|
902
|
+
void Encode(LbTokenMetadata, const Slice& slice) {
|
903
|
+
Append(LbTokenMetadata::key(), slice);
|
994
904
|
}
|
995
905
|
|
996
906
|
private:
|
907
|
+
void Append(absl::string_view key, int64_t value) {
|
908
|
+
Append(StaticSlice::FromStaticString(key).c_slice(),
|
909
|
+
Slice::FromInt64(value).c_slice());
|
910
|
+
}
|
911
|
+
|
912
|
+
void Append(absl::string_view key, const Slice& value) {
|
913
|
+
Append(StaticSlice::FromStaticString(key).c_slice(), value.c_slice());
|
914
|
+
}
|
915
|
+
|
997
916
|
void Append(grpc_slice key, grpc_slice value) {
|
998
917
|
auto* mdusr = &dest_->metadata[dest_->count++];
|
999
918
|
mdusr->key = key;
|
@@ -1004,14 +923,14 @@ class PublishToAppEncoder {
|
|
1004
923
|
};
|
1005
924
|
} // namespace
|
1006
925
|
|
1007
|
-
|
1008
|
-
|
926
|
+
void FilterStackCall::PublishAppMetadata(grpc_metadata_batch* b,
|
927
|
+
bool is_trailing) {
|
1009
928
|
if (b->count() == 0) return;
|
1010
|
-
if (!
|
1011
|
-
if (is_trailing &&
|
929
|
+
if (!is_client() && is_trailing) return;
|
930
|
+
if (is_trailing && buffered_metadata_[1] == nullptr) return;
|
1012
931
|
GPR_TIMER_SCOPE("publish_app_metadata", 0);
|
1013
932
|
grpc_metadata_array* dest;
|
1014
|
-
dest =
|
933
|
+
dest = buffered_metadata_[is_trailing];
|
1015
934
|
if (dest->count + b->count() > dest->capacity) {
|
1016
935
|
dest->capacity =
|
1017
936
|
std::max(dest->capacity + b->count(), dest->capacity * 3 / 2);
|
@@ -1022,95 +941,57 @@ static void publish_app_metadata(grpc_call* call, grpc_metadata_batch* b,
|
|
1022
941
|
b->Encode(&encoder);
|
1023
942
|
}
|
1024
943
|
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
}
|
1033
|
-
if (b->legacy_index()->named.grpc_encoding != nullptr) {
|
1034
|
-
GPR_TIMER_SCOPE("incoming_message_compression_algorithm", 0);
|
1035
|
-
set_incoming_message_compression_algorithm(
|
1036
|
-
call,
|
1037
|
-
decode_message_compression(b->legacy_index()->named.grpc_encoding->md));
|
1038
|
-
b->Remove(GRPC_BATCH_GRPC_ENCODING);
|
1039
|
-
}
|
1040
|
-
uint32_t message_encodings_accepted_by_peer = 1u;
|
1041
|
-
uint32_t stream_encodings_accepted_by_peer = 1u;
|
1042
|
-
if (b->legacy_index()->named.grpc_accept_encoding != nullptr) {
|
1043
|
-
GPR_TIMER_SCOPE("encodings_accepted_by_peer", 0);
|
1044
|
-
set_encodings_accepted_by_peer(
|
1045
|
-
call, b->legacy_index()->named.grpc_accept_encoding->md,
|
1046
|
-
&message_encodings_accepted_by_peer, false);
|
1047
|
-
b->Remove(GRPC_BATCH_GRPC_ACCEPT_ENCODING);
|
1048
|
-
}
|
1049
|
-
if (b->legacy_index()->named.accept_encoding != nullptr) {
|
1050
|
-
GPR_TIMER_SCOPE("stream_encodings_accepted_by_peer", 0);
|
1051
|
-
set_encodings_accepted_by_peer(call,
|
1052
|
-
b->legacy_index()->named.accept_encoding->md,
|
1053
|
-
&stream_encodings_accepted_by_peer, true);
|
1054
|
-
b->Remove(GRPC_BATCH_ACCEPT_ENCODING);
|
1055
|
-
}
|
1056
|
-
call->encodings_accepted_by_peer =
|
1057
|
-
grpc_compression_bitset_from_message_stream_compression_bitset(
|
1058
|
-
message_encodings_accepted_by_peer,
|
1059
|
-
stream_encodings_accepted_by_peer);
|
1060
|
-
publish_app_metadata(call, b, false);
|
944
|
+
void FilterStackCall::RecvInitialFilter(grpc_metadata_batch* b) {
|
945
|
+
incoming_compression_algorithm_ =
|
946
|
+
b->Take(GrpcEncodingMetadata()).value_or(GRPC_COMPRESS_NONE);
|
947
|
+
encodings_accepted_by_peer_ =
|
948
|
+
b->Take(GrpcAcceptEncodingMetadata())
|
949
|
+
.value_or(CompressionAlgorithmSet{GRPC_COMPRESS_NONE});
|
950
|
+
PublishAppMetadata(b, false);
|
1061
951
|
}
|
1062
952
|
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
set_final_status(call, batch_error);
|
1068
|
-
} else if (b->legacy_index()->named.grpc_status != nullptr) {
|
1069
|
-
grpc_status_code status_code = grpc_get_status_code_from_metadata(
|
1070
|
-
b->legacy_index()->named.grpc_status->md);
|
1071
|
-
grpc_error_handle error = GRPC_ERROR_NONE;
|
1072
|
-
if (status_code != GRPC_STATUS_OK) {
|
1073
|
-
char* peer = grpc_call_get_peer(call);
|
1074
|
-
error = grpc_error_set_int(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
|
1075
|
-
"Error received from peer ", peer)),
|
1076
|
-
GRPC_ERROR_INT_GRPC_STATUS,
|
1077
|
-
static_cast<intptr_t>(status_code));
|
1078
|
-
gpr_free(peer);
|
1079
|
-
}
|
1080
|
-
auto grpc_message = b->Take(grpc_core::GrpcMessageMetadata());
|
1081
|
-
if (grpc_message.has_value()) {
|
1082
|
-
error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE,
|
1083
|
-
grpc_message->as_string_view());
|
1084
|
-
} else if (error != GRPC_ERROR_NONE) {
|
1085
|
-
error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE, "");
|
1086
|
-
}
|
1087
|
-
set_final_status(call, GRPC_ERROR_REF(error));
|
1088
|
-
b->Remove(GRPC_BATCH_GRPC_STATUS);
|
1089
|
-
GRPC_ERROR_UNREF(error);
|
1090
|
-
} else if (!call->is_client) {
|
1091
|
-
set_final_status(call, GRPC_ERROR_NONE);
|
953
|
+
void FilterStackCall::RecvTrailingFilter(grpc_metadata_batch* b,
|
954
|
+
grpc_error_handle batch_error) {
|
955
|
+
if (!GRPC_ERROR_IS_NONE(batch_error)) {
|
956
|
+
SetFinalStatus(batch_error);
|
1092
957
|
} else {
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
958
|
+
absl::optional<grpc_status_code> grpc_status =
|
959
|
+
b->Take(GrpcStatusMetadata());
|
960
|
+
if (grpc_status.has_value()) {
|
961
|
+
grpc_status_code status_code = *grpc_status;
|
962
|
+
grpc_error_handle error = GRPC_ERROR_NONE;
|
963
|
+
if (status_code != GRPC_STATUS_OK) {
|
964
|
+
char* peer = GetPeer();
|
965
|
+
error = grpc_error_set_int(
|
966
|
+
GRPC_ERROR_CREATE_FROM_CPP_STRING(
|
967
|
+
absl::StrCat("Error received from peer ", peer)),
|
968
|
+
GRPC_ERROR_INT_GRPC_STATUS, static_cast<intptr_t>(status_code));
|
969
|
+
gpr_free(peer);
|
970
|
+
}
|
971
|
+
auto grpc_message = b->Take(GrpcMessageMetadata());
|
972
|
+
if (grpc_message.has_value()) {
|
973
|
+
error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE,
|
974
|
+
grpc_message->as_string_view());
|
975
|
+
} else if (!GRPC_ERROR_IS_NONE(error)) {
|
976
|
+
error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE, "");
|
977
|
+
}
|
978
|
+
SetFinalStatus(GRPC_ERROR_REF(error));
|
979
|
+
GRPC_ERROR_UNREF(error);
|
980
|
+
} else if (!is_client()) {
|
981
|
+
SetFinalStatus(GRPC_ERROR_NONE);
|
982
|
+
} else {
|
983
|
+
gpr_log(GPR_DEBUG,
|
984
|
+
"Received trailing metadata with no error and no status");
|
985
|
+
SetFinalStatus(grpc_error_set_int(
|
986
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("No status received"),
|
987
|
+
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNKNOWN));
|
988
|
+
}
|
989
|
+
}
|
990
|
+
PublishAppMetadata(b, true);
|
1107
991
|
}
|
1108
992
|
|
1109
|
-
|
1110
|
-
|
1111
|
-
*/
|
1112
|
-
|
1113
|
-
static bool are_write_flags_valid(uint32_t flags) {
|
993
|
+
namespace {
|
994
|
+
bool AreWriteFlagsValid(uint32_t flags) {
|
1114
995
|
/* check that only bits in GRPC_WRITE_(INTERNAL?)_USED_MASK are set */
|
1115
996
|
const uint32_t allowed_write_positions =
|
1116
997
|
(GRPC_WRITE_USED_MASK | GRPC_WRITE_INTERNAL_USED_MASK);
|
@@ -1118,16 +999,13 @@ static bool are_write_flags_valid(uint32_t flags) {
|
|
1118
999
|
return !(flags & invalid_positions);
|
1119
1000
|
}
|
1120
1001
|
|
1121
|
-
|
1002
|
+
bool AreInitialMetadataFlagsValid(uint32_t flags) {
|
1122
1003
|
/* check that only bits in GRPC_WRITE_(INTERNAL?)_USED_MASK are set */
|
1123
1004
|
uint32_t invalid_positions = ~GRPC_INITIAL_METADATA_USED_MASK;
|
1124
|
-
if (!is_client) {
|
1125
|
-
invalid_positions |= GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
|
1126
|
-
}
|
1127
1005
|
return !(flags & invalid_positions);
|
1128
1006
|
}
|
1129
1007
|
|
1130
|
-
|
1008
|
+
size_t BatchSlotForOp(grpc_op_type type) {
|
1131
1009
|
switch (type) {
|
1132
1010
|
case GRPC_OP_SEND_INITIAL_METADATA:
|
1133
1011
|
return 0;
|
@@ -1146,353 +1024,228 @@ static size_t batch_slot_for_op(grpc_op_type type) {
|
|
1146
1024
|
}
|
1147
1025
|
GPR_UNREACHABLE_CODE(return 123456789);
|
1148
1026
|
}
|
1027
|
+
} // namespace
|
1149
1028
|
|
1150
|
-
|
1151
|
-
|
1152
|
-
size_t slot_idx =
|
1153
|
-
|
1154
|
-
|
1029
|
+
FilterStackCall::BatchControl* FilterStackCall::ReuseOrAllocateBatchControl(
|
1030
|
+
const grpc_op* ops) {
|
1031
|
+
size_t slot_idx = BatchSlotForOp(ops[0].op);
|
1032
|
+
BatchControl** pslot = &active_batches_[slot_idx];
|
1033
|
+
BatchControl* bctl;
|
1155
1034
|
if (*pslot != nullptr) {
|
1156
1035
|
bctl = *pslot;
|
1157
|
-
if (bctl->
|
1036
|
+
if (bctl->call_ != nullptr) {
|
1158
1037
|
return nullptr;
|
1159
1038
|
}
|
1160
|
-
bctl->~
|
1161
|
-
bctl->
|
1162
|
-
new (&bctl->
|
1039
|
+
bctl->~BatchControl();
|
1040
|
+
bctl->op_ = {};
|
1041
|
+
new (&bctl->batch_error_) AtomicError();
|
1163
1042
|
} else {
|
1164
|
-
bctl =
|
1043
|
+
bctl = arena()->New<BatchControl>();
|
1165
1044
|
*pslot = bctl;
|
1166
1045
|
}
|
1167
|
-
bctl->
|
1168
|
-
bctl->
|
1046
|
+
bctl->call_ = this;
|
1047
|
+
bctl->op_.payload = &stream_op_payload_;
|
1169
1048
|
return bctl;
|
1170
1049
|
}
|
1171
1050
|
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1051
|
+
void Call::PropagateCancellationToChildren() {
|
1052
|
+
ParentCall* pc = parent_call();
|
1053
|
+
if (pc != nullptr) {
|
1054
|
+
Call* child;
|
1055
|
+
MutexLock lock(&pc->child_list_mu);
|
1056
|
+
child = pc->first_child;
|
1057
|
+
if (child != nullptr) {
|
1058
|
+
do {
|
1059
|
+
Call* next_child_call = child->child_->sibling_next;
|
1060
|
+
if (child->cancellation_is_inherited_) {
|
1061
|
+
child->InternalRef("propagate_cancel");
|
1062
|
+
child->CancelWithError(GRPC_ERROR_CANCELLED);
|
1063
|
+
child->InternalUnref("propagate_cancel");
|
1064
|
+
}
|
1065
|
+
child = next_child_call;
|
1066
|
+
} while (child != pc->first_child);
|
1067
|
+
}
|
1068
|
+
}
|
1182
1069
|
}
|
1183
1070
|
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
grpc_error_handle error = GRPC_ERROR_REF(bctl->batch_error.get());
|
1071
|
+
void FilterStackCall::BatchControl::PostCompletion() {
|
1072
|
+
FilterStackCall* call = call_;
|
1073
|
+
grpc_error_handle error = GRPC_ERROR_REF(batch_error_.get());
|
1188
1074
|
|
1189
|
-
if (
|
1190
|
-
call->
|
1075
|
+
if (op_.send_initial_metadata) {
|
1076
|
+
call->send_initial_metadata_.Clear();
|
1191
1077
|
}
|
1192
|
-
if (
|
1193
|
-
if (
|
1194
|
-
error
|
1078
|
+
if (op_.send_message) {
|
1079
|
+
if (op_.payload->send_message.stream_write_closed &&
|
1080
|
+
GRPC_ERROR_IS_NONE(error)) {
|
1195
1081
|
error = grpc_error_add_child(
|
1196
1082
|
error, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1197
1083
|
"Attempt to send message after stream was closed."));
|
1198
1084
|
}
|
1199
|
-
call->
|
1085
|
+
call->sending_message_ = false;
|
1086
|
+
call->send_slice_buffer_.Clear();
|
1200
1087
|
}
|
1201
|
-
if (
|
1202
|
-
call->
|
1088
|
+
if (op_.send_trailing_metadata) {
|
1089
|
+
call->send_trailing_metadata_.Clear();
|
1203
1090
|
}
|
1204
|
-
if (
|
1091
|
+
if (op_.recv_trailing_metadata) {
|
1205
1092
|
/* propagate cancellation to any interested children */
|
1206
|
-
gpr_atm_rel_store(&call->
|
1207
|
-
|
1208
|
-
if (pc != nullptr) {
|
1209
|
-
grpc_call* child;
|
1210
|
-
gpr_mu_lock(&pc->child_list_mu);
|
1211
|
-
child = pc->first_child;
|
1212
|
-
if (child != nullptr) {
|
1213
|
-
do {
|
1214
|
-
next_child_call = child->child->sibling_next;
|
1215
|
-
if (child->cancellation_is_inherited) {
|
1216
|
-
GRPC_CALL_INTERNAL_REF(child, "propagate_cancel");
|
1217
|
-
cancel_with_error(child, GRPC_ERROR_CANCELLED);
|
1218
|
-
GRPC_CALL_INTERNAL_UNREF(child, "propagate_cancel");
|
1219
|
-
}
|
1220
|
-
child = next_child_call;
|
1221
|
-
} while (child != pc->first_child);
|
1222
|
-
}
|
1223
|
-
gpr_mu_unlock(&pc->child_list_mu);
|
1224
|
-
}
|
1093
|
+
gpr_atm_rel_store(&call->received_final_op_atm_, 1);
|
1094
|
+
call->PropagateCancellationToChildren();
|
1225
1095
|
GRPC_ERROR_UNREF(error);
|
1226
1096
|
error = GRPC_ERROR_NONE;
|
1227
1097
|
}
|
1228
|
-
if (error
|
1229
|
-
*call->
|
1230
|
-
grpc_byte_buffer_destroy(*call->
|
1231
|
-
*call->
|
1098
|
+
if (!GRPC_ERROR_IS_NONE(error) && op_.recv_message &&
|
1099
|
+
*call->receiving_buffer_ != nullptr) {
|
1100
|
+
grpc_byte_buffer_destroy(*call->receiving_buffer_);
|
1101
|
+
*call->receiving_buffer_ = nullptr;
|
1232
1102
|
}
|
1233
|
-
|
1103
|
+
batch_error_.set(GRPC_ERROR_NONE);
|
1234
1104
|
|
1235
|
-
if (
|
1105
|
+
if (completion_data_.notify_tag.is_closure) {
|
1236
1106
|
/* unrefs error */
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
GRPC_CALL_INTERNAL_UNREF(call, "completion");
|
1107
|
+
call_ = nullptr;
|
1108
|
+
Closure::Run(DEBUG_LOCATION,
|
1109
|
+
static_cast<grpc_closure*>(completion_data_.notify_tag.tag),
|
1110
|
+
error);
|
1111
|
+
call->InternalUnref("completion");
|
1243
1112
|
} else {
|
1244
1113
|
/* unrefs error */
|
1245
|
-
grpc_cq_end_op(
|
1246
|
-
|
1247
|
-
|
1114
|
+
grpc_cq_end_op(
|
1115
|
+
call->cq_, completion_data_.notify_tag.tag, error,
|
1116
|
+
[](void* user_data, grpc_cq_completion* /*storage*/) {
|
1117
|
+
BatchControl* bctl = static_cast<BatchControl*>(user_data);
|
1118
|
+
Call* call = bctl->call_;
|
1119
|
+
bctl->call_ = nullptr;
|
1120
|
+
call->InternalUnref("completion");
|
1121
|
+
},
|
1122
|
+
this, &completion_data_.cq_completion);
|
1248
1123
|
}
|
1249
1124
|
}
|
1250
1125
|
|
1251
|
-
|
1252
|
-
if (GPR_UNLIKELY(
|
1253
|
-
|
1126
|
+
void FilterStackCall::BatchControl::FinishStep() {
|
1127
|
+
if (GPR_UNLIKELY(completed_batch_step())) {
|
1128
|
+
PostCompletion();
|
1254
1129
|
}
|
1255
1130
|
}
|
1256
1131
|
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
if (remaining == 0) {
|
1264
|
-
call->receiving_message = false;
|
1265
|
-
call->receiving_stream.reset();
|
1266
|
-
finish_batch_step(bctl);
|
1267
|
-
return;
|
1268
|
-
}
|
1269
|
-
if (call->receiving_stream->Next(remaining, &call->receiving_slice_ready)) {
|
1270
|
-
error = call->receiving_stream->Pull(&call->receiving_slice);
|
1271
|
-
if (error == GRPC_ERROR_NONE) {
|
1272
|
-
grpc_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer,
|
1273
|
-
call->receiving_slice);
|
1274
|
-
} else {
|
1275
|
-
call->receiving_stream.reset();
|
1276
|
-
grpc_byte_buffer_destroy(*call->receiving_buffer);
|
1277
|
-
*call->receiving_buffer = nullptr;
|
1278
|
-
call->receiving_message = false;
|
1279
|
-
finish_batch_step(bctl);
|
1280
|
-
GRPC_ERROR_UNREF(error);
|
1281
|
-
return;
|
1282
|
-
}
|
1283
|
-
} else {
|
1284
|
-
return;
|
1285
|
-
}
|
1286
|
-
}
|
1287
|
-
}
|
1288
|
-
|
1289
|
-
static void receiving_slice_ready(void* bctlp, grpc_error_handle error) {
|
1290
|
-
batch_control* bctl = static_cast<batch_control*>(bctlp);
|
1291
|
-
grpc_call* call = bctl->call;
|
1292
|
-
bool release_error = false;
|
1293
|
-
|
1294
|
-
if (error == GRPC_ERROR_NONE) {
|
1295
|
-
grpc_slice slice;
|
1296
|
-
error = call->receiving_stream->Pull(&slice);
|
1297
|
-
if (error == GRPC_ERROR_NONE) {
|
1298
|
-
grpc_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer,
|
1299
|
-
slice);
|
1300
|
-
continue_receiving_slices(bctl);
|
1301
|
-
} else {
|
1302
|
-
/* Error returned by ByteStream::Pull() needs to be released manually */
|
1303
|
-
release_error = true;
|
1304
|
-
}
|
1305
|
-
}
|
1306
|
-
|
1307
|
-
if (error != GRPC_ERROR_NONE) {
|
1308
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures)) {
|
1309
|
-
GRPC_LOG_IF_ERROR("receiving_slice_ready", GRPC_ERROR_REF(error));
|
1310
|
-
}
|
1311
|
-
call->receiving_stream.reset();
|
1312
|
-
grpc_byte_buffer_destroy(*call->receiving_buffer);
|
1313
|
-
*call->receiving_buffer = nullptr;
|
1314
|
-
call->receiving_message = false;
|
1315
|
-
finish_batch_step(bctl);
|
1316
|
-
if (release_error) {
|
1317
|
-
GRPC_ERROR_UNREF(error);
|
1318
|
-
}
|
1319
|
-
}
|
1320
|
-
}
|
1321
|
-
|
1322
|
-
static void process_data_after_md(batch_control* bctl) {
|
1323
|
-
grpc_call* call = bctl->call;
|
1324
|
-
if (call->receiving_stream == nullptr) {
|
1325
|
-
*call->receiving_buffer = nullptr;
|
1326
|
-
call->receiving_message = false;
|
1327
|
-
finish_batch_step(bctl);
|
1132
|
+
void FilterStackCall::BatchControl::ProcessDataAfterMetadata() {
|
1133
|
+
FilterStackCall* call = call_;
|
1134
|
+
if (!call->receiving_slice_buffer_.has_value()) {
|
1135
|
+
*call->receiving_buffer_ = nullptr;
|
1136
|
+
call->receiving_message_ = false;
|
1137
|
+
FinishStep();
|
1328
1138
|
} else {
|
1329
|
-
call->
|
1330
|
-
if ((call->
|
1331
|
-
(call->
|
1332
|
-
|
1333
|
-
|
1334
|
-
GPR_ASSERT(
|
1335
|
-
grpc_compression_algorithm_from_message_stream_compression_algorithm(
|
1336
|
-
&algo, call->incoming_message_compression_algorithm,
|
1337
|
-
(grpc_stream_compression_algorithm)0));
|
1338
|
-
*call->receiving_buffer =
|
1339
|
-
grpc_raw_compressed_byte_buffer_create(nullptr, 0, algo);
|
1139
|
+
call->test_only_last_message_flags_ = call->receiving_stream_flags_;
|
1140
|
+
if ((call->receiving_stream_flags_ & GRPC_WRITE_INTERNAL_COMPRESS) &&
|
1141
|
+
(call->incoming_compression_algorithm_ != GRPC_COMPRESS_NONE)) {
|
1142
|
+
*call->receiving_buffer_ = grpc_raw_compressed_byte_buffer_create(
|
1143
|
+
nullptr, 0, call->incoming_compression_algorithm_);
|
1340
1144
|
} else {
|
1341
|
-
*call->
|
1145
|
+
*call->receiving_buffer_ = grpc_raw_byte_buffer_create(nullptr, 0);
|
1342
1146
|
}
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1147
|
+
grpc_slice_buffer_move_into(
|
1148
|
+
call->receiving_slice_buffer_->c_slice_buffer(),
|
1149
|
+
&(*call->receiving_buffer_)->data.raw.slice_buffer);
|
1150
|
+
call->receiving_message_ = false;
|
1151
|
+
call->receiving_slice_buffer_.reset();
|
1152
|
+
FinishStep();
|
1153
|
+
}
|
1154
|
+
}
|
1155
|
+
|
1156
|
+
void FilterStackCall::BatchControl::ReceivingStreamReady(
|
1157
|
+
grpc_error_handle error) {
|
1158
|
+
FilterStackCall* call = call_;
|
1159
|
+
if (!GRPC_ERROR_IS_NONE(error)) {
|
1160
|
+
call->receiving_slice_buffer_.reset();
|
1161
|
+
if (batch_error_.ok()) {
|
1162
|
+
batch_error_.set(error);
|
1356
1163
|
}
|
1357
|
-
|
1164
|
+
call->CancelWithError(GRPC_ERROR_REF(error));
|
1358
1165
|
}
|
1359
|
-
/* If recv_state is
|
1166
|
+
/* If recv_state is kRecvNone, we will save the batch_control
|
1360
1167
|
* object with rel_cas, and will not use it after the cas. Its corresponding
|
1361
1168
|
* acq_load is in receiving_initial_metadata_ready() */
|
1362
|
-
if (error
|
1363
|
-
!
|
1364
|
-
|
1365
|
-
|
1169
|
+
if (!GRPC_ERROR_IS_NONE(error) ||
|
1170
|
+
!call->receiving_slice_buffer_.has_value() ||
|
1171
|
+
!gpr_atm_rel_cas(&call->recv_state_, kRecvNone,
|
1172
|
+
reinterpret_cast<gpr_atm>(this))) {
|
1173
|
+
ProcessDataAfterMetadata();
|
1366
1174
|
}
|
1367
1175
|
}
|
1368
1176
|
|
1369
|
-
|
1370
|
-
|
1371
|
-
// before processing the received message.
|
1372
|
-
static void receiving_stream_ready_in_call_combiner(void* bctlp,
|
1373
|
-
grpc_error_handle error) {
|
1374
|
-
batch_control* bctl = static_cast<batch_control*>(bctlp);
|
1375
|
-
grpc_call* call = bctl->call;
|
1376
|
-
GRPC_CALL_COMBINER_STOP(&call->call_combiner, "recv_message_ready");
|
1377
|
-
receiving_stream_ready(bctlp, error);
|
1378
|
-
}
|
1379
|
-
|
1380
|
-
static void GPR_ATTRIBUTE_NOINLINE
|
1381
|
-
handle_both_stream_and_msg_compression_set(grpc_call* call) {
|
1382
|
-
std::string error_msg = absl::StrFormat(
|
1383
|
-
"Incoming stream has both stream compression (%d) and message "
|
1384
|
-
"compression (%d).",
|
1385
|
-
call->incoming_stream_compression_algorithm,
|
1386
|
-
call->incoming_message_compression_algorithm);
|
1387
|
-
gpr_log(GPR_ERROR, "%s", error_msg.c_str());
|
1388
|
-
cancel_with_status(call, GRPC_STATUS_INTERNAL, error_msg.c_str());
|
1389
|
-
}
|
1390
|
-
|
1391
|
-
static void GPR_ATTRIBUTE_NOINLINE
|
1392
|
-
handle_error_parsing_compression_algorithm(grpc_call* call) {
|
1393
|
-
std::string error_msg = absl::StrFormat(
|
1394
|
-
"Error in incoming message compression (%d) or stream "
|
1395
|
-
"compression (%d).",
|
1396
|
-
call->incoming_stream_compression_algorithm,
|
1397
|
-
call->incoming_message_compression_algorithm);
|
1398
|
-
cancel_with_status(call, GRPC_STATUS_INTERNAL, error_msg.c_str());
|
1399
|
-
}
|
1400
|
-
|
1401
|
-
static void GPR_ATTRIBUTE_NOINLINE handle_invalid_compression(
|
1402
|
-
grpc_call* call, grpc_compression_algorithm compression_algorithm) {
|
1403
|
-
std::string error_msg = absl::StrFormat(
|
1404
|
-
"Invalid compression algorithm value '%d'.", compression_algorithm);
|
1405
|
-
gpr_log(GPR_ERROR, "%s", error_msg.c_str());
|
1406
|
-
cancel_with_status(call, GRPC_STATUS_UNIMPLEMENTED, error_msg.c_str());
|
1407
|
-
}
|
1408
|
-
|
1409
|
-
static void GPR_ATTRIBUTE_NOINLINE handle_compression_algorithm_disabled(
|
1410
|
-
grpc_call* call, grpc_compression_algorithm compression_algorithm) {
|
1177
|
+
void FilterStackCall::HandleCompressionAlgorithmDisabled(
|
1178
|
+
grpc_compression_algorithm compression_algorithm) {
|
1411
1179
|
const char* algo_name = nullptr;
|
1412
1180
|
grpc_compression_algorithm_name(compression_algorithm, &algo_name);
|
1413
1181
|
std::string error_msg =
|
1414
1182
|
absl::StrFormat("Compression algorithm '%s' is disabled.", algo_name);
|
1415
1183
|
gpr_log(GPR_ERROR, "%s", error_msg.c_str());
|
1416
|
-
|
1184
|
+
CancelWithStatus(GRPC_STATUS_UNIMPLEMENTED, error_msg.c_str());
|
1417
1185
|
}
|
1418
1186
|
|
1419
|
-
|
1420
|
-
|
1187
|
+
void FilterStackCall::HandleCompressionAlgorithmNotAccepted(
|
1188
|
+
grpc_compression_algorithm compression_algorithm) {
|
1421
1189
|
const char* algo_name = nullptr;
|
1422
1190
|
grpc_compression_algorithm_name(compression_algorithm, &algo_name);
|
1423
1191
|
gpr_log(GPR_ERROR,
|
1424
|
-
"Compression algorithm ('%s') not present in the
|
1425
|
-
"accepted encodings (
|
1426
|
-
algo_name,
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
if (
|
1448
|
-
|
1449
|
-
} else if (GPR_UNLIKELY(
|
1450
|
-
grpc_compression_options_is_algorithm_enabled_internal(
|
1451
|
-
&compression_options, compression_algorithm) == 0)) {
|
1452
|
-
/* check if algorithm is supported by current channel config */
|
1453
|
-
handle_compression_algorithm_disabled(call, compression_algorithm);
|
1454
|
-
}
|
1455
|
-
/* GRPC_COMPRESS_NONE is always set. */
|
1456
|
-
GPR_DEBUG_ASSERT(call->encodings_accepted_by_peer != 0);
|
1457
|
-
if (GPR_UNLIKELY(!grpc_core::GetBit(call->encodings_accepted_by_peer,
|
1458
|
-
compression_algorithm))) {
|
1459
|
-
if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
|
1460
|
-
handle_compression_algorithm_not_accepted(call, compression_algorithm);
|
1461
|
-
}
|
1192
|
+
"Compression algorithm ('%s') not present in the "
|
1193
|
+
"accepted encodings (%s)",
|
1194
|
+
algo_name,
|
1195
|
+
std::string(encodings_accepted_by_peer_.ToString()).c_str());
|
1196
|
+
}
|
1197
|
+
|
1198
|
+
void FilterStackCall::BatchControl::ValidateFilteredMetadata() {
|
1199
|
+
FilterStackCall* call = call_;
|
1200
|
+
|
1201
|
+
const grpc_compression_options compression_options =
|
1202
|
+
call->channel_->compression_options();
|
1203
|
+
const grpc_compression_algorithm compression_algorithm =
|
1204
|
+
call->incoming_compression_algorithm_;
|
1205
|
+
if (GPR_UNLIKELY(!CompressionAlgorithmSet::FromUint32(
|
1206
|
+
compression_options.enabled_algorithms_bitset)
|
1207
|
+
.IsSet(compression_algorithm))) {
|
1208
|
+
/* check if algorithm is supported by current channel config */
|
1209
|
+
call->HandleCompressionAlgorithmDisabled(compression_algorithm);
|
1210
|
+
}
|
1211
|
+
/* GRPC_COMPRESS_NONE is always set. */
|
1212
|
+
GPR_DEBUG_ASSERT(call->encodings_accepted_by_peer_.IsSet(GRPC_COMPRESS_NONE));
|
1213
|
+
if (GPR_UNLIKELY(
|
1214
|
+
!call->encodings_accepted_by_peer_.IsSet(compression_algorithm))) {
|
1215
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
|
1216
|
+
call->HandleCompressionAlgorithmNotAccepted(compression_algorithm);
|
1462
1217
|
}
|
1463
1218
|
}
|
1464
1219
|
}
|
1465
1220
|
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
grpc_call* call = bctl->call;
|
1221
|
+
void FilterStackCall::BatchControl::ReceivingInitialMetadataReady(
|
1222
|
+
grpc_error_handle error) {
|
1223
|
+
FilterStackCall* call = call_;
|
1470
1224
|
|
1471
|
-
GRPC_CALL_COMBINER_STOP(
|
1225
|
+
GRPC_CALL_COMBINER_STOP(call->call_combiner(), "recv_initial_metadata_ready");
|
1472
1226
|
|
1473
|
-
if (error
|
1474
|
-
grpc_metadata_batch* md = &call->
|
1475
|
-
|
1227
|
+
if (GRPC_ERROR_IS_NONE(error)) {
|
1228
|
+
grpc_metadata_batch* md = &call->recv_initial_metadata_;
|
1229
|
+
call->RecvInitialFilter(md);
|
1476
1230
|
|
1477
1231
|
/* TODO(ctiller): this could be moved into recv_initial_filter now */
|
1478
1232
|
GPR_TIMER_SCOPE("validate_filtered_metadata", 0);
|
1479
|
-
|
1233
|
+
ValidateFilteredMetadata();
|
1480
1234
|
|
1481
|
-
absl::optional<
|
1482
|
-
|
1483
|
-
|
1484
|
-
call->send_deadline = *deadline;
|
1235
|
+
absl::optional<Timestamp> deadline = md->get(GrpcTimeoutMetadata());
|
1236
|
+
if (deadline.has_value() && !call->is_client()) {
|
1237
|
+
call_->set_send_deadline(*deadline);
|
1485
1238
|
}
|
1486
1239
|
} else {
|
1487
|
-
if (
|
1488
|
-
|
1240
|
+
if (batch_error_.ok()) {
|
1241
|
+
batch_error_.set(error);
|
1489
1242
|
}
|
1490
|
-
|
1243
|
+
call->CancelWithError(GRPC_ERROR_REF(error));
|
1491
1244
|
}
|
1492
1245
|
|
1493
1246
|
grpc_closure* saved_rsr_closure = nullptr;
|
1494
1247
|
while (true) {
|
1495
|
-
gpr_atm rsr_bctlp = gpr_atm_acq_load(&call->
|
1248
|
+
gpr_atm rsr_bctlp = gpr_atm_acq_load(&call->recv_state_);
|
1496
1249
|
/* Should only receive initial metadata once */
|
1497
1250
|
GPR_ASSERT(rsr_bctlp != 1);
|
1498
1251
|
if (rsr_bctlp == 0) {
|
@@ -1501,62 +1254,57 @@ static void receiving_initial_metadata_ready(void* bctlp,
|
|
1501
1254
|
* no_barrier_cas is used, as this function won't access the batch_control
|
1502
1255
|
* object saved by receiving_stream_ready() if the initial metadata is
|
1503
1256
|
* received first. */
|
1504
|
-
if (gpr_atm_no_barrier_cas(&call->
|
1505
|
-
|
1257
|
+
if (gpr_atm_no_barrier_cas(&call->recv_state_, kRecvNone,
|
1258
|
+
kRecvInitialMetadataFirst)) {
|
1506
1259
|
break;
|
1507
1260
|
}
|
1508
1261
|
} else {
|
1509
1262
|
/* Already received messages */
|
1510
|
-
saved_rsr_closure =
|
1511
|
-
|
1512
|
-
|
1263
|
+
saved_rsr_closure = GRPC_CLOSURE_CREATE(
|
1264
|
+
[](void* bctl, grpc_error_handle error) {
|
1265
|
+
static_cast<BatchControl*>(bctl)->ReceivingStreamReady(error);
|
1266
|
+
},
|
1267
|
+
reinterpret_cast<BatchControl*>(rsr_bctlp),
|
1268
|
+
grpc_schedule_on_exec_ctx);
|
1513
1269
|
/* No need to modify recv_state */
|
1514
1270
|
break;
|
1515
1271
|
}
|
1516
1272
|
}
|
1517
1273
|
if (saved_rsr_closure != nullptr) {
|
1518
|
-
|
1519
|
-
GRPC_ERROR_REF(error));
|
1274
|
+
Closure::Run(DEBUG_LOCATION, saved_rsr_closure, GRPC_ERROR_REF(error));
|
1520
1275
|
}
|
1521
1276
|
|
1522
|
-
|
1277
|
+
FinishStep();
|
1523
1278
|
}
|
1524
1279
|
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
finish_batch_step(bctl);
|
1280
|
+
void FilterStackCall::BatchControl::ReceivingTrailingMetadataReady(
|
1281
|
+
grpc_error_handle error) {
|
1282
|
+
GRPC_CALL_COMBINER_STOP(call_->call_combiner(),
|
1283
|
+
"recv_trailing_metadata_ready");
|
1284
|
+
grpc_metadata_batch* md = &call_->recv_trailing_metadata_;
|
1285
|
+
call_->RecvTrailingFilter(md, GRPC_ERROR_REF(error));
|
1286
|
+
FinishStep();
|
1533
1287
|
}
|
1534
1288
|
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
if (bctl->batch_error.ok()) {
|
1540
|
-
bctl->batch_error.set(error);
|
1289
|
+
void FilterStackCall::BatchControl::FinishBatch(grpc_error_handle error) {
|
1290
|
+
GRPC_CALL_COMBINER_STOP(call_->call_combiner(), "on_complete");
|
1291
|
+
if (batch_error_.ok()) {
|
1292
|
+
batch_error_.set(error);
|
1541
1293
|
}
|
1542
|
-
if (error
|
1543
|
-
|
1294
|
+
if (!GRPC_ERROR_IS_NONE(error)) {
|
1295
|
+
call_->CancelWithError(GRPC_ERROR_REF(error));
|
1544
1296
|
}
|
1545
|
-
|
1297
|
+
FinishStep();
|
1546
1298
|
}
|
1547
1299
|
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
1553
|
-
size_t nops, void* notify_tag,
|
1554
|
-
int is_notify_tag_closure) {
|
1300
|
+
grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops,
|
1301
|
+
void* notify_tag,
|
1302
|
+
bool is_notify_tag_closure) {
|
1555
1303
|
GPR_TIMER_SCOPE("call_start_batch", 0);
|
1556
1304
|
|
1557
1305
|
size_t i;
|
1558
1306
|
const grpc_op* op;
|
1559
|
-
|
1307
|
+
BatchControl* bctl;
|
1560
1308
|
bool has_send_ops = false;
|
1561
1309
|
int num_recv_ops = 0;
|
1562
1310
|
grpc_call_error error = GRPC_CALL_OK;
|
@@ -1575,30 +1323,31 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1575
1323
|
|
1576
1324
|
if (nops == 0) {
|
1577
1325
|
if (!is_notify_tag_closure) {
|
1578
|
-
GPR_ASSERT(grpc_cq_begin_op(
|
1579
|
-
grpc_cq_end_op(
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1326
|
+
GPR_ASSERT(grpc_cq_begin_op(cq_, notify_tag));
|
1327
|
+
grpc_cq_end_op(
|
1328
|
+
cq_, notify_tag, GRPC_ERROR_NONE,
|
1329
|
+
[](void*, grpc_cq_completion* completion) { gpr_free(completion); },
|
1330
|
+
nullptr,
|
1331
|
+
static_cast<grpc_cq_completion*>(
|
1332
|
+
gpr_malloc(sizeof(grpc_cq_completion))));
|
1583
1333
|
} else {
|
1584
|
-
|
1585
|
-
|
1586
|
-
GRPC_ERROR_NONE);
|
1334
|
+
Closure::Run(DEBUG_LOCATION, static_cast<grpc_closure*>(notify_tag),
|
1335
|
+
GRPC_ERROR_NONE);
|
1587
1336
|
}
|
1588
1337
|
error = GRPC_CALL_OK;
|
1589
1338
|
goto done;
|
1590
1339
|
}
|
1591
1340
|
|
1592
|
-
bctl =
|
1341
|
+
bctl = ReuseOrAllocateBatchControl(ops);
|
1593
1342
|
if (bctl == nullptr) {
|
1594
1343
|
return GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
1595
1344
|
}
|
1596
|
-
bctl->
|
1597
|
-
bctl->
|
1345
|
+
bctl->completion_data_.notify_tag.tag = notify_tag;
|
1346
|
+
bctl->completion_data_.notify_tag.is_closure =
|
1598
1347
|
static_cast<uint8_t>(is_notify_tag_closure != 0);
|
1599
1348
|
|
1600
|
-
stream_op = &bctl->
|
1601
|
-
stream_op_payload = &
|
1349
|
+
stream_op = &bctl->op_;
|
1350
|
+
stream_op_payload = &stream_op_payload_;
|
1602
1351
|
|
1603
1352
|
/* rewrite batch ops into a transport op */
|
1604
1353
|
for (i = 0; i < nops; i++) {
|
@@ -1610,11 +1359,11 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1610
1359
|
switch (op->op) {
|
1611
1360
|
case GRPC_OP_SEND_INITIAL_METADATA: {
|
1612
1361
|
/* Flag validation: currently allow no flags */
|
1613
|
-
if (!
|
1362
|
+
if (!AreInitialMetadataFlagsValid(op->flags)) {
|
1614
1363
|
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
1615
1364
|
goto done_with_error;
|
1616
1365
|
}
|
1617
|
-
if (
|
1366
|
+
if (sent_initial_metadata_) {
|
1618
1367
|
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
1619
1368
|
goto done_with_error;
|
1620
1369
|
}
|
@@ -1623,10 +1372,6 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1623
1372
|
// GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY, we shouldn't override that
|
1624
1373
|
// with the compression algorithm mapped from compression level.
|
1625
1374
|
/* process compression level */
|
1626
|
-
grpc_metadata& compression_md = call->compression_md;
|
1627
|
-
compression_md.key = grpc_empty_slice();
|
1628
|
-
compression_md.value = grpc_empty_slice();
|
1629
|
-
size_t additional_metadata_count = 0;
|
1630
1375
|
grpc_compression_level effective_compression_level =
|
1631
1376
|
GRPC_COMPRESS_LEVEL_NONE;
|
1632
1377
|
bool level_set = false;
|
@@ -1636,66 +1381,52 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1636
1381
|
level_set = true;
|
1637
1382
|
} else {
|
1638
1383
|
const grpc_compression_options copts =
|
1639
|
-
|
1384
|
+
channel_->compression_options();
|
1640
1385
|
if (copts.default_level.is_set) {
|
1641
1386
|
level_set = true;
|
1642
1387
|
effective_compression_level = copts.default_level.level;
|
1643
1388
|
}
|
1644
1389
|
}
|
1645
1390
|
// Currently, only server side supports compression level setting.
|
1646
|
-
if (level_set && !
|
1391
|
+
if (level_set && !is_client()) {
|
1647
1392
|
const grpc_compression_algorithm calgo =
|
1648
|
-
|
1649
|
-
|
1393
|
+
encodings_accepted_by_peer_.CompressionAlgorithmForLevel(
|
1394
|
+
effective_compression_level);
|
1650
1395
|
// The following metadata will be checked and removed by the message
|
1651
1396
|
// compression filter. It will be used as the call's compression
|
1652
1397
|
// algorithm.
|
1653
|
-
|
1654
|
-
compression_md.value = grpc_compression_algorithm_slice(calgo);
|
1655
|
-
additional_metadata_count++;
|
1398
|
+
send_initial_metadata_.Set(GrpcInternalEncodingRequest(), calgo);
|
1656
1399
|
}
|
1657
|
-
if (op->data.send_initial_metadata.count
|
1658
|
-
INT_MAX) {
|
1400
|
+
if (op->data.send_initial_metadata.count > INT_MAX) {
|
1659
1401
|
error = GRPC_CALL_ERROR_INVALID_METADATA;
|
1660
1402
|
goto done_with_error;
|
1661
1403
|
}
|
1662
1404
|
stream_op->send_initial_metadata = true;
|
1663
|
-
|
1664
|
-
if (
|
1665
|
-
|
1666
|
-
|
1667
|
-
for (int i = 0; i < call->send_extra_metadata_count; i++) {
|
1668
|
-
GRPC_LOG_IF_ERROR("prepare_client_metadata",
|
1669
|
-
call->send_initial_metadata.LinkTail(
|
1670
|
-
&call->send_extra_metadata[i]));
|
1671
|
-
}
|
1672
|
-
call->send_extra_metadata_count = 0;
|
1673
|
-
}
|
1674
|
-
if (!prepare_application_metadata(
|
1675
|
-
call, static_cast<int>(op->data.send_initial_metadata.count),
|
1676
|
-
op->data.send_initial_metadata.metadata, 0, &compression_md,
|
1677
|
-
static_cast<int>(additional_metadata_count))) {
|
1405
|
+
sent_initial_metadata_ = true;
|
1406
|
+
if (!PrepareApplicationMetadata(op->data.send_initial_metadata.count,
|
1407
|
+
op->data.send_initial_metadata.metadata,
|
1408
|
+
false)) {
|
1678
1409
|
error = GRPC_CALL_ERROR_INVALID_METADATA;
|
1679
1410
|
goto done_with_error;
|
1680
1411
|
}
|
1412
|
+
// Ignore any te metadata key value pairs specified.
|
1413
|
+
send_initial_metadata_.Remove(TeMetadata());
|
1681
1414
|
/* TODO(ctiller): just make these the same variable? */
|
1682
|
-
if (
|
1683
|
-
|
1684
|
-
call->send_deadline);
|
1415
|
+
if (is_client() && send_deadline() != Timestamp::InfFuture()) {
|
1416
|
+
send_initial_metadata_.Set(GrpcTimeoutMetadata(), send_deadline());
|
1685
1417
|
}
|
1686
1418
|
stream_op_payload->send_initial_metadata.send_initial_metadata =
|
1687
|
-
&
|
1419
|
+
&send_initial_metadata_;
|
1688
1420
|
stream_op_payload->send_initial_metadata.send_initial_metadata_flags =
|
1689
1421
|
op->flags;
|
1690
|
-
if (
|
1691
|
-
stream_op_payload->send_initial_metadata.peer_string =
|
1692
|
-
&call->peer_string;
|
1422
|
+
if (is_client()) {
|
1423
|
+
stream_op_payload->send_initial_metadata.peer_string = &peer_string_;
|
1693
1424
|
}
|
1694
1425
|
has_send_ops = true;
|
1695
1426
|
break;
|
1696
1427
|
}
|
1697
1428
|
case GRPC_OP_SEND_MESSAGE: {
|
1698
|
-
if (!
|
1429
|
+
if (!AreWriteFlagsValid(op->flags)) {
|
1699
1430
|
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
1700
1431
|
goto done_with_error;
|
1701
1432
|
}
|
@@ -1703,7 +1434,7 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1703
1434
|
error = GRPC_CALL_ERROR_INVALID_MESSAGE;
|
1704
1435
|
goto done_with_error;
|
1705
1436
|
}
|
1706
|
-
if (
|
1437
|
+
if (sending_message_) {
|
1707
1438
|
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
1708
1439
|
goto done_with_error;
|
1709
1440
|
}
|
@@ -1716,11 +1447,13 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1716
1447
|
flags |= GRPC_WRITE_INTERNAL_COMPRESS;
|
1717
1448
|
}
|
1718
1449
|
stream_op->send_message = true;
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1450
|
+
sending_message_ = true;
|
1451
|
+
send_slice_buffer_.Clear();
|
1452
|
+
grpc_slice_buffer_move_into(
|
1453
|
+
&op->data.send_message.send_message->data.raw.slice_buffer,
|
1454
|
+
send_slice_buffer_.c_slice_buffer());
|
1455
|
+
stream_op_payload->send_message.flags = flags;
|
1456
|
+
stream_op_payload->send_message.send_message = &send_slice_buffer_;
|
1724
1457
|
has_send_ops = true;
|
1725
1458
|
break;
|
1726
1459
|
}
|
@@ -1730,18 +1463,18 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1730
1463
|
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
1731
1464
|
goto done_with_error;
|
1732
1465
|
}
|
1733
|
-
if (!
|
1466
|
+
if (!is_client()) {
|
1734
1467
|
error = GRPC_CALL_ERROR_NOT_ON_SERVER;
|
1735
1468
|
goto done_with_error;
|
1736
1469
|
}
|
1737
|
-
if (
|
1470
|
+
if (sent_final_op_) {
|
1738
1471
|
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
1739
1472
|
goto done_with_error;
|
1740
1473
|
}
|
1741
1474
|
stream_op->send_trailing_metadata = true;
|
1742
|
-
|
1475
|
+
sent_final_op_ = true;
|
1743
1476
|
stream_op_payload->send_trailing_metadata.send_trailing_metadata =
|
1744
|
-
&
|
1477
|
+
&send_trailing_metadata_;
|
1745
1478
|
has_send_ops = true;
|
1746
1479
|
break;
|
1747
1480
|
}
|
@@ -1751,11 +1484,11 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1751
1484
|
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
1752
1485
|
goto done_with_error;
|
1753
1486
|
}
|
1754
|
-
if (
|
1487
|
+
if (is_client()) {
|
1755
1488
|
error = GRPC_CALL_ERROR_NOT_ON_CLIENT;
|
1756
1489
|
goto done_with_error;
|
1757
1490
|
}
|
1758
|
-
if (
|
1491
|
+
if (sent_final_op_) {
|
1759
1492
|
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
1760
1493
|
goto done_with_error;
|
1761
1494
|
}
|
@@ -1765,14 +1498,11 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1765
1498
|
goto done_with_error;
|
1766
1499
|
}
|
1767
1500
|
stream_op->send_trailing_metadata = true;
|
1768
|
-
|
1769
|
-
|
1770
|
-
if (!
|
1771
|
-
|
1772
|
-
|
1773
|
-
op->data.send_status_from_server.trailing_metadata_count),
|
1774
|
-
op->data.send_status_from_server.trailing_metadata, 1, nullptr,
|
1775
|
-
0)) {
|
1501
|
+
sent_final_op_ = true;
|
1502
|
+
|
1503
|
+
if (!PrepareApplicationMetadata(
|
1504
|
+
op->data.send_status_from_server.trailing_metadata_count,
|
1505
|
+
op->data.send_status_from_server.trailing_metadata, true)) {
|
1776
1506
|
error = GRPC_CALL_ERROR_INVALID_METADATA;
|
1777
1507
|
goto done_with_error;
|
1778
1508
|
}
|
@@ -1787,30 +1517,30 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1787
1517
|
static_cast<intptr_t>(
|
1788
1518
|
op->data.send_status_from_server.status));
|
1789
1519
|
if (op->data.send_status_from_server.status_details != nullptr) {
|
1790
|
-
|
1791
|
-
|
1792
|
-
|
1520
|
+
send_trailing_metadata_.Set(
|
1521
|
+
GrpcMessageMetadata(),
|
1522
|
+
Slice(grpc_slice_copy(
|
1793
1523
|
*op->data.send_status_from_server.status_details)));
|
1794
|
-
if (status_error
|
1524
|
+
if (!GRPC_ERROR_IS_NONE(status_error)) {
|
1795
1525
|
status_error = grpc_error_set_str(
|
1796
1526
|
status_error, GRPC_ERROR_STR_GRPC_MESSAGE,
|
1797
|
-
|
1527
|
+
StringViewFromSlice(
|
1798
1528
|
*op->data.send_status_from_server.status_details));
|
1799
1529
|
}
|
1800
1530
|
}
|
1801
1531
|
|
1802
|
-
|
1532
|
+
status_error_.set(status_error);
|
1803
1533
|
GRPC_ERROR_UNREF(status_error);
|
1804
1534
|
|
1805
|
-
|
1806
|
-
|
1807
|
-
call->send_trailing_metadata.Append(grpc_get_reffed_status_elem(
|
1808
|
-
op->data.send_status_from_server.status)));
|
1535
|
+
send_trailing_metadata_.Set(GrpcStatusMetadata(),
|
1536
|
+
op->data.send_status_from_server.status);
|
1809
1537
|
|
1538
|
+
// Ignore any te metadata key value pairs specified.
|
1539
|
+
send_trailing_metadata_.Remove(TeMetadata());
|
1810
1540
|
stream_op_payload->send_trailing_metadata.send_trailing_metadata =
|
1811
|
-
&
|
1541
|
+
&send_trailing_metadata_;
|
1812
1542
|
stream_op_payload->send_trailing_metadata.sent =
|
1813
|
-
&
|
1543
|
+
&sent_server_trailing_metadata_;
|
1814
1544
|
has_send_ops = true;
|
1815
1545
|
break;
|
1816
1546
|
}
|
@@ -1820,27 +1550,30 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1820
1550
|
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
1821
1551
|
goto done_with_error;
|
1822
1552
|
}
|
1823
|
-
if (
|
1553
|
+
if (received_initial_metadata_) {
|
1824
1554
|
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
1825
1555
|
goto done_with_error;
|
1826
1556
|
}
|
1827
|
-
|
1828
|
-
|
1557
|
+
received_initial_metadata_ = true;
|
1558
|
+
buffered_metadata_[0] =
|
1829
1559
|
op->data.recv_initial_metadata.recv_initial_metadata;
|
1830
|
-
GRPC_CLOSURE_INIT(
|
1831
|
-
|
1832
|
-
|
1560
|
+
GRPC_CLOSURE_INIT(
|
1561
|
+
&receiving_initial_metadata_ready_,
|
1562
|
+
[](void* bctl, grpc_error_handle error) {
|
1563
|
+
static_cast<BatchControl*>(bctl)->ReceivingInitialMetadataReady(
|
1564
|
+
error);
|
1565
|
+
},
|
1566
|
+
bctl, grpc_schedule_on_exec_ctx);
|
1833
1567
|
stream_op->recv_initial_metadata = true;
|
1834
1568
|
stream_op_payload->recv_initial_metadata.recv_initial_metadata =
|
1835
|
-
&
|
1569
|
+
&recv_initial_metadata_;
|
1836
1570
|
stream_op_payload->recv_initial_metadata.recv_initial_metadata_ready =
|
1837
|
-
&
|
1838
|
-
if (
|
1571
|
+
&receiving_initial_metadata_ready_;
|
1572
|
+
if (is_client()) {
|
1839
1573
|
stream_op_payload->recv_initial_metadata.trailing_metadata_available =
|
1840
|
-
&
|
1574
|
+
&is_trailers_only_;
|
1841
1575
|
} else {
|
1842
|
-
stream_op_payload->recv_initial_metadata.peer_string =
|
1843
|
-
&call->peer_string;
|
1576
|
+
stream_op_payload->recv_initial_metadata.peer_string = &peer_string_;
|
1844
1577
|
}
|
1845
1578
|
++num_recv_ops;
|
1846
1579
|
break;
|
@@ -1851,21 +1584,33 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1851
1584
|
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
1852
1585
|
goto done_with_error;
|
1853
1586
|
}
|
1854
|
-
if (
|
1587
|
+
if (receiving_message_) {
|
1855
1588
|
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
1856
1589
|
goto done_with_error;
|
1857
1590
|
}
|
1858
|
-
|
1591
|
+
receiving_message_ = true;
|
1859
1592
|
stream_op->recv_message = true;
|
1860
|
-
|
1861
|
-
|
1593
|
+
receiving_slice_buffer_.reset();
|
1594
|
+
receiving_buffer_ = op->data.recv_message.recv_message;
|
1595
|
+
stream_op_payload->recv_message.recv_message = &receiving_slice_buffer_;
|
1596
|
+
receiving_stream_flags_ = 0;
|
1597
|
+
stream_op_payload->recv_message.flags = &receiving_stream_flags_;
|
1862
1598
|
stream_op_payload->recv_message.call_failed_before_recv_message =
|
1863
|
-
&
|
1864
|
-
GRPC_CLOSURE_INIT(
|
1865
|
-
|
1866
|
-
|
1599
|
+
&call_failed_before_recv_message_;
|
1600
|
+
GRPC_CLOSURE_INIT(
|
1601
|
+
&receiving_stream_ready_,
|
1602
|
+
[](void* bctlp, grpc_error_handle error) {
|
1603
|
+
auto* bctl = static_cast<BatchControl*>(bctlp);
|
1604
|
+
auto* call = bctl->call_;
|
1605
|
+
// Yields the call combiner before processing the received
|
1606
|
+
// message.
|
1607
|
+
GRPC_CALL_COMBINER_STOP(call->call_combiner(),
|
1608
|
+
"recv_message_ready");
|
1609
|
+
bctl->ReceivingStreamReady(error);
|
1610
|
+
},
|
1611
|
+
bctl, grpc_schedule_on_exec_ctx);
|
1867
1612
|
stream_op_payload->recv_message.recv_message_ready =
|
1868
|
-
&
|
1613
|
+
&receiving_stream_ready_;
|
1869
1614
|
++num_recv_ops;
|
1870
1615
|
break;
|
1871
1616
|
}
|
@@ -1875,32 +1620,36 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1875
1620
|
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
1876
1621
|
goto done_with_error;
|
1877
1622
|
}
|
1878
|
-
if (!
|
1623
|
+
if (!is_client()) {
|
1879
1624
|
error = GRPC_CALL_ERROR_NOT_ON_SERVER;
|
1880
1625
|
goto done_with_error;
|
1881
1626
|
}
|
1882
|
-
if (
|
1627
|
+
if (requested_final_op_) {
|
1883
1628
|
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
1884
1629
|
goto done_with_error;
|
1885
1630
|
}
|
1886
|
-
|
1887
|
-
|
1631
|
+
requested_final_op_ = true;
|
1632
|
+
buffered_metadata_[1] =
|
1888
1633
|
op->data.recv_status_on_client.trailing_metadata;
|
1889
|
-
|
1890
|
-
|
1634
|
+
final_op_.client.status = op->data.recv_status_on_client.status;
|
1635
|
+
final_op_.client.status_details =
|
1891
1636
|
op->data.recv_status_on_client.status_details;
|
1892
|
-
|
1637
|
+
final_op_.client.error_string =
|
1893
1638
|
op->data.recv_status_on_client.error_string;
|
1894
1639
|
stream_op->recv_trailing_metadata = true;
|
1895
1640
|
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata =
|
1896
|
-
&
|
1641
|
+
&recv_trailing_metadata_;
|
1897
1642
|
stream_op_payload->recv_trailing_metadata.collect_stats =
|
1898
|
-
&
|
1899
|
-
GRPC_CLOSURE_INIT(
|
1900
|
-
|
1901
|
-
|
1643
|
+
&final_info_.stats.transport_stream_stats;
|
1644
|
+
GRPC_CLOSURE_INIT(
|
1645
|
+
&receiving_trailing_metadata_ready_,
|
1646
|
+
[](void* bctl, grpc_error_handle error) {
|
1647
|
+
static_cast<BatchControl*>(bctl)->ReceivingTrailingMetadataReady(
|
1648
|
+
error);
|
1649
|
+
},
|
1650
|
+
bctl, grpc_schedule_on_exec_ctx);
|
1902
1651
|
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata_ready =
|
1903
|
-
&
|
1652
|
+
&receiving_trailing_metadata_ready_;
|
1904
1653
|
++num_recv_ops;
|
1905
1654
|
break;
|
1906
1655
|
}
|
@@ -1910,47 +1659,53 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
1910
1659
|
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
1911
1660
|
goto done_with_error;
|
1912
1661
|
}
|
1913
|
-
if (
|
1662
|
+
if (is_client()) {
|
1914
1663
|
error = GRPC_CALL_ERROR_NOT_ON_CLIENT;
|
1915
1664
|
goto done_with_error;
|
1916
1665
|
}
|
1917
|
-
if (
|
1666
|
+
if (requested_final_op_) {
|
1918
1667
|
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
1919
1668
|
goto done_with_error;
|
1920
1669
|
}
|
1921
|
-
|
1922
|
-
|
1923
|
-
op->data.recv_close_on_server.cancelled;
|
1670
|
+
requested_final_op_ = true;
|
1671
|
+
final_op_.server.cancelled = op->data.recv_close_on_server.cancelled;
|
1924
1672
|
stream_op->recv_trailing_metadata = true;
|
1925
1673
|
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata =
|
1926
|
-
&
|
1674
|
+
&recv_trailing_metadata_;
|
1927
1675
|
stream_op_payload->recv_trailing_metadata.collect_stats =
|
1928
|
-
&
|
1929
|
-
GRPC_CLOSURE_INIT(
|
1930
|
-
|
1931
|
-
|
1676
|
+
&final_info_.stats.transport_stream_stats;
|
1677
|
+
GRPC_CLOSURE_INIT(
|
1678
|
+
&receiving_trailing_metadata_ready_,
|
1679
|
+
[](void* bctl, grpc_error_handle error) {
|
1680
|
+
static_cast<BatchControl*>(bctl)->ReceivingTrailingMetadataReady(
|
1681
|
+
error);
|
1682
|
+
},
|
1683
|
+
bctl, grpc_schedule_on_exec_ctx);
|
1932
1684
|
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata_ready =
|
1933
|
-
&
|
1685
|
+
&receiving_trailing_metadata_ready_;
|
1934
1686
|
++num_recv_ops;
|
1935
1687
|
break;
|
1936
1688
|
}
|
1937
1689
|
}
|
1938
1690
|
}
|
1939
1691
|
|
1940
|
-
|
1692
|
+
InternalRef("completion");
|
1941
1693
|
if (!is_notify_tag_closure) {
|
1942
|
-
GPR_ASSERT(grpc_cq_begin_op(
|
1694
|
+
GPR_ASSERT(grpc_cq_begin_op(cq_, notify_tag));
|
1943
1695
|
}
|
1944
1696
|
bctl->set_num_steps_to_complete((has_send_ops ? 1 : 0) + num_recv_ops);
|
1945
1697
|
|
1946
1698
|
if (has_send_ops) {
|
1947
|
-
GRPC_CLOSURE_INIT(
|
1948
|
-
|
1949
|
-
|
1699
|
+
GRPC_CLOSURE_INIT(
|
1700
|
+
&bctl->finish_batch_,
|
1701
|
+
[](void* bctl, grpc_error_handle error) {
|
1702
|
+
static_cast<BatchControl*>(bctl)->FinishBatch(error);
|
1703
|
+
},
|
1704
|
+
bctl, grpc_schedule_on_exec_ctx);
|
1705
|
+
stream_op->on_complete = &bctl->finish_batch_;
|
1950
1706
|
}
|
1951
1707
|
|
1952
|
-
|
1953
|
-
execute_batch(call, stream_op, &bctl->start_batch);
|
1708
|
+
ExecuteBatch(stream_op, &bctl->start_batch_);
|
1954
1709
|
|
1955
1710
|
done:
|
1956
1711
|
return error;
|
@@ -1958,89 +1713,172 @@ done:
|
|
1958
1713
|
done_with_error:
|
1959
1714
|
/* reverse any mutations that occurred */
|
1960
1715
|
if (stream_op->send_initial_metadata) {
|
1961
|
-
|
1962
|
-
|
1716
|
+
sent_initial_metadata_ = false;
|
1717
|
+
send_initial_metadata_.Clear();
|
1963
1718
|
}
|
1964
1719
|
if (stream_op->send_message) {
|
1965
|
-
|
1966
|
-
// No need to invoke call->sending_stream->Orphan() explicitly.
|
1967
|
-
// stream_op_payload->send_message.send_message.reset() calls Deletor
|
1968
|
-
// of call->sending_stream which in-turn invokes the Orphan() method.
|
1969
|
-
stream_op_payload->send_message.send_message.reset();
|
1720
|
+
sending_message_ = false;
|
1970
1721
|
}
|
1971
1722
|
if (stream_op->send_trailing_metadata) {
|
1972
|
-
|
1973
|
-
|
1723
|
+
sent_final_op_ = false;
|
1724
|
+
send_trailing_metadata_.Clear();
|
1974
1725
|
}
|
1975
1726
|
if (stream_op->recv_initial_metadata) {
|
1976
|
-
|
1727
|
+
received_initial_metadata_ = false;
|
1977
1728
|
}
|
1978
1729
|
if (stream_op->recv_message) {
|
1979
|
-
|
1730
|
+
receiving_message_ = false;
|
1980
1731
|
}
|
1981
1732
|
if (stream_op->recv_trailing_metadata) {
|
1982
|
-
|
1733
|
+
requested_final_op_ = false;
|
1983
1734
|
}
|
1984
1735
|
goto done;
|
1985
1736
|
}
|
1986
1737
|
|
1738
|
+
void FilterStackCall::ContextSet(grpc_context_index elem, void* value,
|
1739
|
+
void (*destroy)(void*)) {
|
1740
|
+
if (context_[elem].destroy) {
|
1741
|
+
context_[elem].destroy(context_[elem].value);
|
1742
|
+
}
|
1743
|
+
context_[elem].value = value;
|
1744
|
+
context_[elem].destroy = destroy;
|
1745
|
+
}
|
1746
|
+
|
1747
|
+
} // namespace grpc_core
|
1748
|
+
|
1749
|
+
void* grpc_call_arena_alloc(grpc_call* call, size_t size) {
|
1750
|
+
grpc_core::ExecCtx exec_ctx;
|
1751
|
+
return grpc_core::Call::FromC(call)->arena()->Alloc(size);
|
1752
|
+
}
|
1753
|
+
|
1754
|
+
size_t grpc_call_get_initial_size_estimate() {
|
1755
|
+
return grpc_core::FilterStackCall::InitialSizeEstimate();
|
1756
|
+
}
|
1757
|
+
|
1758
|
+
grpc_error_handle grpc_call_create(grpc_call_create_args* args,
|
1759
|
+
grpc_call** out_call) {
|
1760
|
+
return grpc_core::FilterStackCall::Create(args, out_call);
|
1761
|
+
}
|
1762
|
+
|
1763
|
+
void grpc_call_set_completion_queue(grpc_call* call,
|
1764
|
+
grpc_completion_queue* cq) {
|
1765
|
+
grpc_core::Call::FromC(call)->SetCompletionQueue(cq);
|
1766
|
+
}
|
1767
|
+
|
1768
|
+
void grpc_call_ref(grpc_call* c) { grpc_core::Call::FromC(c)->ExternalRef(); }
|
1769
|
+
|
1770
|
+
void grpc_call_unref(grpc_call* c) {
|
1771
|
+
grpc_core::Call::FromC(c)->ExternalUnref();
|
1772
|
+
}
|
1773
|
+
|
1774
|
+
char* grpc_call_get_peer(grpc_call* call) {
|
1775
|
+
return grpc_core::Call::FromC(call)->GetPeer();
|
1776
|
+
}
|
1777
|
+
|
1778
|
+
grpc_call* grpc_call_from_top_element(grpc_call_element* surface_element) {
|
1779
|
+
return grpc_core::FilterStackCall::FromTopElem(surface_element)->c_ptr();
|
1780
|
+
}
|
1781
|
+
|
1782
|
+
grpc_call_error grpc_call_cancel(grpc_call* call, void* reserved) {
|
1783
|
+
GRPC_API_TRACE("grpc_call_cancel(call=%p, reserved=%p)", 2, (call, reserved));
|
1784
|
+
GPR_ASSERT(reserved == nullptr);
|
1785
|
+
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
1786
|
+
grpc_core::ExecCtx exec_ctx;
|
1787
|
+
grpc_core::Call::FromC(call)->CancelWithError(GRPC_ERROR_CANCELLED);
|
1788
|
+
return GRPC_CALL_OK;
|
1789
|
+
}
|
1790
|
+
|
1791
|
+
grpc_call_error grpc_call_cancel_with_status(grpc_call* c,
|
1792
|
+
grpc_status_code status,
|
1793
|
+
const char* description,
|
1794
|
+
void* reserved) {
|
1795
|
+
GRPC_API_TRACE(
|
1796
|
+
"grpc_call_cancel_with_status("
|
1797
|
+
"c=%p, status=%d, description=%s, reserved=%p)",
|
1798
|
+
4, (c, (int)status, description, reserved));
|
1799
|
+
GPR_ASSERT(reserved == nullptr);
|
1800
|
+
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
1801
|
+
grpc_core::ExecCtx exec_ctx;
|
1802
|
+
grpc_core::Call::FromC(c)->CancelWithStatus(status, description);
|
1803
|
+
return GRPC_CALL_OK;
|
1804
|
+
}
|
1805
|
+
|
1806
|
+
void grpc_call_cancel_internal(grpc_call* call) {
|
1807
|
+
grpc_core::Call::FromC(call)->CancelWithError(GRPC_ERROR_CANCELLED);
|
1808
|
+
}
|
1809
|
+
|
1810
|
+
grpc_compression_algorithm grpc_call_test_only_get_compression_algorithm(
|
1811
|
+
grpc_call* call) {
|
1812
|
+
return grpc_core::Call::FromC(call)->test_only_compression_algorithm();
|
1813
|
+
}
|
1814
|
+
|
1815
|
+
uint32_t grpc_call_test_only_get_message_flags(grpc_call* call) {
|
1816
|
+
return grpc_core::Call::FromC(call)->test_only_message_flags();
|
1817
|
+
}
|
1818
|
+
|
1819
|
+
uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call* call) {
|
1820
|
+
return grpc_core::Call::FromC(call)->test_only_encodings_accepted_by_peer();
|
1821
|
+
}
|
1822
|
+
|
1823
|
+
grpc_core::Arena* grpc_call_get_arena(grpc_call* call) {
|
1824
|
+
return grpc_core::Call::FromC(call)->arena();
|
1825
|
+
}
|
1826
|
+
|
1827
|
+
grpc_call_stack* grpc_call_get_call_stack(grpc_call* call) {
|
1828
|
+
return grpc_core::Call::FromC(call)->call_stack();
|
1829
|
+
}
|
1830
|
+
|
1987
1831
|
grpc_call_error grpc_call_start_batch(grpc_call* call, const grpc_op* ops,
|
1988
1832
|
size_t nops, void* tag, void* reserved) {
|
1989
|
-
grpc_call_error err;
|
1990
|
-
|
1991
1833
|
GRPC_API_TRACE(
|
1992
1834
|
"grpc_call_start_batch(call=%p, ops=%p, nops=%lu, tag=%p, "
|
1993
1835
|
"reserved=%p)",
|
1994
1836
|
5, (call, ops, (unsigned long)nops, tag, reserved));
|
1995
1837
|
|
1996
1838
|
if (reserved != nullptr) {
|
1997
|
-
|
1839
|
+
return GRPC_CALL_ERROR;
|
1998
1840
|
} else {
|
1999
1841
|
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
2000
1842
|
grpc_core::ExecCtx exec_ctx;
|
2001
|
-
|
1843
|
+
return grpc_core::Call::FromC(call)->StartBatch(ops, nops, tag, false);
|
2002
1844
|
}
|
2003
|
-
|
2004
|
-
return err;
|
2005
1845
|
}
|
2006
1846
|
|
2007
1847
|
grpc_call_error grpc_call_start_batch_and_execute(grpc_call* call,
|
2008
1848
|
const grpc_op* ops,
|
2009
1849
|
size_t nops,
|
2010
1850
|
grpc_closure* closure) {
|
2011
|
-
return
|
1851
|
+
return grpc_core::Call::FromC(call)->StartBatch(ops, nops, closure, true);
|
2012
1852
|
}
|
2013
1853
|
|
2014
1854
|
void grpc_call_context_set(grpc_call* call, grpc_context_index elem,
|
2015
1855
|
void* value, void (*destroy)(void* value)) {
|
2016
|
-
|
2017
|
-
call->context[elem].destroy(call->context[elem].value);
|
2018
|
-
}
|
2019
|
-
call->context[elem].value = value;
|
2020
|
-
call->context[elem].destroy = destroy;
|
1856
|
+
return grpc_core::Call::FromC(call)->ContextSet(elem, value, destroy);
|
2021
1857
|
}
|
2022
1858
|
|
2023
1859
|
void* grpc_call_context_get(grpc_call* call, grpc_context_index elem) {
|
2024
|
-
return call->
|
1860
|
+
return grpc_core::Call::FromC(call)->ContextGet(elem);
|
2025
1861
|
}
|
2026
1862
|
|
2027
|
-
uint8_t grpc_call_is_client(grpc_call* call) {
|
1863
|
+
uint8_t grpc_call_is_client(grpc_call* call) {
|
1864
|
+
return grpc_core::Call::FromC(call)->is_client();
|
1865
|
+
}
|
2028
1866
|
|
2029
1867
|
grpc_compression_algorithm grpc_call_compression_for_level(
|
2030
1868
|
grpc_call* call, grpc_compression_level level) {
|
2031
|
-
|
2032
|
-
compression_algorithm_for_level_locked(call, level);
|
2033
|
-
return algo;
|
1869
|
+
return grpc_core::Call::FromC(call)->compression_for_level(level);
|
2034
1870
|
}
|
2035
1871
|
|
2036
1872
|
bool grpc_call_is_trailers_only(const grpc_call* call) {
|
2037
|
-
|
2038
|
-
GPR_DEBUG_ASSERT(!result || call->recv_initial_metadata.empty());
|
2039
|
-
return result;
|
1873
|
+
return grpc_core::Call::FromC(call)->is_trailers_only();
|
2040
1874
|
}
|
2041
1875
|
|
2042
1876
|
int grpc_call_failed_before_recv_message(const grpc_call* c) {
|
2043
|
-
return c->
|
1877
|
+
return grpc_core::Call::FromC(c)->failed_before_recv_message();
|
1878
|
+
}
|
1879
|
+
|
1880
|
+
absl::string_view grpc_call_server_authority(const grpc_call* call) {
|
1881
|
+
return grpc_core::Call::FromC(call)->GetServerAuthority();
|
2044
1882
|
}
|
2045
1883
|
|
2046
1884
|
const char* grpc_call_error_to_string(grpc_call_error error) {
|