grpc 1.42.0 → 1.45.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 +405 -221
- data/include/grpc/event_engine/event_engine.h +37 -13
- data/include/grpc/event_engine/internal/memory_allocator_impl.h +1 -31
- data/include/grpc/event_engine/memory_allocator.h +27 -11
- data/include/grpc/event_engine/memory_request.h +57 -0
- data/include/grpc/grpc.h +40 -14
- data/include/grpc/grpc_posix.h +20 -19
- data/include/grpc/grpc_security.h +312 -195
- data/include/grpc/grpc_security_constants.h +1 -14
- data/include/grpc/impl/codegen/compression_types.h +0 -2
- data/include/grpc/impl/codegen/grpc_types.h +17 -8
- data/include/grpc/impl/codegen/port_platform.h +7 -3
- data/include/grpc/impl/codegen/slice.h +4 -1
- data/include/grpc/slice.h +0 -11
- data/src/core/ext/filters/client_channel/backend_metric.cc +9 -10
- data/src/core/ext/filters/client_channel/backend_metric.h +4 -3
- data/src/core/ext/filters/client_channel/backup_poller.cc +12 -8
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +5 -5
- data/src/core/ext/filters/client_channel/client_channel.cc +213 -156
- data/src/core/ext/filters/client_channel/client_channel.h +43 -41
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +6 -13
- data/src/core/ext/filters/client_channel/config_selector.h +4 -4
- data/src/core/ext/filters/client_channel/connector.h +1 -1
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +5 -6
- data/src/core/ext/filters/client_channel/dynamic_filters.h +2 -2
- data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +2 -22
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +3 -15
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +32 -31
- data/src/core/ext/filters/client_channel/health/health_check_client.h +5 -5
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +22 -27
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +4 -3
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +6 -5
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +4 -7
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +100 -81
- 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.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +1 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +15 -15
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +4 -4
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +50 -32
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +28 -19
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +122 -71
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +161 -112
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +62 -61
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +16 -11
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +13 -7
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +55 -99
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +147 -70
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +5 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +114 -206
- data/src/core/ext/filters/client_channel/lb_policy.cc +15 -14
- data/src/core/ext/filters/client_channel/lb_policy.h +94 -62
- data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +10 -16
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +261 -122
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +22 -12
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +19 -15
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +31 -50
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +136 -226
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +25 -32
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +122 -115
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +18 -17
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +2 -1
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +84 -68
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +40 -39
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +390 -373
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +8 -11
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +13 -7
- data/src/core/ext/filters/client_channel/retry_filter.cc +236 -169
- data/src/core/ext/filters/client_channel/retry_service_config.cc +16 -18
- data/src/core/ext/filters/client_channel/retry_service_config.h +18 -12
- data/src/core/ext/filters/client_channel/retry_throttle.cc +9 -23
- data/src/core/ext/filters/client_channel/retry_throttle.h +11 -5
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +8 -7
- data/src/core/ext/filters/client_channel/subchannel.cc +49 -56
- data/src/core/ext/filters/client_channel/subchannel.h +7 -7
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +96 -159
- data/src/core/ext/filters/client_idle/idle_filter_state.h +2 -2
- data/src/core/ext/filters/deadline/deadline_filter.cc +15 -14
- data/src/core/ext/filters/deadline/deadline_filter.h +3 -2
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +53 -58
- data/src/core/ext/filters/fault_injection/service_config_parser.cc +11 -13
- data/src/core/ext/filters/fault_injection/service_config_parser.h +10 -4
- data/src/core/ext/filters/http/client/http_client_filter.cc +70 -153
- data/src/core/ext/filters/http/client_authority_filter.cc +28 -87
- data/src/core/ext/filters/http/client_authority_filter.h +23 -5
- data/src/core/ext/filters/http/http_filters_plugin.cc +14 -17
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +43 -140
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +15 -27
- data/src/core/ext/filters/http/server/http_server_filter.cc +60 -161
- data/src/core/ext/filters/max_age/max_age_filter.cc +46 -40
- data/src/core/ext/filters/message_size/message_size_filter.cc +27 -35
- data/src/core/ext/filters/message_size/message_size_filter.h +10 -3
- data/src/core/ext/filters/rbac/rbac_filter.cc +162 -0
- data/src/core/ext/filters/rbac/rbac_filter.h +76 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +606 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +75 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector.cc +67 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +71 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +271 -0
- data/src/core/ext/{transport/chttp2/transport/hpack_utils.h → filters/server_config_selector/server_config_selector_filter.h} +9 -7
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +238 -20
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +0 -2
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +283 -106
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +204 -291
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +9 -4
- data/src/core/ext/transport/chttp2/transport/context_list.cc +2 -3
- data/src/core/ext/transport/chttp2/transport/context_list.h +2 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +10 -10
- data/src/core/ext/transport/chttp2/transport/flow_control.h +5 -5
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +0 -1
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +4 -4
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +5 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +365 -240
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +87 -145
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +2 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +74 -149
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +0 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +94 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +2 -24
- data/src/core/ext/transport/chttp2/transport/internal.h +12 -41
- data/src/core/ext/transport/chttp2/transport/parsing.cc +3 -9
- data/src/core/ext/transport/chttp2/transport/writing.cc +62 -128
- data/src/core/ext/transport/inproc/inproc_plugin.cc +0 -4
- data/src/core/ext/transport/inproc/inproc_transport.cc +42 -81
- data/src/core/ext/transport/inproc/inproc_transport.h +1 -4
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +114 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +402 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +119 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +453 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +243 -209
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +799 -574
- 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 +138 -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 +146 -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 +106 -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 +93 -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 +88 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +103 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +466 -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 +95 -0
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +19 -0
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +30 -4
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +33 -18
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +143 -116
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +422 -316
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +231 -199
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +788 -570
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +43 -28
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +116 -78
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +308 -271
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +955 -661
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +20 -7
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +34 -22
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +40 -27
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +128 -78
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +290 -0
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +1122 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +72 -53
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +222 -158
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +20 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +34 -22
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +213 -176
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +692 -498
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +62 -45
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +179 -129
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +19 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +26 -18
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +31 -17
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +75 -52
- 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 +138 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +143 -117
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +450 -328
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +111 -91
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +366 -263
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +21 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +37 -25
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +184 -125
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +676 -344
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +17 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +26 -16
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +27 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +60 -41
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +22 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +40 -24
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +26 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +46 -34
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +21 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +35 -23
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +51 -35
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +114 -84
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +73 -55
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +211 -150
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +70 -53
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +211 -141
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +19 -6
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +29 -19
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +91 -71
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +282 -191
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +97 -78
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +287 -217
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +29 -16
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +63 -41
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +24 -10
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +54 -37
- 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 +120 -0
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +81 -61
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +245 -184
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +86 -65
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +261 -191
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +123 -103
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +236 -190
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +49 -34
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +143 -111
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +642 -572
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +2038 -1506
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +38 -19
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +108 -63
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +216 -0
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +870 -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 +82 -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 +95 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +27 -13
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +56 -39
- 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 +119 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +62 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +203 -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 +89 -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 +184 -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 +192 -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 +126 -0
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +17 -4
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +30 -22
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +45 -28
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +125 -91
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +51 -36
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +150 -104
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +63 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +165 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +26 -13
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +54 -36
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +254 -223
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +804 -558
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +9 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +6 -3
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +99 -60
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +369 -193
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +41 -26
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +96 -70
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +101 -83
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +267 -192
- 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 +146 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +15 -2
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +22 -14
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +91 -72
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +298 -217
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +31 -17
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +74 -53
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +73 -56
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +198 -144
- 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 +101 -0
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +34 -18
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +91 -68
- 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 +202 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +28 -14
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +65 -46
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +21 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +35 -25
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +20 -7
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +26 -18
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +19 -6
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +26 -18
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +35 -20
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +86 -60
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +31 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +66 -51
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +26 -12
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +57 -42
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +37 -22
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +75 -57
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +50 -31
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +163 -123
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +53 -36
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +158 -112
- 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 +183 -0
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +9 -0
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +3 -0
- 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 +136 -0
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +23 -9
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +52 -33
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +30 -15
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +81 -51
- 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 +19 -6
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +32 -18
- 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 +114 -0
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +22 -0
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +8 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +150 -125
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +372 -280
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +152 -126
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +410 -297
- data/src/core/ext/upb-generated/google/api/http.upb.c +43 -28
- data/src/core/ext/upb-generated/google/api/http.upb.h +118 -88
- data/src/core/ext/upb-generated/google/api/httpbody.upb.c +46 -0
- data/src/core/ext/upb-generated/google/api/httpbody.upb.h +99 -0
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +18 -5
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +33 -21
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +366 -276
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +1089 -763
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +18 -5
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +29 -17
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +15 -2
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +22 -14
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +47 -31
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +81 -63
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +18 -5
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +29 -17
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +57 -36
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +214 -148
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +21 -8
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +37 -25
- 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 +276 -0
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +32 -18
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +61 -41
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +131 -107
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +397 -284
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +26 -12
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +59 -38
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +22 -8
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +51 -34
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +81 -61
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +272 -202
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +34 -19
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +77 -56
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +75 -13
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +108 -57
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +31 -5
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +34 -17
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +21 -0
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +8 -0
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +31 -5
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +34 -17
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +30 -4
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +33 -18
- data/src/core/ext/upb-generated/validate/validate.upb.c +395 -310
- data/src/core/ext/upb-generated/validate/validate.upb.h +1118 -725
- 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 +191 -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 +87 -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 +38 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +64 -17
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +113 -65
- 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 +81 -0
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +17 -4
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +28 -18
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +30 -16
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +64 -45
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +25 -11
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +32 -24
- 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 +95 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +22 -9
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +40 -26
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +33 -19
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +74 -53
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +22 -9
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +44 -28
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +36 -21
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +44 -30
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +203 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +726 -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 +132 -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 +173 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +20 -7
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +34 -22
- 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 +16 -61
- 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 +10 -8
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +10 -13
- 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 +22 -52
- 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 +250 -281
- 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 +18 -24
- 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 +377 -426
- 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 +16 -18
- 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 +18 -20
- 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 +17 -32
- 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 +17 -19
- 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 +87 -133
- 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 +20 -31
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +16 -19
- 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 +17 -21
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +7 -7
- 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 +23 -51
- 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 +25 -41
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +25 -25
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +16 -19
- 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 +252 -254
- 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 +14 -16
- 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 +16 -20
- 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 +16 -18
- 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 +20 -22
- 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 +15 -18
- 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 +20 -28
- 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 +21 -33
- 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 +20 -30
- 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 +16 -18
- 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 +54 -62
- 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 +25 -39
- 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 +21 -23
- 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 +17 -21
- 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 +19 -35
- 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 +19 -37
- 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 +21 -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 +818 -912
- 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 +54 -48
- 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 +17 -21
- 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 +17 -18
- 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 +19 -29
- 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 +20 -26
- 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 +19 -20
- 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 +137 -173
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +58 -58
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +17 -13
- 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 +171 -157
- 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 +21 -27
- 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 +23 -34
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +19 -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 +16 -18
- 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 +19 -33
- 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 +18 -22
- 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 +22 -32
- 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 +15 -23
- 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 +17 -21
- 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 +17 -19
- 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 +17 -19
- 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 +17 -19
- 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 +17 -23
- 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 +17 -21
- 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 +16 -21
- 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 +18 -24
- 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 +15 -29
- 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 +16 -26
- 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 +12 -10
- 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 +14 -19
- 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 +13 -19
- 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 +13 -16
- 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 +7 -7
- 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 +5 -14
- 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 +5 -10
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +5 -62
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +82 -82
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +5 -10
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +5 -10
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +5 -16
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +5 -10
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +5 -26
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h +28 -28
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +6 -11
- 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/udpa/annotations/migrate.upbdefs.c +6 -15
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +7 -12
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +6 -6
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +6 -11
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +6 -11
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +8 -57
- 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 +6 -17
- 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 +7 -12
- 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 +9 -16
- 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 +6 -13
- 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 +8 -13
- 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 +8 -15
- 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 +8 -13
- 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 +7 -12
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +4 -4
- data/src/core/ext/xds/certificate_provider_registry.cc +1 -1
- data/src/core/ext/xds/certificate_provider_store.h +1 -1
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +4 -4
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +2 -2
- data/src/core/ext/xds/upb_utils.h +67 -0
- data/src/core/ext/xds/xds_api.cc +162 -3417
- data/src/core/ext/xds/xds_api.h +60 -613
- data/src/core/ext/xds/xds_bootstrap.cc +221 -122
- data/src/core/ext/xds/xds_bootstrap.h +31 -15
- data/src/core/ext/xds/xds_certificate_provider.h +2 -2
- data/src/core/ext/xds/xds_channel_stack_modifier.cc +16 -20
- data/src/core/ext/xds/xds_channel_stack_modifier.h +4 -3
- data/src/core/ext/xds/xds_client.cc +794 -1065
- data/src/core/ext/xds/xds_client.h +109 -149
- data/src/core/ext/xds/xds_client_stats.cc +15 -15
- data/src/core/ext/xds/xds_client_stats.h +5 -4
- data/src/core/ext/xds/xds_cluster.cc +453 -0
- data/src/core/ext/xds/xds_cluster.h +108 -0
- data/src/core/ext/xds/xds_common_types.cc +388 -0
- data/src/core/ext/xds/xds_common_types.h +95 -0
- data/src/core/ext/xds/xds_endpoint.cc +364 -0
- data/src/core/ext/xds/xds_endpoint.h +135 -0
- data/src/core/ext/xds/xds_http_fault_filter.cc +6 -6
- data/src/core/ext/xds/xds_http_fault_filter.h +3 -3
- data/src/core/ext/xds/xds_http_filters.cc +11 -5
- data/src/core/ext/xds/xds_http_filters.h +4 -4
- data/src/core/ext/xds/xds_http_rbac_filter.cc +563 -0
- data/src/core/ext/xds/xds_http_rbac_filter.h +54 -0
- data/src/core/ext/xds/xds_listener.cc +1039 -0
- data/src/core/ext/xds/xds_listener.h +220 -0
- data/src/core/ext/xds/xds_resource_type.cc +33 -0
- data/src/core/ext/xds/xds_resource_type.h +98 -0
- data/src/core/ext/xds/xds_resource_type_impl.h +87 -0
- data/src/core/ext/xds/xds_route_config.cc +985 -0
- data/src/core/ext/xds/xds_route_config.h +215 -0
- data/src/core/ext/xds/xds_routing.cc +250 -0
- data/src/core/ext/xds/xds_routing.h +101 -0
- data/src/core/ext/xds/xds_server_config_fetcher.cc +1061 -286
- data/src/core/lib/address_utils/parse_address.cc +20 -0
- data/src/core/lib/address_utils/parse_address.h +5 -0
- data/src/core/lib/address_utils/sockaddr_utils.cc +33 -36
- data/src/core/lib/address_utils/sockaddr_utils.h +1 -16
- data/src/core/lib/avl/avl.h +389 -88
- data/src/core/lib/backoff/backoff.cc +9 -38
- data/src/core/lib/backoff/backoff.h +11 -11
- data/src/core/lib/channel/call_finalization.h +86 -0
- data/src/core/lib/channel/channel_args.cc +77 -18
- data/src/core/lib/channel/channel_args.h +13 -10
- data/src/core/lib/channel/channel_args_preconditioning.cc +48 -0
- data/src/core/lib/channel/channel_args_preconditioning.h +62 -0
- data/src/core/lib/channel/channel_stack.cc +10 -3
- data/src/core/lib/channel/channel_stack.h +42 -6
- data/src/core/lib/channel/channel_stack_builder.cc +66 -250
- data/src/core/lib/channel/channel_stack_builder.h +95 -147
- data/src/core/lib/channel/channel_trace.cc +3 -6
- data/src/core/lib/channel/channelz.cc +2 -1
- data/src/core/lib/channel/connected_channel.cc +9 -4
- data/src/core/lib/channel/connected_channel.h +1 -1
- data/src/core/lib/channel/context.h +11 -0
- data/src/core/lib/channel/handshaker.cc +1 -1
- data/src/core/lib/channel/handshaker.h +1 -1
- data/src/core/lib/channel/promise_based_filter.cc +669 -0
- data/src/core/lib/channel/promise_based_filter.h +423 -0
- data/src/core/lib/compression/compression.cc +20 -112
- data/src/core/lib/compression/compression_internal.cc +143 -203
- data/src/core/lib/compression/compression_internal.h +64 -69
- data/src/core/lib/compression/message_compress.cc +11 -11
- data/src/core/lib/compression/message_compress.h +2 -2
- data/src/core/lib/config/core_configuration.cc +11 -3
- data/src/core/lib/config/core_configuration.h +50 -0
- data/src/core/lib/debug/trace.h +2 -2
- data/src/core/lib/event_engine/{endpoint_config.cc → channel_args_endpoint_config.cc} +2 -1
- data/src/core/lib/event_engine/{endpoint_config_internal.h → channel_args_endpoint_config.h} +3 -3
- data/src/core/lib/event_engine/default_event_engine_factory.cc +27 -0
- data/src/core/lib/event_engine/event_engine.cc +21 -19
- data/src/core/lib/event_engine/event_engine_factory.h +36 -0
- data/src/core/lib/event_engine/memory_allocator.cc +66 -0
- data/src/core/lib/event_engine/resolved_address.cc +39 -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/tls.h +6 -0
- data/src/core/lib/gpr/useful.h +18 -0
- data/src/core/lib/gprpp/bitset.h +7 -0
- data/src/core/lib/gprpp/capture.h +76 -0
- data/src/core/lib/gprpp/chunked_vector.h +45 -3
- data/src/core/lib/gprpp/cpp_impl_of.h +45 -0
- data/src/core/lib/gprpp/debug_location.h +2 -0
- data/src/core/lib/gprpp/global_config_env.cc +7 -7
- data/src/core/lib/gprpp/global_config_env.h +2 -2
- data/src/core/lib/gprpp/manual_constructor.h +2 -3
- data/src/core/lib/gprpp/orphanable.h +1 -1
- data/src/core/lib/gprpp/ref_counted.h +1 -1
- data/src/core/lib/gprpp/ref_counted_ptr.h +2 -4
- data/src/core/lib/gprpp/status_helper.cc +30 -38
- data/src/core/lib/gprpp/status_helper.h +6 -19
- data/src/core/lib/gprpp/table.h +24 -1
- data/src/core/lib/gprpp/time.cc +186 -0
- data/src/core/lib/gprpp/time.h +292 -0
- data/src/core/lib/http/format_request.cc +27 -23
- data/src/core/lib/http/format_request.h +7 -6
- data/src/core/lib/http/httpcli.cc +310 -238
- data/src/core/lib/http/httpcli.h +183 -88
- data/src/core/lib/http/httpcli_security_connector.cc +62 -73
- data/src/core/lib/http/httpcli_ssl_credentials.h +37 -0
- data/src/core/lib/http/parser.h +1 -1
- data/src/core/lib/iomgr/buffer_list.cc +9 -9
- data/src/core/lib/iomgr/buffer_list.h +18 -18
- data/src/core/lib/iomgr/call_combiner.cc +17 -7
- data/src/core/lib/iomgr/closure.h +29 -9
- data/src/core/lib/iomgr/combiner.cc +25 -3
- data/src/core/lib/iomgr/endpoint.h +0 -1
- data/src/core/lib/iomgr/endpoint_cfstream.cc +7 -24
- data/src/core/lib/iomgr/endpoint_cfstream.h +4 -4
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +9 -11
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +5 -14
- data/src/core/lib/iomgr/error.cc +13 -10
- data/src/core/lib/iomgr/error.h +0 -2
- data/src/core/lib/iomgr/ev_apple.cc +6 -5
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +8 -7
- data/src/core/lib/iomgr/ev_epollex_linux.cc +12 -9
- data/src/core/lib/iomgr/ev_poll_posix.cc +7 -7
- data/src/core/lib/iomgr/ev_posix.cc +3 -3
- data/src/core/lib/iomgr/ev_posix.h +1 -1
- data/src/core/lib/iomgr/event_engine/endpoint.cc +2 -3
- data/src/core/lib/iomgr/event_engine/iomgr.cc +8 -27
- data/src/core/lib/iomgr/event_engine/pollset.cc +2 -3
- data/src/core/lib/iomgr/event_engine/resolved_address_internal.cc +6 -0
- data/src/core/lib/iomgr/event_engine/resolved_address_internal.h +2 -0
- data/src/core/lib/iomgr/event_engine/resolver.cc +68 -49
- data/src/core/lib/iomgr/event_engine/resolver.h +56 -0
- data/src/core/lib/iomgr/event_engine/tcp.cc +11 -8
- data/src/core/lib/iomgr/event_engine/timer.cc +7 -7
- data/src/core/lib/iomgr/exec_ctx.cc +25 -97
- data/src/core/lib/iomgr/exec_ctx.h +18 -34
- data/src/core/lib/iomgr/executor.cc +22 -16
- data/src/core/lib/iomgr/executor.h +1 -1
- data/src/core/lib/iomgr/fork_posix.cc +3 -2
- 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_posix.cc +2 -2
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +2 -2
- data/src/core/lib/iomgr/iomgr_windows.cc +2 -2
- 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_windows.cc +2 -2
- data/src/core/lib/iomgr/port.h +6 -9
- data/src/core/lib/iomgr/resolve_address.cc +5 -24
- data/src/core/lib/iomgr/resolve_address.h +47 -44
- data/src/core/lib/iomgr/resolve_address_impl.h +59 -0
- data/src/core/lib/iomgr/resolve_address_posix.cc +83 -67
- data/src/core/lib/iomgr/resolve_address_posix.h +47 -0
- data/src/core/lib/iomgr/resolve_address_windows.cc +93 -74
- data/src/core/lib/iomgr/resolve_address_windows.h +47 -0
- data/src/core/lib/iomgr/resolved_address.h +39 -0
- data/src/core/lib/iomgr/sockaddr_utils_posix.cc +62 -0
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +0 -17
- data/src/core/lib/iomgr/tcp_client.cc +3 -5
- data/src/core/lib/iomgr/tcp_client.h +4 -5
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +2 -10
- data/src/core/lib/iomgr/tcp_client_posix.cc +8 -24
- data/src/core/lib/iomgr/tcp_client_posix.h +3 -4
- data/src/core/lib/iomgr/tcp_client_windows.cc +2 -11
- data/src/core/lib/iomgr/tcp_posix.cc +30 -34
- data/src/core/lib/iomgr/tcp_posix.h +1 -3
- data/src/core/lib/iomgr/tcp_server.cc +4 -6
- data/src/core/lib/iomgr/tcp_server.h +6 -8
- data/src/core/lib/iomgr/tcp_server_posix.cc +18 -22
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +19 -18
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -0
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +1 -0
- data/src/core/lib/iomgr/tcp_server_windows.cc +5 -12
- data/src/core/lib/iomgr/tcp_windows.cc +19 -17
- data/src/core/lib/iomgr/tcp_windows.h +1 -2
- 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/work_serializer.cc +120 -44
- data/src/core/lib/iomgr/work_serializer.h +16 -4
- data/src/core/lib/json/json_reader.cc +83 -35
- data/src/core/lib/json/json_util.cc +5 -5
- data/src/core/lib/json/json_util.h +2 -2
- data/src/core/lib/matchers/matchers.cc +1 -1
- data/src/core/lib/promise/activity.cc +121 -0
- data/src/core/lib/promise/activity.h +540 -0
- data/src/core/lib/promise/arena_promise.h +188 -0
- data/src/core/lib/promise/context.h +86 -0
- data/src/core/lib/promise/detail/basic_seq.h +496 -0
- data/src/core/lib/promise/detail/promise_factory.h +189 -0
- data/src/core/lib/promise/detail/promise_like.h +85 -0
- data/src/core/lib/promise/detail/status.h +49 -0
- data/src/core/lib/promise/detail/switch.h +1455 -0
- data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +48 -0
- data/src/core/lib/promise/loop.h +134 -0
- data/src/core/lib/promise/map.h +88 -0
- data/src/core/lib/promise/poll.h +66 -0
- data/src/core/lib/promise/promise.h +95 -0
- data/src/core/lib/promise/race.h +84 -0
- data/src/core/lib/promise/seq.h +89 -0
- data/src/core/lib/promise/sleep.cc +74 -0
- data/src/core/lib/promise/sleep.h +66 -0
- data/src/core/lib/promise/try_seq.h +157 -0
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver.cc +17 -25
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver.h +43 -44
- data/src/core/{ext/filters/client_channel → lib/resolver}/resolver_factory.h +32 -31
- data/src/core/lib/resolver/resolver_registry.cc +156 -0
- data/src/core/lib/resolver/resolver_registry.h +113 -0
- data/src/core/{ext/filters/client_channel → lib/resolver}/server_address.cc +1 -1
- data/src/core/{ext/filters/client_channel → lib/resolver}/server_address.h +4 -4
- data/src/core/lib/resource_quota/api.cc +108 -0
- data/src/core/lib/resource_quota/api.h +40 -0
- data/src/core/lib/{gprpp → resource_quota}/arena.cc +16 -13
- data/src/core/lib/{gprpp → resource_quota}/arena.h +24 -13
- data/src/core/lib/resource_quota/memory_quota.cc +478 -0
- data/src/core/lib/resource_quota/memory_quota.h +457 -0
- data/src/core/lib/resource_quota/resource_quota.cc +33 -0
- data/src/core/lib/resource_quota/resource_quota.h +58 -0
- data/src/core/lib/resource_quota/thread_quota.cc +43 -0
- data/src/core/lib/resource_quota/thread_quota.h +57 -0
- data/src/core/lib/resource_quota/trace.cc +19 -0
- data/src/core/lib/resource_quota/trace.h +24 -0
- data/src/core/lib/security/authorization/evaluate_args.cc +37 -38
- data/src/core/lib/security/authorization/evaluate_args.h +3 -2
- data/src/core/lib/security/authorization/grpc_authorization_engine.cc +60 -0
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +62 -0
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +109 -0
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +51 -0
- data/src/core/lib/security/authorization/matchers.cc +227 -0
- data/src/core/lib/security/authorization/matchers.h +211 -0
- data/src/core/lib/security/authorization/rbac_policy.cc +442 -0
- data/src/core/lib/security/authorization/rbac_policy.h +171 -0
- data/src/core/lib/security/context/security_context.cc +4 -2
- data/src/core/lib/security/context/security_context.h +1 -1
- data/src/core/lib/security/credentials/alts/alts_credentials.h +6 -0
- data/src/core/lib/security/credentials/call_creds_util.cc +87 -0
- data/src/core/lib/security/credentials/call_creds_util.h +42 -0
- data/src/core/lib/security/credentials/channel_creds_registry.h +97 -0
- data/src/core/lib/security/credentials/channel_creds_registry_init.cc +70 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +17 -81
- data/src/core/lib/security/credentials/composite/composite_credentials.h +21 -9
- data/src/core/lib/security/credentials/credentials.cc +2 -3
- data/src/core/lib/security/credentials/credentials.h +68 -57
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +48 -33
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +1 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +52 -35
- data/src/core/lib/security/credentials/external/external_account_credentials.h +5 -9
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +0 -1
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +33 -14
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +1 -0
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +18 -18
- data/src/core/lib/security/credentials/fake/fake_credentials.h +14 -16
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +17 -16
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +6 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +19 -27
- data/src/core/lib/security/credentials/iam/iam_credentials.h +11 -9
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +13 -7
- data/src/core/lib/security/credentials/jwt/json_token.cc +4 -6
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +28 -44
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +12 -12
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +54 -43
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +1 -1
- data/src/core/lib/security/credentials/local/local_credentials.h +6 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +148 -173
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +52 -33
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +95 -153
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +54 -27
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +1 -10
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +6 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +11 -12
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +7 -8
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +201 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +106 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +33 -87
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +36 -83
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +21 -10
- data/src/core/lib/security/credentials/tls/tls_credentials.h +6 -0
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +28 -33
- data/src/core/lib/security/credentials/xds/xds_credentials.h +6 -1
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +11 -17
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +7 -16
- data/src/core/lib/security/security_connector/fake/fake_security_connector.h +0 -2
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +8 -18
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +11 -16
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +1 -2
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +12 -17
- data/src/core/lib/security/security_connector/security_connector.cc +3 -15
- data/src/core/lib/security/security_connector/security_connector.h +16 -21
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +6 -11
- data/src/core/lib/security/security_connector/ssl_utils.cc +38 -32
- data/src/core/lib/security/security_connector/ssl_utils.h +14 -18
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +361 -204
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +70 -47
- data/src/core/lib/security/transport/auth_filters.h +37 -4
- data/src/core/lib/security/transport/client_auth_filter.cc +87 -358
- data/src/core/lib/security/transport/security_handshaker.cc +16 -8
- data/src/core/lib/security/transport/server_auth_filter.cc +41 -35
- data/src/core/lib/service_config/service_config.h +82 -0
- data/src/core/{ext → lib}/service_config/service_config_call_data.h +5 -5
- data/src/core/{ext/service_config/service_config.cc → lib/service_config/service_config_impl.cc} +20 -17
- data/src/core/{ext/service_config/service_config.h → lib/service_config/service_config_impl.h} +16 -18
- data/src/core/{ext → lib}/service_config/service_config_parser.cc +31 -27
- data/src/core/{ext → lib}/service_config/service_config_parser.h +39 -30
- data/src/core/lib/slice/percent_encoding.cc +30 -86
- data/src/core/lib/slice/percent_encoding.h +5 -11
- data/src/core/lib/slice/slice.cc +78 -181
- data/src/core/lib/slice/slice.h +384 -0
- data/src/core/lib/slice/slice_buffer.cc +4 -0
- data/src/core/lib/slice/slice_internal.h +12 -31
- data/src/core/lib/slice/slice_refcount.cc +18 -0
- data/src/core/lib/slice/slice_refcount.h +8 -83
- data/src/core/lib/slice/slice_refcount_base.h +21 -133
- data/src/core/lib/surface/builtins.cc +6 -6
- data/src/core/lib/surface/call.cc +204 -413
- data/src/core/lib/surface/call.h +5 -5
- data/src/core/lib/surface/channel.cc +67 -99
- data/src/core/lib/surface/channel.h +12 -23
- data/src/core/lib/surface/channel_init.cc +1 -1
- data/src/core/lib/surface/channel_init.h +4 -4
- data/src/core/lib/surface/completion_queue.cc +12 -11
- data/src/core/lib/surface/init.cc +78 -10
- data/src/core/lib/surface/init.h +0 -2
- data/src/core/lib/surface/lame_client.cc +26 -19
- data/src/core/lib/surface/server.cc +44 -72
- data/src/core/lib/surface/server.h +13 -14
- data/src/core/lib/surface/validate_metadata.cc +2 -2
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.cc +10 -11
- data/src/core/lib/transport/bdp_estimator.h +2 -2
- data/src/core/lib/transport/byte_stream.cc +4 -0
- data/src/core/lib/transport/error_utils.cc +5 -3
- data/src/core/lib/transport/error_utils.h +2 -1
- data/src/core/lib/transport/metadata_batch.h +1128 -793
- data/src/core/lib/transport/parsed_metadata.cc +37 -0
- data/src/core/lib/transport/parsed_metadata.h +228 -90
- data/src/core/lib/transport/pid_controller.cc +4 -4
- data/src/core/lib/transport/status_conversion.cc +2 -2
- data/src/core/lib/transport/status_conversion.h +1 -1
- data/src/core/lib/transport/timeout_encoding.cc +204 -67
- data/src/core/lib/transport/timeout_encoding.h +40 -10
- data/src/core/lib/transport/transport.cc +7 -27
- data/src/core/lib/transport/transport.h +88 -4
- data/src/core/lib/transport/transport_impl.h +13 -0
- data/src/core/lib/transport/transport_op_string.cc +5 -47
- data/src/core/lib/uri/uri_parser.cc +237 -63
- data/src/core/lib/uri/uri_parser.h +39 -23
- data/src/core/plugin_registry/grpc_plugin_registry.cc +22 -88
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +85 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +28 -23
- data/src/core/tsi/alts/handshaker/alts_shared_resource.cc +9 -1
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +19 -11
- 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/local_transport_security.cc +16 -24
- 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 +2 -4
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +3 -5
- data/src/core/tsi/ssl_transport_security.cc +135 -15
- data/src/core/tsi/ssl_transport_security.h +39 -6
- data/src/ruby/ext/grpc/extconf.rb +10 -3
- data/src/ruby/ext/grpc/rb_channel.c +5 -2
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +26 -34
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +39 -51
- data/src/ruby/ext/grpc/rb_server.c +7 -4
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +2 -1
- data/third_party/abseil-cpp/absl/algorithm/container.h +101 -91
- data/third_party/abseil-cpp/absl/base/attributes.h +64 -31
- data/third_party/abseil-cpp/absl/base/config.h +67 -37
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +1 -26
- data/third_party/abseil-cpp/absl/base/internal/fast_type_id.h +48 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +3 -1
- data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +2 -0
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +69 -0
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +4 -4
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +16 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +4 -4
- data/third_party/abseil-cpp/absl/base/options.h +1 -1
- data/third_party/abseil-cpp/absl/container/fixed_array.h +0 -5
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +105 -97
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +17 -15
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +18 -102
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +37 -78
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +388 -423
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +3 -2
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +14 -8
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +251 -120
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +11 -1
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +12 -11
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +6 -2
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +12 -5
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +110 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +234 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +25 -7
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +8 -2
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +21 -3
- data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +2 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize.cc +2 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +14 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +72 -0
- data/third_party/abseil-cpp/absl/functional/function_ref.h +4 -1
- data/third_party/abseil-cpp/absl/hash/hash.h +22 -0
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +15 -16
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +88 -37
- data/third_party/abseil-cpp/absl/hash/internal/{wyhash.cc → low_level_hash.cc} +23 -11
- data/third_party/abseil-cpp/absl/hash/internal/{wyhash.h → low_level_hash.h} +14 -12
- data/third_party/abseil-cpp/absl/memory/memory.h +1 -1
- data/third_party/abseil-cpp/absl/meta/type_traits.h +32 -2
- data/third_party/abseil-cpp/absl/numeric/int128.cc +3 -10
- data/third_party/abseil-cpp/absl/numeric/int128.h +146 -73
- data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +19 -25
- data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +73 -70
- data/third_party/abseil-cpp/absl/{base → profiling}/internal/exponential_biased.cc +4 -4
- data/third_party/abseil-cpp/absl/{base → profiling}/internal/exponential_biased.h +6 -6
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +230 -0
- 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 +92 -0
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +268 -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 +150 -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 +102 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +221 -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 +239 -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 +167 -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 +101 -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 +111 -0
- data/third_party/abseil-cpp/absl/random/log_uniform_int_distribution.h +257 -0
- data/third_party/abseil-cpp/absl/random/poisson_distribution.h +258 -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 +110 -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 +271 -0
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +5 -5
- data/third_party/abseil-cpp/absl/status/status.cc +9 -17
- data/third_party/abseil-cpp/absl/status/status.h +19 -15
- data/third_party/abseil-cpp/absl/status/statusor.cc +34 -2
- data/third_party/abseil-cpp/absl/status/statusor.h +31 -21
- data/third_party/abseil-cpp/absl/strings/charconv.cc +3 -3
- data/third_party/abseil-cpp/absl/strings/charconv.h +3 -2
- data/third_party/abseil-cpp/absl/strings/cord.cc +453 -359
- data/third_party/abseil-cpp/absl/strings/cord.h +197 -70
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +6 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +140 -63
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +1128 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +939 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +185 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h +265 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc +68 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h +211 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +129 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h +50 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +7 -7
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +55 -181
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +42 -24
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h +4 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc +96 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +85 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +139 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +131 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +445 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +298 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +87 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h +71 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h +121 -0
- data/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h +48 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +8 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +3 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +36 -18
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +62 -73
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +24 -16
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +35 -35
- data/third_party/abseil-cpp/absl/strings/numbers.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/numbers.h +34 -0
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/str_format.h +1 -2
- data/third_party/abseil-cpp/absl/strings/string_view.cc +16 -21
- data/third_party/abseil-cpp/absl/strings/string_view.h +120 -39
- data/third_party/abseil-cpp/absl/strings/substitute.cc +2 -1
- data/third_party/abseil-cpp/absl/strings/substitute.h +99 -74
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc +25 -15
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.h +5 -3
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +1 -1
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +3 -3
- data/third_party/abseil-cpp/absl/time/civil_time.cc +1 -3
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +93 -20
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +2 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +83 -21
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +49 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +2 -3
- data/third_party/abseil-cpp/absl/time/time.h +67 -36
- data/third_party/abseil-cpp/absl/types/bad_optional_access.h +1 -1
- data/third_party/abseil-cpp/absl/types/bad_variant_access.h +2 -2
- data/third_party/abseil-cpp/absl/types/span.h +3 -3
- data/third_party/boringssl-with-bazel/err_data.c +681 -677
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +19 -11
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +41 -30
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +59 -47
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c +24 -28
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/internal.h +28 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +48 -272
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c +8 -6
- data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +13 -0
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c +3 -1
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +21 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c +2 -2
- 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/fipsmodule/self_check/self_check.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +18 -0
- 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/crypto/pool/internal.h +5 -1
- data/third_party/boringssl-with-bazel/src/crypto/pool/pool.c +59 -23
- data/third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c +2 -18
- data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +8 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +216 -11
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_lib.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_node.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +21 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +971 -253
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +3 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +0 -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/dh.h +4 -12
- data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +27 -41
- data/third_party/boringssl-with-bazel/src/include/openssl/ec_key.h +12 -27
- data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +8 -10
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +29 -55
- data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +12 -13
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +6 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/pool.h +7 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +24 -28
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +29 -11
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +12 -43
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +4 -3
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +3 -3
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +4 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.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_rules.h → include/ares_rules.h} +0 -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/{ares__read_line.c → src/lib/ares__read_line.c} +0 -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/{ares__timeval.c → src/lib/ares__timeval.c} +0 -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_cancel.c → src/lib/ares_cancel.c} +0 -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_destroy.c → src/lib/ares_destroy.c} +0 -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_fds.c → src/lib/ares_fds.c} +0 -0
- data/third_party/cares/cares/{ares_free_hostent.c → src/lib/ares_free_hostent.c} +6 -4
- data/third_party/cares/cares/{ares_free_string.c → src/lib/ares_free_string.c} +0 -0
- 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_getenv.h → src/lib/ares_getenv.h} +0 -0
- 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_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_init.c → src/lib/ares_init.c} +79 -40
- data/third_party/cares/cares/{ares_iphlpapi.h → src/lib/ares_iphlpapi.h} +0 -0
- 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/{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/src/lib/ares_nameser.h +482 -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/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_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_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_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.c → src/lib/ares_strsplit.c} +4 -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/src/lib/ares_writev.h +36 -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/src/lib/config-dos.h +115 -0
- data/third_party/cares/cares/{config-win32.h → src/lib/config-win32.h} +0 -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/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
- 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 +716 -378
- 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 -55
- data/third_party/upb/upb/def.c +2009 -979
- data/third_party/upb/upb/def.h +321 -258
- data/third_party/upb/upb/def.hpp +139 -169
- data/third_party/upb/upb/encode.c +261 -174
- data/third_party/upb/upb/encode.h +15 -17
- data/third_party/upb/upb/msg.c +154 -121
- data/third_party/upb/upb/msg.h +40 -33
- data/third_party/upb/upb/msg_internal.h +381 -250
- data/third_party/upb/upb/reflection.c +292 -212
- data/third_party/upb/upb/reflection.h +91 -67
- data/third_party/upb/upb/reflection.hpp +6 -6
- data/third_party/upb/upb/table.c +222 -142
- data/third_party/upb/upb/table_internal.h +128 -96
- data/third_party/upb/upb/text_encode.c +114 -91
- data/third_party/upb/upb/text_encode.h +10 -10
- data/third_party/upb/upb/upb.c +118 -71
- data/third_party/upb/upb/upb.h +120 -144
- 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
- metadata +476 -213
- 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_registry.cc +0 -195
- data/src/core/ext/filters/client_channel/resolver_registry.h +0 -89
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +0 -119
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +0 -95
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +0 -189
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +0 -53
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +0 -83
- 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 -27
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +0 -62
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +0 -27
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +0 -62
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +0 -27
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +0 -62
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +0 -27
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +0 -62
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +0 -27
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +0 -62
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c +0 -72
- 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 -73
- 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 -72
- 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 -80
- 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 -74
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h +0 -35
- data/src/core/lib/avl/avl.cc +0 -306
- data/src/core/lib/compression/algorithm_metadata.h +0 -62
- data/src/core/lib/compression/compression_args.cc +0 -138
- data/src/core/lib/compression/compression_args.h +0 -56
- 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/gprpp/match.h +0 -73
- data/src/core/lib/gprpp/overload.h +0 -59
- data/src/core/lib/iomgr/event_engine/iomgr.h +0 -42
- 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/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/resource_quota.cc +0 -1106
- data/src/core/lib/iomgr/resource_quota.h +0 -226
- data/src/core/lib/iomgr/tcp_client_custom.cc +0 -152
- data/src/core/lib/iomgr/tcp_custom.cc +0 -377
- data/src/core/lib/iomgr/tcp_custom.h +0 -86
- data/src/core/lib/iomgr/tcp_server_custom.cc +0 -467
- 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 -171
- 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_utils.h +0 -200
- data/src/core/lib/slice/static_slice.cc +0 -529
- data/src/core/lib/slice/static_slice.h +0 -331
- data/src/core/lib/surface/init_secure.cc +0 -103
- data/src/core/lib/transport/metadata.cc +0 -714
- data/src/core/lib/transport/metadata.h +0 -449
- data/src/core/lib/transport/metadata_batch.cc +0 -94
- data/src/core/lib/transport/static_metadata.cc +0 -1117
- data/src/core/lib/transport/static_metadata.h +0 -340
- data/src/core/lib/transport/status_metadata.cc +0 -63
- data/src/core/lib/transport/status_metadata.h +0 -48
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c +0 -93
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_int.h +0 -217
- 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
@@ -23,90 +23,65 @@
|
|
23
23
|
|
24
24
|
#include <stdbool.h>
|
25
25
|
|
26
|
+
#include <cstdint>
|
27
|
+
#include <limits>
|
28
|
+
|
29
|
+
#include "absl/strings/escaping.h"
|
26
30
|
#include "absl/strings/match.h"
|
27
31
|
#include "absl/strings/str_join.h"
|
28
32
|
#include "absl/types/optional.h"
|
29
33
|
|
30
34
|
#include <grpc/grpc.h>
|
31
35
|
#include <grpc/slice.h>
|
36
|
+
#include <grpc/status.h>
|
32
37
|
#include <grpc/support/time.h>
|
33
38
|
|
39
|
+
#include "src/core/lib/compression/compression_internal.h"
|
34
40
|
#include "src/core/lib/gprpp/chunked_vector.h"
|
35
41
|
#include "src/core/lib/gprpp/table.h"
|
36
42
|
#include "src/core/lib/iomgr/exec_ctx.h"
|
43
|
+
#include "src/core/lib/slice/slice.h"
|
37
44
|
#include "src/core/lib/surface/validate_metadata.h"
|
38
|
-
#include "src/core/lib/transport/metadata.h"
|
39
45
|
#include "src/core/lib/transport/parsed_metadata.h"
|
40
|
-
#include "src/core/lib/transport/static_metadata.h"
|
41
46
|
#include "src/core/lib/transport/timeout_encoding.h"
|
42
47
|
|
43
|
-
typedef struct grpc_linked_mdelem {
|
44
|
-
grpc_linked_mdelem() {}
|
45
|
-
|
46
|
-
grpc_mdelem md;
|
47
|
-
struct grpc_linked_mdelem* next = nullptr;
|
48
|
-
struct grpc_linked_mdelem* prev = nullptr;
|
49
|
-
void* reserved;
|
50
|
-
} grpc_linked_mdelem;
|
51
|
-
|
52
|
-
typedef struct grpc_mdelem_list {
|
53
|
-
size_t count;
|
54
|
-
size_t default_count; // Number of default keys.
|
55
|
-
grpc_linked_mdelem* head;
|
56
|
-
grpc_linked_mdelem* tail;
|
57
|
-
} grpc_mdelem_list;
|
58
|
-
|
59
|
-
struct grpc_filtered_mdelem {
|
60
|
-
grpc_error_handle error;
|
61
|
-
grpc_mdelem md;
|
62
|
-
};
|
63
|
-
#define GRPC_FILTERED_ERROR(error) \
|
64
|
-
{ (error), GRPC_MDNULL }
|
65
|
-
#define GRPC_FILTERED_MDELEM(md) \
|
66
|
-
{ GRPC_ERROR_NONE, (md) }
|
67
|
-
#define GRPC_FILTERED_REMOVE() \
|
68
|
-
{ GRPC_ERROR_NONE, GRPC_MDNULL }
|
69
|
-
|
70
|
-
grpc_error_handle grpc_attach_md_to_error(grpc_error_handle src,
|
71
|
-
grpc_mdelem md);
|
72
|
-
|
73
48
|
namespace grpc_core {
|
74
49
|
|
75
50
|
// grpc-timeout metadata trait.
|
76
|
-
// ValueType is defined as
|
51
|
+
// ValueType is defined as Timestamp - an absolute timestamp (i.e. a
|
77
52
|
// deadline!), that is converted to a duration by transports before being
|
78
53
|
// sent.
|
79
54
|
// TODO(ctiller): Move this elsewhere. During the transition we need to be able
|
80
55
|
// to name this in MetadataMap, but ultimately once the transition is done we
|
81
56
|
// should not need to.
|
82
57
|
struct GrpcTimeoutMetadata {
|
83
|
-
|
84
|
-
using
|
85
|
-
|
86
|
-
static
|
87
|
-
|
88
|
-
|
89
|
-
|
58
|
+
static constexpr bool kRepeatable = false;
|
59
|
+
using ValueType = Timestamp;
|
60
|
+
using MementoType = Duration;
|
61
|
+
static absl::string_view key() { return "grpc-timeout"; }
|
62
|
+
static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
|
63
|
+
auto timeout = ParseTimeout(value);
|
64
|
+
if (!timeout.has_value()) {
|
65
|
+
on_error("invalid value", value);
|
66
|
+
return Duration::Infinity();
|
90
67
|
}
|
91
|
-
|
92
|
-
return timeout;
|
68
|
+
return *timeout;
|
93
69
|
}
|
94
70
|
static ValueType MementoToValue(MementoType timeout) {
|
95
|
-
if (timeout ==
|
96
|
-
return
|
71
|
+
if (timeout == Duration::Infinity()) {
|
72
|
+
return Timestamp::InfFuture();
|
97
73
|
}
|
98
|
-
return
|
74
|
+
return ExecCtx::Get()->Now() + timeout;
|
99
75
|
}
|
100
|
-
static
|
101
|
-
|
102
|
-
grpc_http2_encode_timeout(x, timeout);
|
103
|
-
return grpc_slice_from_copied_string(timeout);
|
76
|
+
static Slice Encode(ValueType x) {
|
77
|
+
return Timeout::FromDuration(x - ExecCtx::Get()->Now()).Encode();
|
104
78
|
}
|
105
|
-
static
|
79
|
+
static std::string DisplayValue(MementoType x) { return x.ToString(); }
|
106
80
|
};
|
107
81
|
|
108
82
|
// TE metadata trait.
|
109
83
|
struct TeMetadata {
|
84
|
+
static constexpr bool kRepeatable = false;
|
110
85
|
// HTTP2 says that TE can either be empty or "trailers".
|
111
86
|
// Empty means this trait is not included, "trailers" means kTrailers, and
|
112
87
|
// kInvalid is used to remember an invalid value.
|
@@ -115,19 +90,20 @@ struct TeMetadata {
|
|
115
90
|
kInvalid,
|
116
91
|
};
|
117
92
|
using MementoType = ValueType;
|
118
|
-
static
|
119
|
-
static MementoType ParseMemento(
|
93
|
+
static absl::string_view key() { return "te"; }
|
94
|
+
static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
|
120
95
|
auto out = kInvalid;
|
121
|
-
if (
|
96
|
+
if (value == "trailers") {
|
122
97
|
out = kTrailers;
|
98
|
+
} else {
|
99
|
+
on_error("invalid value", value);
|
123
100
|
}
|
124
|
-
grpc_slice_unref_internal(value);
|
125
101
|
return out;
|
126
102
|
}
|
127
103
|
static ValueType MementoToValue(MementoType te) { return te; }
|
128
|
-
static
|
104
|
+
static StaticSlice Encode(ValueType x) {
|
129
105
|
GPR_ASSERT(x == kTrailers);
|
130
|
-
return
|
106
|
+
return StaticSlice::FromStaticString("trailers");
|
131
107
|
}
|
132
108
|
static const char* DisplayValue(MementoType te) {
|
133
109
|
switch (te) {
|
@@ -139,109 +115,952 @@ struct TeMetadata {
|
|
139
115
|
}
|
140
116
|
};
|
141
117
|
|
118
|
+
// content-type metadata trait.
|
119
|
+
struct ContentTypeMetadata {
|
120
|
+
static constexpr bool kRepeatable = false;
|
121
|
+
// gRPC says that content-type can be application/grpc[;something]
|
122
|
+
// Core has only ever verified the prefix.
|
123
|
+
// IF we want to start verifying more, we can expand this type.
|
124
|
+
enum ValueType {
|
125
|
+
kApplicationGrpc,
|
126
|
+
kEmpty,
|
127
|
+
kInvalid,
|
128
|
+
};
|
129
|
+
using MementoType = ValueType;
|
130
|
+
static absl::string_view key() { return "content-type"; }
|
131
|
+
static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
|
132
|
+
auto out = kInvalid;
|
133
|
+
auto value_string = value.as_string_view();
|
134
|
+
if (value_string == "application/grpc") {
|
135
|
+
out = kApplicationGrpc;
|
136
|
+
} else if (absl::StartsWith(value_string, "application/grpc;")) {
|
137
|
+
out = kApplicationGrpc;
|
138
|
+
} else if (absl::StartsWith(value_string, "application/grpc+")) {
|
139
|
+
out = kApplicationGrpc;
|
140
|
+
} else if (value_string.empty()) {
|
141
|
+
out = kEmpty;
|
142
|
+
} else {
|
143
|
+
on_error("invalid value", value);
|
144
|
+
}
|
145
|
+
return out;
|
146
|
+
}
|
147
|
+
static ValueType MementoToValue(MementoType content_type) {
|
148
|
+
return content_type;
|
149
|
+
}
|
150
|
+
static StaticSlice Encode(ValueType x) {
|
151
|
+
switch (x) {
|
152
|
+
case kEmpty:
|
153
|
+
return StaticSlice::FromStaticString("");
|
154
|
+
case kApplicationGrpc:
|
155
|
+
return StaticSlice::FromStaticString("application/grpc");
|
156
|
+
case kInvalid:
|
157
|
+
return StaticSlice::FromStaticString("application/grpc+unknown");
|
158
|
+
}
|
159
|
+
GPR_UNREACHABLE_CODE(
|
160
|
+
return StaticSlice::FromStaticString("unrepresentable value"));
|
161
|
+
}
|
162
|
+
static const char* DisplayValue(MementoType content_type) {
|
163
|
+
switch (content_type) {
|
164
|
+
case ValueType::kApplicationGrpc:
|
165
|
+
return "application/grpc";
|
166
|
+
case ValueType::kEmpty:
|
167
|
+
return "";
|
168
|
+
default:
|
169
|
+
return "<discarded-invalid-value>";
|
170
|
+
}
|
171
|
+
}
|
172
|
+
};
|
173
|
+
|
174
|
+
// scheme metadata trait.
|
175
|
+
struct HttpSchemeMetadata {
|
176
|
+
static constexpr bool kRepeatable = false;
|
177
|
+
enum ValueType {
|
178
|
+
kHttp,
|
179
|
+
kHttps,
|
180
|
+
kInvalid,
|
181
|
+
};
|
182
|
+
using MementoType = ValueType;
|
183
|
+
static absl::string_view key() { return ":scheme"; }
|
184
|
+
static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
|
185
|
+
return Parse(value.as_string_view(), on_error);
|
186
|
+
}
|
187
|
+
static ValueType Parse(absl::string_view value,
|
188
|
+
MetadataParseErrorFn on_error) {
|
189
|
+
if (value == "http") {
|
190
|
+
return kHttp;
|
191
|
+
} else if (value == "https") {
|
192
|
+
return kHttps;
|
193
|
+
}
|
194
|
+
on_error("invalid value", Slice::FromCopiedBuffer(value));
|
195
|
+
return kInvalid;
|
196
|
+
}
|
197
|
+
static ValueType MementoToValue(MementoType content_type) {
|
198
|
+
return content_type;
|
199
|
+
}
|
200
|
+
static StaticSlice Encode(ValueType x) {
|
201
|
+
switch (x) {
|
202
|
+
case kHttp:
|
203
|
+
return StaticSlice::FromStaticString("http");
|
204
|
+
case kHttps:
|
205
|
+
return StaticSlice::FromStaticString("https");
|
206
|
+
default:
|
207
|
+
abort();
|
208
|
+
}
|
209
|
+
}
|
210
|
+
static const char* DisplayValue(MementoType content_type) {
|
211
|
+
switch (content_type) {
|
212
|
+
case kHttp:
|
213
|
+
return "http";
|
214
|
+
case kHttps:
|
215
|
+
return "https";
|
216
|
+
default:
|
217
|
+
return "<discarded-invalid-value>";
|
218
|
+
}
|
219
|
+
}
|
220
|
+
};
|
221
|
+
|
222
|
+
// method metadata trait.
|
223
|
+
struct HttpMethodMetadata {
|
224
|
+
static constexpr bool kRepeatable = false;
|
225
|
+
enum ValueType {
|
226
|
+
kPost,
|
227
|
+
kPut,
|
228
|
+
kGet,
|
229
|
+
kInvalid,
|
230
|
+
};
|
231
|
+
using MementoType = ValueType;
|
232
|
+
static absl::string_view key() { return ":method"; }
|
233
|
+
static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
|
234
|
+
auto out = kInvalid;
|
235
|
+
auto value_string = value.as_string_view();
|
236
|
+
if (value_string == "POST") {
|
237
|
+
out = kPost;
|
238
|
+
} else if (value_string == "PUT") {
|
239
|
+
out = kPut;
|
240
|
+
} else if (value_string == "GET") {
|
241
|
+
out = kGet;
|
242
|
+
} else {
|
243
|
+
on_error("invalid value", value);
|
244
|
+
}
|
245
|
+
return out;
|
246
|
+
}
|
247
|
+
static ValueType MementoToValue(MementoType content_type) {
|
248
|
+
return content_type;
|
249
|
+
}
|
250
|
+
static StaticSlice Encode(ValueType x) {
|
251
|
+
switch (x) {
|
252
|
+
case kPost:
|
253
|
+
return StaticSlice::FromStaticString("POST");
|
254
|
+
case kPut:
|
255
|
+
return StaticSlice::FromStaticString("PUT");
|
256
|
+
case kGet:
|
257
|
+
return StaticSlice::FromStaticString("GET");
|
258
|
+
default:
|
259
|
+
abort();
|
260
|
+
}
|
261
|
+
}
|
262
|
+
static const char* DisplayValue(MementoType content_type) {
|
263
|
+
switch (content_type) {
|
264
|
+
case kPost:
|
265
|
+
return "POST";
|
266
|
+
case kPut:
|
267
|
+
return "PUT";
|
268
|
+
case kGet:
|
269
|
+
return "GET";
|
270
|
+
default:
|
271
|
+
return "<discarded-invalid-value>";
|
272
|
+
}
|
273
|
+
}
|
274
|
+
};
|
275
|
+
|
276
|
+
// Base type for metadata pertaining to a single compression algorithm
|
277
|
+
// (e.g., "grpc-encoding").
|
278
|
+
struct CompressionAlgorithmBasedMetadata {
|
279
|
+
using ValueType = grpc_compression_algorithm;
|
280
|
+
using MementoType = ValueType;
|
281
|
+
static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
|
282
|
+
auto algorithm = ParseCompressionAlgorithm(value.as_string_view());
|
283
|
+
if (!algorithm.has_value()) {
|
284
|
+
on_error("invalid value", value);
|
285
|
+
return GRPC_COMPRESS_NONE;
|
286
|
+
}
|
287
|
+
return *algorithm;
|
288
|
+
}
|
289
|
+
static ValueType MementoToValue(MementoType x) { return x; }
|
290
|
+
static Slice Encode(ValueType x) {
|
291
|
+
GPR_ASSERT(x != GRPC_COMPRESS_ALGORITHMS_COUNT);
|
292
|
+
return Slice::FromStaticString(CompressionAlgorithmAsString(x));
|
293
|
+
}
|
294
|
+
static const char* DisplayValue(MementoType x) {
|
295
|
+
if (const char* p = CompressionAlgorithmAsString(x)) {
|
296
|
+
return p;
|
297
|
+
} else {
|
298
|
+
return "<discarded-invalid-value>";
|
299
|
+
}
|
300
|
+
}
|
301
|
+
};
|
302
|
+
|
303
|
+
// grpc-encoding metadata trait.
|
304
|
+
struct GrpcEncodingMetadata : public CompressionAlgorithmBasedMetadata {
|
305
|
+
static constexpr bool kRepeatable = false;
|
306
|
+
static absl::string_view key() { return "grpc-encoding"; }
|
307
|
+
};
|
308
|
+
|
309
|
+
// grpc-internal-encoding-request metadata trait.
|
310
|
+
struct GrpcInternalEncodingRequest : public CompressionAlgorithmBasedMetadata {
|
311
|
+
static constexpr bool kRepeatable = false;
|
312
|
+
static absl::string_view key() { return "grpc-internal-encoding-request"; }
|
313
|
+
};
|
314
|
+
|
315
|
+
// grpc-accept-encoding metadata trait.
|
316
|
+
struct GrpcAcceptEncodingMetadata {
|
317
|
+
static constexpr bool kRepeatable = false;
|
318
|
+
static absl::string_view key() { return "grpc-accept-encoding"; }
|
319
|
+
using ValueType = CompressionAlgorithmSet;
|
320
|
+
using MementoType = ValueType;
|
321
|
+
static MementoType ParseMemento(Slice value, MetadataParseErrorFn) {
|
322
|
+
return CompressionAlgorithmSet::FromString(value.as_string_view());
|
323
|
+
}
|
324
|
+
static ValueType MementoToValue(MementoType x) { return x; }
|
325
|
+
static Slice Encode(ValueType x) { return x.ToSlice(); }
|
326
|
+
static std::string DisplayValue(MementoType x) { return x.ToString(); }
|
327
|
+
};
|
328
|
+
|
329
|
+
struct SimpleSliceBasedMetadata {
|
330
|
+
using ValueType = Slice;
|
331
|
+
using MementoType = Slice;
|
332
|
+
static MementoType ParseMemento(Slice value, MetadataParseErrorFn) {
|
333
|
+
return value.TakeOwned();
|
334
|
+
}
|
335
|
+
static ValueType MementoToValue(MementoType value) { return value; }
|
336
|
+
static Slice Encode(const ValueType& x) { return x.Ref(); }
|
337
|
+
static absl::string_view DisplayValue(const MementoType& value) {
|
338
|
+
return value.as_string_view();
|
339
|
+
}
|
340
|
+
};
|
341
|
+
|
342
|
+
// user-agent metadata trait.
|
343
|
+
struct UserAgentMetadata : public SimpleSliceBasedMetadata {
|
344
|
+
static constexpr bool kRepeatable = false;
|
345
|
+
static absl::string_view key() { return "user-agent"; }
|
346
|
+
};
|
347
|
+
|
348
|
+
// grpc-message metadata trait.
|
349
|
+
struct GrpcMessageMetadata : public SimpleSliceBasedMetadata {
|
350
|
+
static constexpr bool kRepeatable = false;
|
351
|
+
static absl::string_view key() { return "grpc-message"; }
|
352
|
+
};
|
353
|
+
|
354
|
+
// host metadata trait.
|
355
|
+
struct HostMetadata : public SimpleSliceBasedMetadata {
|
356
|
+
static constexpr bool kRepeatable = false;
|
357
|
+
static absl::string_view key() { return "host"; }
|
358
|
+
};
|
359
|
+
|
360
|
+
// x-endpoint-load-metrics-bin metadata trait.
|
361
|
+
struct XEndpointLoadMetricsBinMetadata : public SimpleSliceBasedMetadata {
|
362
|
+
static constexpr bool kRepeatable = false;
|
363
|
+
static absl::string_view key() { return "x-endpoint-load-metrics-bin"; }
|
364
|
+
};
|
365
|
+
|
366
|
+
// grpc-server-stats-bin metadata trait.
|
367
|
+
struct GrpcServerStatsBinMetadata : public SimpleSliceBasedMetadata {
|
368
|
+
static constexpr bool kRepeatable = false;
|
369
|
+
static absl::string_view key() { return "grpc-server-stats-bin"; }
|
370
|
+
};
|
371
|
+
|
372
|
+
// grpc-trace-bin metadata trait.
|
373
|
+
struct GrpcTraceBinMetadata : public SimpleSliceBasedMetadata {
|
374
|
+
static constexpr bool kRepeatable = false;
|
375
|
+
static absl::string_view key() { return "grpc-trace-bin"; }
|
376
|
+
};
|
377
|
+
|
378
|
+
// grpc-tags-bin metadata trait.
|
379
|
+
struct GrpcTagsBinMetadata : public SimpleSliceBasedMetadata {
|
380
|
+
static constexpr bool kRepeatable = false;
|
381
|
+
static absl::string_view key() { return "grpc-tags-bin"; }
|
382
|
+
};
|
383
|
+
|
384
|
+
// :authority metadata trait.
|
385
|
+
struct HttpAuthorityMetadata : public SimpleSliceBasedMetadata {
|
386
|
+
static constexpr bool kRepeatable = false;
|
387
|
+
static absl::string_view key() { return ":authority"; }
|
388
|
+
};
|
389
|
+
|
390
|
+
// :path metadata trait.
|
391
|
+
struct HttpPathMetadata : public SimpleSliceBasedMetadata {
|
392
|
+
static constexpr bool kRepeatable = false;
|
393
|
+
static absl::string_view key() { return ":path"; }
|
394
|
+
};
|
395
|
+
|
396
|
+
// We separate SimpleIntBasedMetadata into two pieces: one that does not depend
|
397
|
+
// on the invalid value, and one that does. This allows the compiler to easily
|
398
|
+
// see the functions that are shared, and helps reduce code bloat here.
|
399
|
+
template <typename Int>
|
400
|
+
struct SimpleIntBasedMetadataBase {
|
401
|
+
using ValueType = Int;
|
402
|
+
using MementoType = Int;
|
403
|
+
static ValueType MementoToValue(MementoType value) { return value; }
|
404
|
+
static Slice Encode(ValueType x) { return Slice::FromInt64(x); }
|
405
|
+
static Int DisplayValue(MementoType x) { return x; }
|
406
|
+
};
|
407
|
+
|
408
|
+
template <typename Int, Int kInvalidValue>
|
409
|
+
struct SimpleIntBasedMetadata : public SimpleIntBasedMetadataBase<Int> {
|
410
|
+
static constexpr Int invalid_value() { return kInvalidValue; }
|
411
|
+
static Int ParseMemento(Slice value, MetadataParseErrorFn on_error) {
|
412
|
+
Int out;
|
413
|
+
if (!absl::SimpleAtoi(value.as_string_view(), &out)) {
|
414
|
+
on_error("not an integer", value);
|
415
|
+
out = kInvalidValue;
|
416
|
+
}
|
417
|
+
return out;
|
418
|
+
}
|
419
|
+
};
|
420
|
+
|
421
|
+
// grpc-status metadata trait.
|
422
|
+
struct GrpcStatusMetadata
|
423
|
+
: public SimpleIntBasedMetadata<grpc_status_code, GRPC_STATUS_UNKNOWN> {
|
424
|
+
static constexpr bool kRepeatable = false;
|
425
|
+
static absl::string_view key() { return "grpc-status"; }
|
426
|
+
};
|
427
|
+
|
428
|
+
// grpc-previous-rpc-attempts metadata trait.
|
429
|
+
struct GrpcPreviousRpcAttemptsMetadata
|
430
|
+
: public SimpleIntBasedMetadata<uint32_t, 0> {
|
431
|
+
static constexpr bool kRepeatable = false;
|
432
|
+
static absl::string_view key() { return "grpc-previous-rpc-attempts"; }
|
433
|
+
};
|
434
|
+
|
435
|
+
// grpc-retry-pushback-ms metadata trait.
|
436
|
+
struct GrpcRetryPushbackMsMetadata {
|
437
|
+
static constexpr bool kRepeatable = false;
|
438
|
+
static absl::string_view key() { return "grpc-retry-pushback-ms"; }
|
439
|
+
using ValueType = Duration;
|
440
|
+
using MementoType = Duration;
|
441
|
+
static ValueType MementoToValue(MementoType x) { return x; }
|
442
|
+
static Slice Encode(Duration x) { return Slice::FromInt64(x.millis()); }
|
443
|
+
static int64_t DisplayValue(Duration x) { return x.millis(); }
|
444
|
+
static Duration ParseMemento(Slice value, MetadataParseErrorFn on_error) {
|
445
|
+
int64_t out;
|
446
|
+
if (!absl::SimpleAtoi(value.as_string_view(), &out)) {
|
447
|
+
on_error("not an integer", value);
|
448
|
+
return Duration::NegativeInfinity();
|
449
|
+
}
|
450
|
+
return Duration::Milliseconds(out);
|
451
|
+
}
|
452
|
+
};
|
453
|
+
|
454
|
+
// :status metadata trait.
|
455
|
+
// TODO(ctiller): consider moving to uint16_t
|
456
|
+
struct HttpStatusMetadata : public SimpleIntBasedMetadata<uint32_t, 0> {
|
457
|
+
static constexpr bool kRepeatable = false;
|
458
|
+
static absl::string_view key() { return ":status"; }
|
459
|
+
};
|
460
|
+
|
461
|
+
// "secret" metadata trait used to pass load balancing token between filters.
|
462
|
+
// This should not be exposed outside of gRPC core.
|
463
|
+
class GrpcLbClientStats;
|
464
|
+
struct GrpcLbClientStatsMetadata {
|
465
|
+
static constexpr bool kRepeatable = false;
|
466
|
+
static absl::string_view key() { return "grpclb_client_stats"; }
|
467
|
+
using ValueType = GrpcLbClientStats*;
|
468
|
+
using MementoType = ValueType;
|
469
|
+
static ValueType MementoToValue(MementoType value) { return value; }
|
470
|
+
static Slice Encode(ValueType) { abort(); }
|
471
|
+
static const char* DisplayValue(MementoType) { return "<internal-lb-stats>"; }
|
472
|
+
static MementoType ParseMemento(Slice, MetadataParseErrorFn) {
|
473
|
+
return nullptr;
|
474
|
+
}
|
475
|
+
};
|
476
|
+
|
477
|
+
// lb-token metadata
|
478
|
+
struct LbTokenMetadata : public SimpleSliceBasedMetadata {
|
479
|
+
static constexpr bool kRepeatable = false;
|
480
|
+
static absl::string_view key() { return "lb-token"; }
|
481
|
+
};
|
482
|
+
|
483
|
+
// lb-cost-bin metadata
|
484
|
+
struct LbCostBinMetadata {
|
485
|
+
static constexpr bool kRepeatable = true;
|
486
|
+
static absl::string_view key() { return "lb-cost-bin"; }
|
487
|
+
struct ValueType {
|
488
|
+
double cost;
|
489
|
+
std::string name;
|
490
|
+
};
|
491
|
+
using MementoType = ValueType;
|
492
|
+
static ValueType MementoToValue(MementoType value) { return value; }
|
493
|
+
static Slice Encode(const ValueType& x) {
|
494
|
+
auto slice =
|
495
|
+
MutableSlice::CreateUninitialized(sizeof(double) + x.name.length());
|
496
|
+
memcpy(slice.data(), &x.cost, sizeof(double));
|
497
|
+
memcpy(slice.data() + sizeof(double), x.name.data(), x.name.length());
|
498
|
+
return Slice(std::move(slice));
|
499
|
+
}
|
500
|
+
static std::string DisplayValue(MementoType x) {
|
501
|
+
return absl::StrCat(x.name, ":", x.cost);
|
502
|
+
}
|
503
|
+
static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
|
504
|
+
if (value.length() < sizeof(double)) {
|
505
|
+
on_error("too short", value);
|
506
|
+
return {0, ""};
|
507
|
+
}
|
508
|
+
MementoType out;
|
509
|
+
memcpy(&out.cost, value.data(), sizeof(double));
|
510
|
+
out.name = std::string(
|
511
|
+
reinterpret_cast<const char*>(value.data()) + sizeof(double),
|
512
|
+
value.length() - sizeof(double));
|
513
|
+
return out;
|
514
|
+
}
|
515
|
+
};
|
516
|
+
|
517
|
+
// Annotation added by a transport to note whether a failed request was never
|
518
|
+
// placed on the wire, or never seen by a server.
|
519
|
+
struct GrpcStreamNetworkState {
|
520
|
+
static absl::string_view DebugKey() { return "GrpcStreamNetworkState"; }
|
521
|
+
static constexpr bool kRepeatable = false;
|
522
|
+
enum ValueType : uint8_t {
|
523
|
+
kNotSentOnWire,
|
524
|
+
kNotSeenByServer,
|
525
|
+
};
|
526
|
+
static std::string DisplayValue(ValueType x) {
|
527
|
+
switch (x) {
|
528
|
+
case kNotSentOnWire:
|
529
|
+
return "not sent on wire";
|
530
|
+
case kNotSeenByServer:
|
531
|
+
return "not seen by server";
|
532
|
+
}
|
533
|
+
}
|
534
|
+
};
|
535
|
+
|
536
|
+
// Annotation added by various systems to describe the reason for a failure.
|
537
|
+
struct GrpcStatusContext {
|
538
|
+
static absl::string_view DebugKey() { return "GrpcStatusContext"; }
|
539
|
+
static constexpr bool kRepeatable = true;
|
540
|
+
using ValueType = std::string;
|
541
|
+
static const std::string& DisplayValue(const std::string& x) { return x; }
|
542
|
+
};
|
543
|
+
|
142
544
|
namespace metadata_detail {
|
143
545
|
|
144
|
-
//
|
145
|
-
//
|
146
|
-
//
|
147
|
-
//
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
546
|
+
// IsEncodable: Given a trait, determine if that trait is encodable, or is just
|
547
|
+
// a value attached to a MetadataMap.
|
548
|
+
// We use the presence of the key() static method to determine if a trait is
|
549
|
+
// encodable or not - encodable traits have string names, and non-encodable
|
550
|
+
// traits do not.
|
551
|
+
template <typename Trait, typename Ignored = void>
|
552
|
+
struct IsEncodableTrait {
|
553
|
+
static const bool value = false;
|
554
|
+
};
|
555
|
+
|
556
|
+
template <typename Trait>
|
557
|
+
struct IsEncodableTrait<Trait, absl::void_t<decltype(Trait::key())>> {
|
558
|
+
static const bool value = true;
|
559
|
+
};
|
560
|
+
|
561
|
+
// Helper type - maps a string name to a trait.
|
562
|
+
template <typename MustBeVoid, typename... Traits>
|
563
|
+
struct NameLookup;
|
564
|
+
|
565
|
+
template <typename Trait, typename... Traits>
|
566
|
+
struct NameLookup<absl::enable_if_t<IsEncodableTrait<Trait>::value, void>,
|
567
|
+
Trait, Traits...> {
|
568
|
+
// Call op->Found(Trait()) if op->name == Trait::key() for some Trait in
|
569
|
+
// Traits. If not found, call op->NotFound().
|
570
|
+
template <typename Op>
|
571
|
+
static auto Lookup(absl::string_view key, Op* op)
|
572
|
+
-> decltype(op->Found(Trait())) {
|
157
573
|
if (key == Trait::key()) {
|
158
|
-
return
|
159
|
-
Trait(), Trait::ParseMemento(value),
|
160
|
-
ParsedMetadata<Container>::TransportSize(key.size(),
|
161
|
-
GRPC_SLICE_LENGTH(value)));
|
574
|
+
return op->Found(Trait());
|
162
575
|
}
|
163
|
-
return
|
576
|
+
return NameLookup<void, Traits...>::Lookup(key, op);
|
577
|
+
}
|
578
|
+
};
|
579
|
+
|
580
|
+
template <typename Trait, typename... Traits>
|
581
|
+
struct NameLookup<absl::enable_if_t<!IsEncodableTrait<Trait>::value, void>,
|
582
|
+
Trait, Traits...> {
|
583
|
+
template <typename Op>
|
584
|
+
static auto Lookup(absl::string_view key, Op* op)
|
585
|
+
-> decltype(NameLookup<void, Traits...>::Lookup(key, op)) {
|
586
|
+
return NameLookup<void, Traits...>::Lookup(key, op);
|
587
|
+
}
|
588
|
+
};
|
589
|
+
|
590
|
+
template <>
|
591
|
+
struct NameLookup<void> {
|
592
|
+
template <typename Op>
|
593
|
+
static auto Lookup(absl::string_view key, Op* op)
|
594
|
+
-> decltype(op->NotFound(key)) {
|
595
|
+
return op->NotFound(key);
|
596
|
+
}
|
597
|
+
};
|
598
|
+
|
599
|
+
// Helper to take a slice to a memento to a value.
|
600
|
+
// By splitting this part out we can scale code size as the number of (memento,
|
601
|
+
// value) types, rather than as the number of traits.
|
602
|
+
template <typename ParseMementoFn, typename MementoToValueFn>
|
603
|
+
struct ParseValue {
|
604
|
+
template <ParseMementoFn parse_memento, MementoToValueFn memento_to_value>
|
605
|
+
static GPR_ATTRIBUTE_NOINLINE auto Parse(Slice* value,
|
606
|
+
MetadataParseErrorFn on_error)
|
607
|
+
-> decltype(memento_to_value(parse_memento(std::move(*value),
|
608
|
+
on_error))) {
|
609
|
+
return memento_to_value(parse_memento(std::move(*value), on_error));
|
610
|
+
}
|
611
|
+
};
|
612
|
+
|
613
|
+
// This is an "Op" type for NameLookup.
|
614
|
+
// Used for MetadataMap::Parse, its Found/NotFound methods turn a slice into a
|
615
|
+
// ParsedMetadata object.
|
616
|
+
template <typename Container>
|
617
|
+
class ParseHelper {
|
618
|
+
public:
|
619
|
+
ParseHelper(Slice value, MetadataParseErrorFn on_error, size_t transport_size)
|
620
|
+
: value_(std::move(value)),
|
621
|
+
on_error_(on_error),
|
622
|
+
transport_size_(transport_size) {}
|
623
|
+
|
624
|
+
template <typename Trait>
|
625
|
+
GPR_ATTRIBUTE_NOINLINE ParsedMetadata<Container> Found(Trait trait) {
|
626
|
+
return ParsedMetadata<Container>(
|
627
|
+
trait,
|
628
|
+
ParseValueToMemento<typename Trait::MementoType, Trait::ParseMemento>(),
|
629
|
+
transport_size_);
|
630
|
+
}
|
631
|
+
|
632
|
+
GPR_ATTRIBUTE_NOINLINE ParsedMetadata<Container> NotFound(
|
633
|
+
absl::string_view key) {
|
634
|
+
return ParsedMetadata<Container>(Slice::FromCopiedString(key),
|
635
|
+
std::move(value_));
|
164
636
|
}
|
637
|
+
|
638
|
+
private:
|
639
|
+
template <typename T, T (*parse_memento)(Slice, MetadataParseErrorFn)>
|
640
|
+
GPR_ATTRIBUTE_NOINLINE T ParseValueToMemento() {
|
641
|
+
return parse_memento(std::move(value_), on_error_);
|
642
|
+
}
|
643
|
+
|
644
|
+
Slice value_;
|
645
|
+
MetadataParseErrorFn on_error_;
|
646
|
+
const size_t transport_size_;
|
165
647
|
};
|
166
648
|
|
649
|
+
// This is an "Op" type for NameLookup.
|
650
|
+
// Used for MetadataMap::Append, its Found/NotFound methods turn a slice into a
|
651
|
+
// value and add it to a container.
|
167
652
|
template <typename Container>
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
653
|
+
class AppendHelper {
|
654
|
+
public:
|
655
|
+
AppendHelper(Container* container, Slice value, MetadataParseErrorFn on_error)
|
656
|
+
: container_(container), value_(std::move(value)), on_error_(on_error) {}
|
657
|
+
|
658
|
+
template <typename Trait>
|
659
|
+
GPR_ATTRIBUTE_NOINLINE void Found(Trait trait) {
|
660
|
+
container_->Set(
|
661
|
+
trait, ParseValue<decltype(Trait::ParseMemento),
|
662
|
+
decltype(Trait::MementoToValue)>::
|
663
|
+
template Parse<Trait::ParseMemento, Trait::MementoToValue>(
|
664
|
+
&value_, on_error_));
|
665
|
+
}
|
666
|
+
|
667
|
+
GPR_ATTRIBUTE_NOINLINE void NotFound(absl::string_view key) {
|
668
|
+
container_->AppendUnknown(key, std::move(value_));
|
173
669
|
}
|
670
|
+
|
671
|
+
private:
|
672
|
+
Container* const container_;
|
673
|
+
Slice value_;
|
674
|
+
MetadataParseErrorFn on_error_;
|
174
675
|
};
|
175
676
|
|
176
|
-
//
|
177
|
-
//
|
178
|
-
//
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
return;
|
192
|
-
}
|
193
|
-
AppendHelper<Container, Traits...>::Append(container, key, value,
|
194
|
-
not_found);
|
677
|
+
// This is an "Op" type for NameLookup.
|
678
|
+
// Used for MetadataMap::Remove, its Found/NotFound methods remove a key from
|
679
|
+
// the container.
|
680
|
+
template <typename Container>
|
681
|
+
class RemoveHelper {
|
682
|
+
public:
|
683
|
+
explicit RemoveHelper(Container* container) : container_(container) {}
|
684
|
+
|
685
|
+
template <typename Trait>
|
686
|
+
GPR_ATTRIBUTE_NOINLINE void Found(Trait trait) {
|
687
|
+
container_->Remove(trait);
|
688
|
+
}
|
689
|
+
|
690
|
+
GPR_ATTRIBUTE_NOINLINE void NotFound(absl::string_view key) {
|
691
|
+
container_->RemoveUnknown(key);
|
195
692
|
}
|
693
|
+
|
694
|
+
private:
|
695
|
+
Container* const container_;
|
196
696
|
};
|
197
697
|
|
698
|
+
// This is an "Op" type for NameLookup.
|
699
|
+
// Used for MetadataMap::GetStringValue, its Found/NotFound methods generated a
|
700
|
+
// string value from the container.
|
198
701
|
template <typename Container>
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
702
|
+
class GetStringValueHelper {
|
703
|
+
public:
|
704
|
+
explicit GetStringValueHelper(const Container* container,
|
705
|
+
std::string* backing)
|
706
|
+
: container_(container), backing_(backing) {}
|
707
|
+
|
708
|
+
template <typename Trait>
|
709
|
+
GPR_ATTRIBUTE_NOINLINE absl::enable_if_t<
|
710
|
+
Trait::kRepeatable == false &&
|
711
|
+
std::is_same<Slice, typename Trait::ValueType>::value,
|
712
|
+
absl::optional<absl::string_view>>
|
713
|
+
Found(Trait) {
|
714
|
+
const auto* value = container_->get_pointer(Trait());
|
715
|
+
if (value == nullptr) return absl::nullopt;
|
716
|
+
return value->as_string_view();
|
717
|
+
}
|
718
|
+
|
719
|
+
template <typename Trait>
|
720
|
+
GPR_ATTRIBUTE_NOINLINE absl::enable_if_t<
|
721
|
+
Trait::kRepeatable == true &&
|
722
|
+
!std::is_same<Slice, typename Trait::ValueType>::value,
|
723
|
+
absl::optional<absl::string_view>>
|
724
|
+
Found(Trait) {
|
725
|
+
const auto* value = container_->get_pointer(Trait());
|
726
|
+
if (value == nullptr) return absl::nullopt;
|
727
|
+
backing_->clear();
|
728
|
+
for (const auto& v : *value) {
|
729
|
+
if (!backing_->empty()) backing_->push_back(',');
|
730
|
+
auto new_segment = Trait::Encode(v);
|
731
|
+
backing_->append(new_segment.begin(), new_segment.end());
|
732
|
+
}
|
733
|
+
return *backing_;
|
734
|
+
}
|
735
|
+
|
736
|
+
template <typename Trait>
|
737
|
+
GPR_ATTRIBUTE_NOINLINE absl::enable_if_t<
|
738
|
+
Trait::kRepeatable == false &&
|
739
|
+
!std::is_same<Slice, typename Trait::ValueType>::value,
|
740
|
+
absl::optional<absl::string_view>>
|
741
|
+
Found(Trait) {
|
742
|
+
const auto* value = container_->get_pointer(Trait());
|
743
|
+
if (value == nullptr) return absl::nullopt;
|
744
|
+
*backing_ = std::string(Trait::Encode(*value).as_string_view());
|
745
|
+
return *backing_;
|
746
|
+
}
|
747
|
+
|
748
|
+
GPR_ATTRIBUTE_NOINLINE absl::optional<absl::string_view> NotFound(
|
749
|
+
absl::string_view key) {
|
750
|
+
return container_->GetStringValueUnknown(key, backing_);
|
751
|
+
}
|
752
|
+
|
753
|
+
private:
|
754
|
+
const Container* const container_;
|
755
|
+
std::string* backing_;
|
756
|
+
};
|
757
|
+
|
758
|
+
// Sink for key value logs
|
759
|
+
using LogFn = absl::FunctionRef<void(absl::string_view, absl::string_view)>;
|
760
|
+
|
761
|
+
template <typename T>
|
762
|
+
struct AdaptDisplayValueToLog {
|
763
|
+
static std::string ToString(const T& value) { return absl::StrCat(value); }
|
764
|
+
};
|
765
|
+
|
766
|
+
template <>
|
767
|
+
struct AdaptDisplayValueToLog<Slice> {
|
768
|
+
static std::string ToString(Slice value) {
|
769
|
+
return std::string(value.as_string_view());
|
770
|
+
}
|
771
|
+
};
|
772
|
+
|
773
|
+
template <>
|
774
|
+
struct AdaptDisplayValueToLog<StaticSlice> {
|
775
|
+
static absl::string_view ToString(StaticSlice value) {
|
776
|
+
return value.as_string_view();
|
777
|
+
}
|
778
|
+
};
|
779
|
+
|
780
|
+
template <typename T, typename U, typename V>
|
781
|
+
GPR_ATTRIBUTE_NOINLINE void LogKeyValueTo(absl::string_view key, const T& value,
|
782
|
+
V (*display_value)(U), LogFn log_fn) {
|
783
|
+
log_fn(key, AdaptDisplayValueToLog<V>::ToString(display_value(value)));
|
784
|
+
}
|
785
|
+
|
786
|
+
// Generate a strong type for metadata values per trait.
|
787
|
+
template <typename Which, typename Ignored = void>
|
788
|
+
struct Value;
|
789
|
+
|
790
|
+
template <typename Which>
|
791
|
+
struct Value<Which, absl::enable_if_t<Which::kRepeatable == false &&
|
792
|
+
IsEncodableTrait<Which>::value,
|
793
|
+
void>> {
|
794
|
+
Value() = default;
|
795
|
+
explicit Value(const typename Which::ValueType& value) : value(value) {}
|
796
|
+
explicit Value(typename Which::ValueType&& value)
|
797
|
+
: value(std::forward<typename Which::ValueType>(value)) {}
|
798
|
+
Value(const Value&) = delete;
|
799
|
+
Value& operator=(const Value&) = delete;
|
800
|
+
Value(Value&&) noexcept = default;
|
801
|
+
Value& operator=(Value&& other) noexcept {
|
802
|
+
value = std::move(other.value);
|
803
|
+
return *this;
|
804
|
+
}
|
805
|
+
template <typename Encoder>
|
806
|
+
void EncodeTo(Encoder* encoder) const {
|
807
|
+
encoder->Encode(Which(), value);
|
808
|
+
}
|
809
|
+
void LogTo(LogFn log_fn) const {
|
810
|
+
LogKeyValueTo(Which::key(), value, Which::Encode, log_fn);
|
811
|
+
}
|
812
|
+
using StorageType = typename Which::ValueType;
|
813
|
+
GPR_NO_UNIQUE_ADDRESS StorageType value;
|
814
|
+
};
|
815
|
+
|
816
|
+
template <typename Which>
|
817
|
+
struct Value<Which, absl::enable_if_t<Which::kRepeatable == false &&
|
818
|
+
!IsEncodableTrait<Which>::value,
|
819
|
+
void>> {
|
820
|
+
Value() = default;
|
821
|
+
explicit Value(const typename Which::ValueType& value) : value(value) {}
|
822
|
+
explicit Value(typename Which::ValueType&& value)
|
823
|
+
: value(std::forward<typename Which::ValueType>(value)) {}
|
824
|
+
Value(const Value&) = delete;
|
825
|
+
Value& operator=(const Value&) = delete;
|
826
|
+
Value(Value&&) noexcept = default;
|
827
|
+
Value& operator=(Value&& other) noexcept {
|
828
|
+
value = std::move(other.value);
|
829
|
+
return *this;
|
830
|
+
}
|
831
|
+
template <typename Encoder>
|
832
|
+
void EncodeTo(Encoder*) const {}
|
833
|
+
void LogTo(LogFn log_fn) const {
|
834
|
+
LogKeyValueTo(Which::DebugKey(), value, Which::DisplayValue, log_fn);
|
835
|
+
}
|
836
|
+
using StorageType = typename Which::ValueType;
|
837
|
+
GPR_NO_UNIQUE_ADDRESS StorageType value;
|
838
|
+
};
|
839
|
+
|
840
|
+
template <typename Which>
|
841
|
+
struct Value<Which, absl::enable_if_t<Which::kRepeatable == true &&
|
842
|
+
IsEncodableTrait<Which>::value,
|
843
|
+
void>> {
|
844
|
+
Value() = default;
|
845
|
+
explicit Value(const typename Which::ValueType& value) {
|
846
|
+
this->value.push_back(value);
|
847
|
+
}
|
848
|
+
explicit Value(typename Which::ValueType&& value) {
|
849
|
+
this->value.emplace_back(std::forward<typename Which::ValueType>(value));
|
850
|
+
}
|
851
|
+
Value(const Value&) = delete;
|
852
|
+
Value& operator=(const Value&) = delete;
|
853
|
+
Value(Value&& other) noexcept : value(std::move(other.value)) {}
|
854
|
+
Value& operator=(Value&& other) noexcept {
|
855
|
+
value = std::move(other.value);
|
856
|
+
return *this;
|
857
|
+
}
|
858
|
+
template <typename Encoder>
|
859
|
+
void EncodeTo(Encoder* encoder) const {
|
860
|
+
for (const auto& v : value) {
|
861
|
+
encoder->Encode(Which(), v);
|
862
|
+
}
|
863
|
+
}
|
864
|
+
void LogTo(LogFn log_fn) const {
|
865
|
+
for (const auto& v : value) {
|
866
|
+
LogKeyValueTo(Which::key(), v, Which::Encode, log_fn);
|
867
|
+
}
|
868
|
+
}
|
869
|
+
using StorageType = absl::InlinedVector<typename Which::ValueType, 1>;
|
870
|
+
StorageType value;
|
871
|
+
};
|
872
|
+
|
873
|
+
template <typename Which>
|
874
|
+
struct Value<Which, absl::enable_if_t<Which::kRepeatable == true &&
|
875
|
+
!IsEncodableTrait<Which>::value,
|
876
|
+
void>> {
|
877
|
+
Value() = default;
|
878
|
+
explicit Value(const typename Which::ValueType& value) {
|
879
|
+
this->value.push_back(value);
|
880
|
+
}
|
881
|
+
explicit Value(typename Which::ValueType&& value) {
|
882
|
+
this->value.emplace_back(std::forward<typename Which::ValueType>(value));
|
883
|
+
}
|
884
|
+
Value(const Value&) = delete;
|
885
|
+
Value& operator=(const Value&) = delete;
|
886
|
+
Value(Value&& other) noexcept : value(std::move(other.value)) {}
|
887
|
+
Value& operator=(Value&& other) noexcept {
|
888
|
+
value = std::move(other.value);
|
889
|
+
return *this;
|
890
|
+
}
|
891
|
+
template <typename Encoder>
|
892
|
+
void EncodeTo(Encoder*) const {}
|
893
|
+
void LogTo(LogFn log_fn) const {
|
894
|
+
for (const auto& v : value) {
|
895
|
+
LogKeyValueTo(Which::DebugKey(), v, Which::DisplayValue, log_fn);
|
896
|
+
}
|
897
|
+
}
|
898
|
+
using StorageType = absl::InlinedVector<typename Which::ValueType, 1>;
|
899
|
+
StorageType value;
|
900
|
+
};
|
901
|
+
|
902
|
+
// Encoder to copy some metadata
|
903
|
+
template <typename Output>
|
904
|
+
class CopySink {
|
905
|
+
public:
|
906
|
+
explicit CopySink(Output* dst) : dst_(dst) {}
|
907
|
+
|
908
|
+
template <class T, class V>
|
909
|
+
void Encode(T trait, V value) {
|
910
|
+
dst_->Set(trait, value);
|
911
|
+
}
|
912
|
+
|
913
|
+
template <class T>
|
914
|
+
void Encode(T trait, const Slice& value) {
|
915
|
+
dst_->Set(trait, std::move(value.AsOwned()));
|
916
|
+
}
|
917
|
+
|
918
|
+
void Encode(const Slice& key, const Slice& value) {
|
919
|
+
dst_->AppendUnknown(key.as_string_view(), value.Ref());
|
920
|
+
}
|
921
|
+
|
922
|
+
private:
|
923
|
+
Output* dst_;
|
924
|
+
};
|
925
|
+
|
926
|
+
// Callable for the ForEach in Encode() -- for each value, call the
|
927
|
+
// appropriate encoder method.
|
928
|
+
template <typename Encoder>
|
929
|
+
struct EncodeWrapper {
|
930
|
+
Encoder* encoder;
|
931
|
+
template <typename Which>
|
932
|
+
void operator()(const Value<Which>& which) {
|
933
|
+
which.EncodeTo(encoder);
|
934
|
+
}
|
935
|
+
};
|
936
|
+
|
937
|
+
// Callable for the ForEach in Log()
|
938
|
+
struct LogWrapper {
|
939
|
+
LogFn log_fn;
|
940
|
+
template <typename Which>
|
941
|
+
void operator()(const Value<Which>& which) {
|
942
|
+
which.LogTo(log_fn);
|
943
|
+
}
|
944
|
+
};
|
945
|
+
|
946
|
+
// Encoder to compute TransportSize
|
947
|
+
class TransportSizeEncoder {
|
948
|
+
public:
|
949
|
+
void Encode(const Slice& key, const Slice& value) {
|
950
|
+
size_ += key.length() + value.length() + 32;
|
204
951
|
}
|
952
|
+
|
953
|
+
template <typename Which>
|
954
|
+
void Encode(Which, const typename Which::ValueType& value) {
|
955
|
+
Add(Which(), value);
|
956
|
+
}
|
957
|
+
|
958
|
+
void Encode(ContentTypeMetadata,
|
959
|
+
const typename ContentTypeMetadata::ValueType& value) {
|
960
|
+
if (value == ContentTypeMetadata::kInvalid) return;
|
961
|
+
Add(ContentTypeMetadata(), value);
|
962
|
+
}
|
963
|
+
|
964
|
+
size_t size() const { return size_; }
|
965
|
+
|
966
|
+
private:
|
967
|
+
template <typename Which>
|
968
|
+
void Add(Which, const typename Which::ValueType& value) {
|
969
|
+
size_ += Which::key().length() + Which::Encode(value).length() + 32;
|
970
|
+
}
|
971
|
+
|
972
|
+
uint32_t size_ = 0;
|
205
973
|
};
|
206
974
|
|
207
975
|
} // namespace metadata_detail
|
208
976
|
|
977
|
+
// Helper function for encoders
|
978
|
+
// Given a metadata trait, convert the value to a slice.
|
979
|
+
template <typename Which>
|
980
|
+
absl::enable_if_t<std::is_same<typename Which::ValueType, Slice>::value,
|
981
|
+
const Slice&>
|
982
|
+
MetadataValueAsSlice(const Slice& slice) {
|
983
|
+
return slice;
|
984
|
+
}
|
985
|
+
|
986
|
+
template <typename Which>
|
987
|
+
absl::enable_if_t<!std::is_same<typename Which::ValueType, Slice>::value, Slice>
|
988
|
+
MetadataValueAsSlice(typename Which::ValueType value) {
|
989
|
+
return Slice(Which::Encode(value));
|
990
|
+
}
|
991
|
+
|
209
992
|
// MetadataMap encodes the mapping of metadata keys to metadata values.
|
210
|
-
// Right now the API presented is the minimal one that will allow us to
|
211
|
-
// substitute this type for grpc_metadata_batch in a relatively easy fashion. At
|
212
|
-
// that point we'll start iterating this API into something that's ergonomic
|
213
|
-
// again, whilst minimally holding the performance bar already set (and
|
214
|
-
// hopefully improving some things).
|
215
|
-
// In the meantime, we're not going to invest much time in ephemeral API
|
216
|
-
// documentation, so if you must use one of these APIs and it's not obvious
|
217
|
-
// how, reach out to ctiller.
|
218
993
|
//
|
219
|
-
// MetadataMap takes a list of traits. Each of these trait
|
220
|
-
// one metadata field that is used by core, and so should have
|
221
|
-
// handling than just using the generic APIs.
|
994
|
+
// MetadataMap takes a derived class and list of traits. Each of these trait
|
995
|
+
// objects defines one metadata field that is used by core, and so should have
|
996
|
+
// more specialized handling than just using the generic APIs.
|
997
|
+
//
|
998
|
+
// MetadataMap is the backing type for some derived type via the curiously
|
999
|
+
// recursive template pattern. This is because many types consumed by
|
1000
|
+
// MetadataMap require the container type to operate on, and many of those
|
1001
|
+
// types are instantiated one per trait. A naive implementation without the
|
1002
|
+
// Derived type would, for traits A,B,C, then instantiate for some
|
1003
|
+
// T<Container, Trait>:
|
1004
|
+
// - T<MetadataMap<A,B,C>, A>,
|
1005
|
+
// - T<MetadataMap<A,B,C>, B>,
|
1006
|
+
// - T<MetadataMap<A,B,C>, C>.
|
1007
|
+
// Since these types ultimately need to be recorded in the .dynstr segment
|
1008
|
+
// for dynamic linkers (if gRPC is linked as a static library) this would
|
1009
|
+
// create O(N^2) bytes of symbols even in stripped libraries. To avoid this
|
1010
|
+
// we use the derived type (e.g. grpc_metadata_batch right now) to capture
|
1011
|
+
// the container type, and we would write T<grpc_metadata_batch, A>, etc...
|
1012
|
+
// Note that now the container type uses a number of bytes that is independent
|
1013
|
+
// of the number of traits, and so we return to a linear symbol table growth
|
1014
|
+
// function.
|
1015
|
+
//
|
1016
|
+
// Each trait object has one of two possible signatures, depending on whether
|
1017
|
+
// that traits field is encodable or not.
|
1018
|
+
// Non-encodable traits are carried in a MetadataMap, but are never passed to
|
1019
|
+
// the application nor serialized to wire.
|
222
1020
|
//
|
223
|
-
//
|
224
|
-
// // Traits for the grpc-xyz metadata field:
|
1021
|
+
// Encodable traits have the following signature:
|
1022
|
+
// // Traits for the "grpc-xyz" metadata field:
|
225
1023
|
// struct GrpcXyzMetadata {
|
1024
|
+
// // Can this metadata field be repeated?
|
1025
|
+
// static constexpr bool kRepeatable = ...;
|
226
1026
|
// // The type that's stored on MetadataBatch
|
227
1027
|
// using ValueType = ...;
|
228
1028
|
// // The type that's stored in compression/decompression tables
|
229
1029
|
// using MementoType = ...;
|
230
1030
|
// // The string key for this metadata type (for transports that require it)
|
231
|
-
// static
|
1031
|
+
// static absl::string_view key() { return "grpc-xyz"; }
|
232
1032
|
// // Parse a memento from a slice
|
233
1033
|
// // Takes ownership of value
|
234
|
-
//
|
1034
|
+
// // Calls fn in the case of an error that should be reported to the user
|
1035
|
+
// static MementoType ParseMemento(Slice value, MementoParseErrorFn fn) { ...
|
1036
|
+
// }
|
235
1037
|
// // Convert a memento to a value
|
236
1038
|
// static ValueType MementoToValue(MementoType memento) { ... }
|
237
1039
|
// // Convert a value to its canonical text wire format (the format that
|
238
1040
|
// // ParseMemento will accept!)
|
239
|
-
// static
|
1041
|
+
// static Slice Encode(const ValueType& value);
|
240
1042
|
// // Convert a value to something that can be passed to StrCat and displayed
|
241
1043
|
// // for debugging
|
242
1044
|
// static SomeStrCatableType DisplayValue(MementoType value) { ... }
|
243
1045
|
// };
|
244
1046
|
//
|
1047
|
+
// Non-encodable traits are determined by missing the key() method, and have the
|
1048
|
+
// following signature (and by convention omit the Metadata part of the type
|
1049
|
+
// name):
|
1050
|
+
// // Traits for the GrpcXyz field:
|
1051
|
+
// struct GrpcXyz {
|
1052
|
+
// // The string key that should be used for debug dumps - should not be a
|
1053
|
+
// // valid http2 key (ie all lower case)
|
1054
|
+
// static absl::string_view DebugKey() { return "GRPC_XYZ"; }
|
1055
|
+
// // Can this metadata field be repeated?
|
1056
|
+
// static constexpr bool kRepeatable = ...;
|
1057
|
+
// // The type that's stored on MetadataBatch
|
1058
|
+
// using ValueType = ...;
|
1059
|
+
// // Convert a value to something that can be passed to StrCat and displayed
|
1060
|
+
// // for debugging
|
1061
|
+
// static SomeStrCatableType DisplayValue(ValueType value) { ... }
|
1062
|
+
// };
|
1063
|
+
//
|
245
1064
|
// About parsing and mementos:
|
246
1065
|
//
|
247
1066
|
// Many gRPC transports exchange metadata as key/value strings, but also allow
|
@@ -261,7 +1080,7 @@ struct AppendHelper<Container> {
|
|
261
1080
|
// for grpc-timeout we make the memento the timeout expressed on the wire, but
|
262
1081
|
// we make the value the timestamp of when the timeout will expire (i.e. the
|
263
1082
|
// deadline).
|
264
|
-
template <typename... Traits>
|
1083
|
+
template <class Derived, typename... Traits>
|
265
1084
|
class MetadataMap {
|
266
1085
|
public:
|
267
1086
|
explicit MetadataMap(Arena* arena);
|
@@ -270,7 +1089,10 @@ class MetadataMap {
|
|
270
1089
|
MetadataMap(const MetadataMap&) = delete;
|
271
1090
|
MetadataMap& operator=(const MetadataMap&) = delete;
|
272
1091
|
MetadataMap(MetadataMap&&) noexcept;
|
273
|
-
|
1092
|
+
// We never create MetadataMap directly, instead we create Derived, but we
|
1093
|
+
// want to be able to move it without redeclaring this.
|
1094
|
+
// NOLINTNEXTLINE(misc-unconventional-assign-operator)
|
1095
|
+
Derived& operator=(MetadataMap&&) noexcept;
|
274
1096
|
|
275
1097
|
// Encode this metadata map into some encoder.
|
276
1098
|
// For each field that is set in the MetadataMap, call
|
@@ -287,17 +1109,36 @@ class MetadataMap {
|
|
287
1109
|
// transitions.
|
288
1110
|
template <typename Encoder>
|
289
1111
|
void Encode(Encoder* encoder) const {
|
290
|
-
|
291
|
-
|
1112
|
+
table_.ForEach(metadata_detail::EncodeWrapper<Encoder>{encoder});
|
1113
|
+
for (const auto& unk : unknown_) {
|
1114
|
+
encoder->Encode(unk.first, unk.second);
|
1115
|
+
}
|
1116
|
+
}
|
1117
|
+
|
1118
|
+
// Similar to Encode, but targeted at logging: for each metadatum,
|
1119
|
+
// call f(key, value) as absl::string_views.
|
1120
|
+
void Log(metadata_detail::LogFn log_fn) const {
|
1121
|
+
table_.ForEach(metadata_detail::LogWrapper{log_fn});
|
1122
|
+
for (const auto& unk : unknown_) {
|
1123
|
+
log_fn(unk.first.as_string_view(), unk.second.as_string_view());
|
292
1124
|
}
|
293
|
-
|
1125
|
+
}
|
1126
|
+
|
1127
|
+
std::string DebugString() const {
|
1128
|
+
std::string out;
|
1129
|
+
Log([&out](absl::string_view key, absl::string_view value) {
|
1130
|
+
if (!out.empty()) out.append(", ");
|
1131
|
+
absl::StrAppend(&out, absl::CEscape(key), ": ", absl::CEscape(value));
|
1132
|
+
});
|
1133
|
+
return out;
|
294
1134
|
}
|
295
1135
|
|
296
1136
|
// Get the pointer to the value of some known metadata.
|
297
1137
|
// Returns nullptr if the metadata is not present.
|
298
1138
|
// Causes a compilation error if Which is not an element of Traits.
|
299
1139
|
template <typename Which>
|
300
|
-
const typename Which
|
1140
|
+
const typename metadata_detail::Value<Which>::StorageType* get_pointer(
|
1141
|
+
Which) const {
|
301
1142
|
if (auto* p = table_.template get<Value<Which>>()) return &p->value;
|
302
1143
|
return nullptr;
|
303
1144
|
}
|
@@ -306,11 +1147,20 @@ class MetadataMap {
|
|
306
1147
|
// Returns nullptr if the metadata is not present.
|
307
1148
|
// Causes a compilation error if Which is not an element of Traits.
|
308
1149
|
template <typename Which>
|
309
|
-
typename Which
|
1150
|
+
typename metadata_detail::Value<Which>::StorageType* get_pointer(Which) {
|
310
1151
|
if (auto* p = table_.template get<Value<Which>>()) return &p->value;
|
311
1152
|
return nullptr;
|
312
1153
|
}
|
313
1154
|
|
1155
|
+
// Get the pointer to the value of some known metadata.
|
1156
|
+
// Adds the default value for the metadata is not present.
|
1157
|
+
// Causes a compilation error if Which is not an element of Traits.
|
1158
|
+
template <typename Which>
|
1159
|
+
typename metadata_detail::Value<Which>::StorageType* GetOrCreatePointer(
|
1160
|
+
Which) {
|
1161
|
+
return &table_.template get_or_create<Value<Which>>()->value;
|
1162
|
+
}
|
1163
|
+
|
314
1164
|
// Get the value of some known metadata.
|
315
1165
|
// Returns nullopt if the metadata is not present.
|
316
1166
|
// Causes a compilation error if Which is not an element of Traits.
|
@@ -323,9 +1173,14 @@ class MetadataMap {
|
|
323
1173
|
// Set the value of some known metadata.
|
324
1174
|
// Returns a pointer to the new value.
|
325
1175
|
template <typename Which, typename... Args>
|
326
|
-
|
327
|
-
|
328
|
-
|
1176
|
+
absl::enable_if_t<Which::kRepeatable == false, void> Set(Which,
|
1177
|
+
Args&&... args) {
|
1178
|
+
table_.template set<Value<Which>>(std::forward<Args>(args)...);
|
1179
|
+
}
|
1180
|
+
template <typename Which, typename... Args>
|
1181
|
+
absl::enable_if_t<Which::kRepeatable == true, void> Set(Which,
|
1182
|
+
Args&&... args) {
|
1183
|
+
GetOrCreatePointer(Which())->emplace_back(std::forward<Args>(args)...);
|
329
1184
|
}
|
330
1185
|
|
331
1186
|
// Remove a specific piece of known metadata.
|
@@ -334,722 +1189,202 @@ class MetadataMap {
|
|
334
1189
|
table_.template clear<Value<Which>>();
|
335
1190
|
}
|
336
1191
|
|
1192
|
+
// Remove some metadata by name
|
1193
|
+
void Remove(absl::string_view key) {
|
1194
|
+
metadata_detail::RemoveHelper<Derived> helper(static_cast<Derived*>(this));
|
1195
|
+
metadata_detail::NameLookup<void, Traits...>::Lookup(key, &helper);
|
1196
|
+
}
|
1197
|
+
|
1198
|
+
void Remove(const char* key) { Remove(absl::string_view(key)); }
|
1199
|
+
|
1200
|
+
// Retrieve some metadata by name
|
1201
|
+
absl::optional<absl::string_view> GetStringValue(absl::string_view name,
|
1202
|
+
std::string* buffer) const {
|
1203
|
+
metadata_detail::GetStringValueHelper<Derived> helper(
|
1204
|
+
static_cast<const Derived*>(this), buffer);
|
1205
|
+
return metadata_detail::NameLookup<void, Traits...>::Lookup(name, &helper);
|
1206
|
+
}
|
1207
|
+
|
337
1208
|
// Extract a piece of known metadata.
|
338
1209
|
// Returns nullopt if the metadata was not present, or the value if it was.
|
339
1210
|
// The same as:
|
340
1211
|
// auto value = m.get(T());
|
341
1212
|
// m.Remove(T());
|
342
1213
|
template <typename Which>
|
343
|
-
absl::
|
344
|
-
|
345
|
-
|
346
|
-
|
1214
|
+
absl::enable_if_t<Which::kRepeatable == false,
|
1215
|
+
absl::optional<typename Which::ValueType>>
|
1216
|
+
Take(Which which) {
|
1217
|
+
if (auto* p = get_pointer(which)) {
|
1218
|
+
absl::optional<typename Which::ValueType> value(std::move(*p));
|
1219
|
+
Remove(which);
|
1220
|
+
return value;
|
1221
|
+
}
|
1222
|
+
return {};
|
1223
|
+
}
|
1224
|
+
|
1225
|
+
// Extract repeated known metadata.
|
1226
|
+
// Returns an empty vector if the metadata was not present.
|
1227
|
+
template <typename Which>
|
1228
|
+
absl::enable_if_t<Which::kRepeatable == true,
|
1229
|
+
typename metadata_detail::Value<Which>::StorageType>
|
1230
|
+
Take(Which which) {
|
1231
|
+
if (auto* p = get_pointer(which)) {
|
1232
|
+
typename Value<Which>::StorageType value = std::move(*p);
|
1233
|
+
Remove(which);
|
1234
|
+
return value;
|
1235
|
+
}
|
1236
|
+
return {};
|
347
1237
|
}
|
348
1238
|
|
349
1239
|
// Parse metadata from a key/value pair, and return an object representing
|
350
1240
|
// that result.
|
351
1241
|
// TODO(ctiller): key should probably be an absl::string_view.
|
352
1242
|
// Once we don't care about interning anymore, make that change!
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
parsed = false;
|
360
|
-
return ParsedMetadata<MetadataMap>(
|
361
|
-
grpc_mdelem_from_slices(key, value));
|
362
|
-
});
|
363
|
-
if (parsed) {
|
364
|
-
grpc_slice_unref_internal(key);
|
365
|
-
}
|
366
|
-
return out;
|
1243
|
+
static ParsedMetadata<Derived> Parse(absl::string_view key, Slice value,
|
1244
|
+
uint32_t transport_size,
|
1245
|
+
MetadataParseErrorFn on_error) {
|
1246
|
+
metadata_detail::ParseHelper<Derived> helper(value.TakeOwned(), on_error,
|
1247
|
+
transport_size);
|
1248
|
+
return metadata_detail::NameLookup<void, Traits...>::Lookup(key, &helper);
|
367
1249
|
}
|
368
1250
|
|
369
1251
|
// Set a value from a parsed metadata object.
|
370
|
-
|
371
|
-
|
372
|
-
return m.SetOnContainer(this);
|
1252
|
+
void Set(const ParsedMetadata<Derived>& m) {
|
1253
|
+
m.SetOnContainer(static_cast<Derived*>(this));
|
373
1254
|
}
|
374
1255
|
|
375
1256
|
// Append a key/value pair - takes ownership of value
|
376
|
-
void Append(absl::string_view key,
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
grpc_slice_intern(grpc_slice_from_static_buffer(
|
382
|
-
key.data(), key.length())),
|
383
|
-
value)));
|
384
|
-
});
|
385
|
-
}
|
386
|
-
|
387
|
-
//
|
388
|
-
// All APIs below this point are subject to change.
|
389
|
-
//
|
390
|
-
|
391
|
-
template <typename F>
|
392
|
-
void ForEach(F f) const {
|
393
|
-
for (auto* l = list_.head; l; l = l->next) {
|
394
|
-
f(l->md);
|
395
|
-
}
|
396
|
-
}
|
397
|
-
|
398
|
-
template <typename F>
|
399
|
-
grpc_error_handle Filter(F f, const char* composite_error_string) {
|
400
|
-
grpc_linked_mdelem* l = list_.head;
|
401
|
-
grpc_error_handle error = GRPC_ERROR_NONE;
|
402
|
-
auto add_error = [&](grpc_error_handle new_error) {
|
403
|
-
if (new_error == GRPC_ERROR_NONE) return;
|
404
|
-
if (error == GRPC_ERROR_NONE) {
|
405
|
-
error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(composite_error_string);
|
406
|
-
}
|
407
|
-
error = grpc_error_add_child(error, new_error);
|
408
|
-
};
|
409
|
-
while (l) {
|
410
|
-
grpc_linked_mdelem* next = l->next;
|
411
|
-
grpc_filtered_mdelem new_mdelem = f(l->md);
|
412
|
-
add_error(new_mdelem.error);
|
413
|
-
if (GRPC_MDISNULL(new_mdelem.md)) {
|
414
|
-
Remove(l);
|
415
|
-
} else if (new_mdelem.md.payload != l->md.payload) {
|
416
|
-
add_error(Substitute(l, new_mdelem.md));
|
417
|
-
}
|
418
|
-
l = next;
|
419
|
-
}
|
420
|
-
return error;
|
1257
|
+
void Append(absl::string_view key, Slice value,
|
1258
|
+
MetadataParseErrorFn on_error) {
|
1259
|
+
metadata_detail::AppendHelper<Derived> helper(static_cast<Derived*>(this),
|
1260
|
+
value.TakeOwned(), on_error);
|
1261
|
+
metadata_detail::NameLookup<void, Traits...>::Lookup(key, &helper);
|
421
1262
|
}
|
422
1263
|
|
423
|
-
GRPC_MUST_USE_RESULT grpc_error_handle Append(grpc_mdelem md) {
|
424
|
-
return AddTail(elem_storage_.EmplaceBack(), md);
|
425
|
-
}
|
426
|
-
|
427
|
-
GRPC_MUST_USE_RESULT grpc_error_handle ReplaceOrAppend(grpc_slice key,
|
428
|
-
grpc_slice value) {
|
429
|
-
if (ReplaceIfExists(key, value)) return GRPC_ERROR_NONE;
|
430
|
-
return Append(grpc_mdelem_from_slices(key, value));
|
431
|
-
}
|
432
|
-
|
433
|
-
// Set key to value if it exists and return true, otherwise return false.
|
434
|
-
// If this function returns true, it takes ownership of key and value.
|
435
|
-
// If this function returns false, it does not take ownership of key nor
|
436
|
-
// value.
|
437
|
-
bool ReplaceIfExists(grpc_slice key, grpc_slice value);
|
438
|
-
|
439
1264
|
void Clear();
|
440
|
-
bool empty() const { return count() == 0; }
|
441
|
-
|
442
|
-
size_t count() const { return list_.count + table_.count(); }
|
443
|
-
size_t non_deadline_count() const { return list_.count; }
|
444
|
-
size_t default_count() const { return list_.default_count; }
|
445
|
-
|
446
1265
|
size_t TransportSize() const;
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
absl::optional<grpc_slice> Remove(grpc_slice key);
|
452
|
-
|
453
|
-
grpc_error_handle Substitute(grpc_linked_mdelem* storage,
|
454
|
-
grpc_mdelem new_mdelem);
|
455
|
-
|
456
|
-
absl::optional<absl::string_view> GetValue(
|
457
|
-
absl::string_view target_key, std::string* concatenated_value) const;
|
458
|
-
|
459
|
-
grpc_error_handle LinkHead(grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT;
|
460
|
-
grpc_error_handle LinkHead(grpc_linked_mdelem* storage,
|
461
|
-
grpc_metadata_batch_callouts_index idx)
|
462
|
-
GRPC_MUST_USE_RESULT;
|
463
|
-
grpc_error_handle LinkTail(grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT;
|
464
|
-
grpc_error_handle LinkTail(grpc_linked_mdelem* storage,
|
465
|
-
grpc_metadata_batch_callouts_index idx)
|
466
|
-
GRPC_MUST_USE_RESULT;
|
467
|
-
|
468
|
-
grpc_error_handle AddHead(grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT;
|
469
|
-
grpc_error_handle AddHead(grpc_linked_mdelem* storage,
|
470
|
-
grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT;
|
471
|
-
grpc_error_handle AddTail(grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT;
|
472
|
-
grpc_error_handle AddTail(grpc_linked_mdelem* storage,
|
473
|
-
grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT;
|
474
|
-
|
475
|
-
void CopyFrom(MetadataMap* src, grpc_linked_mdelem* storage);
|
476
|
-
|
477
|
-
#ifndef NDEBUG
|
478
|
-
void AssertOk();
|
479
|
-
#else
|
480
|
-
void AssertOk() {}
|
481
|
-
#endif
|
482
|
-
|
483
|
-
// TODO(ctiller): the following explicit deadline handling methods are
|
484
|
-
// deprecated in terms of the traits based APIs.
|
485
|
-
grpc_millis deadline() const {
|
486
|
-
return get(GrpcTimeoutMetadata()).value_or(GRPC_MILLIS_INF_FUTURE);
|
487
|
-
};
|
488
|
-
|
489
|
-
const grpc_metadata_batch_callouts* legacy_index() const { return &idx_; }
|
1266
|
+
Derived Copy() const;
|
1267
|
+
bool empty() const { return table_.empty() && unknown_.empty(); }
|
1268
|
+
size_t count() const { return table_.count() + unknown_.size(); }
|
490
1269
|
|
491
1270
|
private:
|
492
|
-
|
1271
|
+
friend class metadata_detail::AppendHelper<Derived>;
|
1272
|
+
friend class metadata_detail::GetStringValueHelper<Derived>;
|
1273
|
+
friend class metadata_detail::RemoveHelper<Derived>;
|
1274
|
+
friend class metadata_detail::CopySink<Derived>;
|
1275
|
+
friend class ParsedMetadata<Derived>;
|
1276
|
+
|
493
1277
|
template <typename Which>
|
494
|
-
|
495
|
-
Value() = default;
|
496
|
-
explicit Value(const typename Which::ValueType& value) : value(value) {}
|
497
|
-
Value(const Value&) = default;
|
498
|
-
Value& operator=(const Value&) = default;
|
499
|
-
Value(Value&&) noexcept = default;
|
500
|
-
Value& operator=(Value&&) noexcept = default;
|
501
|
-
GPR_NO_UNIQUE_ADDRESS typename Which::ValueType value;
|
502
|
-
};
|
503
|
-
// Callable for the ForEach in Encode() -- for each value, call the
|
504
|
-
// appropriate encoder method.
|
505
|
-
template <typename Encoder>
|
506
|
-
struct EncodeWrapper {
|
507
|
-
Encoder* encoder;
|
508
|
-
template <typename Which>
|
509
|
-
void operator()(const Value<Which>& which) {
|
510
|
-
encoder->Encode(Which(), which.value);
|
511
|
-
}
|
512
|
-
};
|
1278
|
+
using Value = metadata_detail::Value<Which>;
|
513
1279
|
|
514
|
-
void
|
515
|
-
|
516
|
-
grpc_metadata_batch_callouts_index idx)
|
517
|
-
GRPC_MUST_USE_RESULT;
|
518
|
-
grpc_error_handle MaybeLinkCallout(grpc_linked_mdelem* storage)
|
519
|
-
GRPC_MUST_USE_RESULT;
|
520
|
-
void MaybeUnlinkCallout(grpc_linked_mdelem* storage);
|
521
|
-
|
522
|
-
static void assert_valid_list(grpc_mdelem_list* list) {
|
523
|
-
#ifndef NDEBUG
|
524
|
-
grpc_linked_mdelem* l;
|
525
|
-
|
526
|
-
GPR_ASSERT((list->head == nullptr) == (list->tail == nullptr));
|
527
|
-
if (!list->head) return;
|
528
|
-
GPR_ASSERT(list->head->prev == nullptr);
|
529
|
-
GPR_ASSERT(list->tail->next == nullptr);
|
530
|
-
GPR_ASSERT((list->head == list->tail) == (list->head->next == nullptr));
|
531
|
-
|
532
|
-
size_t verified_count = 0;
|
533
|
-
for (l = list->head; l; l = l->next) {
|
534
|
-
GPR_ASSERT(!GRPC_MDISNULL(l->md));
|
535
|
-
GPR_ASSERT((l->prev == nullptr) == (l == list->head));
|
536
|
-
GPR_ASSERT((l->next == nullptr) == (l == list->tail));
|
537
|
-
if (l->next) GPR_ASSERT(l->next->prev == l);
|
538
|
-
if (l->prev) GPR_ASSERT(l->prev->next == l);
|
539
|
-
verified_count++;
|
540
|
-
}
|
541
|
-
GPR_ASSERT(list->count == verified_count);
|
542
|
-
#else
|
543
|
-
// Avoid unused-parameter warning for debug-only parameter
|
544
|
-
(void)list;
|
545
|
-
#endif /* NDEBUG */
|
546
|
-
}
|
547
|
-
|
548
|
-
static grpc_error_handle GPR_ATTRIBUTE_NOINLINE
|
549
|
-
error_with_md(grpc_mdelem md) {
|
550
|
-
return grpc_attach_md_to_error(
|
551
|
-
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unallowed duplicate metadata"),
|
552
|
-
md);
|
553
|
-
}
|
554
|
-
|
555
|
-
static void link_head(grpc_mdelem_list* list, grpc_linked_mdelem* storage) {
|
556
|
-
assert_valid_list(list);
|
557
|
-
GPR_DEBUG_ASSERT(!GRPC_MDISNULL(storage->md));
|
558
|
-
storage->prev = nullptr;
|
559
|
-
storage->next = list->head;
|
560
|
-
storage->reserved = nullptr;
|
561
|
-
if (list->head != nullptr) {
|
562
|
-
list->head->prev = storage;
|
563
|
-
} else {
|
564
|
-
list->tail = storage;
|
565
|
-
}
|
566
|
-
list->head = storage;
|
567
|
-
list->count++;
|
568
|
-
assert_valid_list(list);
|
569
|
-
}
|
570
|
-
|
571
|
-
static void link_tail(grpc_mdelem_list* list, grpc_linked_mdelem* storage) {
|
572
|
-
assert_valid_list(list);
|
573
|
-
GPR_DEBUG_ASSERT(!GRPC_MDISNULL(storage->md));
|
574
|
-
storage->prev = list->tail;
|
575
|
-
storage->next = nullptr;
|
576
|
-
storage->reserved = nullptr;
|
577
|
-
if (list->tail != nullptr) {
|
578
|
-
list->tail->next = storage;
|
579
|
-
} else {
|
580
|
-
list->head = storage;
|
581
|
-
}
|
582
|
-
list->tail = storage;
|
583
|
-
list->count++;
|
584
|
-
assert_valid_list(list);
|
1280
|
+
void AppendUnknown(absl::string_view key, Slice value) {
|
1281
|
+
unknown_.EmplaceBack(Slice::FromCopiedString(key), value.Ref());
|
585
1282
|
}
|
586
1283
|
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
1284
|
+
void RemoveUnknown(absl::string_view key) {
|
1285
|
+
unknown_.SetEnd(std::remove_if(unknown_.begin(), unknown_.end(),
|
1286
|
+
[key](const std::pair<Slice, Slice>& p) {
|
1287
|
+
return p.first.as_string_view() == key;
|
1288
|
+
}));
|
1289
|
+
}
|
1290
|
+
|
1291
|
+
absl::optional<absl::string_view> GetStringValueUnknown(
|
1292
|
+
absl::string_view key, std::string* backing) const {
|
1293
|
+
absl::optional<absl::string_view> out;
|
1294
|
+
for (const auto& p : unknown_) {
|
1295
|
+
if (p.first.as_string_view() == key) {
|
1296
|
+
if (!out.has_value()) {
|
1297
|
+
out = p.second.as_string_view();
|
1298
|
+
} else {
|
1299
|
+
out = *backing = absl::StrCat(*out, ",", p.second.as_string_view());
|
1300
|
+
}
|
1301
|
+
}
|
599
1302
|
}
|
600
|
-
|
601
|
-
assert_valid_list(list);
|
1303
|
+
return out;
|
602
1304
|
}
|
603
1305
|
|
604
1306
|
// Table of known metadata types.
|
605
1307
|
Table<Value<Traits>...> table_;
|
606
|
-
/** Metadata elements in this batch */
|
607
|
-
grpc_mdelem_list list_;
|
608
|
-
grpc_metadata_batch_callouts idx_;
|
609
1308
|
// Backing store for added metadata.
|
610
|
-
ChunkedVector<
|
1309
|
+
ChunkedVector<std::pair<Slice, Slice>, 10> unknown_;
|
611
1310
|
};
|
612
1311
|
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
GRPC_BATCH_INDEX_OF(key_interned);
|
620
|
-
if (callout_idx != GRPC_BATCH_CALLOUTS_COUNT) {
|
621
|
-
GPR_ASSERT(idx_.array[callout_idx] == l);
|
622
|
-
}
|
623
|
-
grpc_slice_unref_internal(key_interned);
|
624
|
-
}
|
625
|
-
#endif
|
626
|
-
}
|
627
|
-
|
628
|
-
#ifndef NDEBUG
|
629
|
-
template <typename... Traits>
|
630
|
-
void MetadataMap<Traits...>::AssertOk() {
|
631
|
-
assert_valid_list(&list_);
|
1312
|
+
// Ok/not-ok check for metadata maps that contain GrpcStatusMetadata, so that
|
1313
|
+
// they can be used as result types for TrySeq.
|
1314
|
+
template <typename Derived, typename... Args>
|
1315
|
+
inline bool IsStatusOk(const MetadataMap<Derived, Args...>& m) {
|
1316
|
+
return m.get(GrpcStatusMetadata()).value_or(GRPC_STATUS_UNKNOWN) ==
|
1317
|
+
GRPC_STATUS_OK;
|
632
1318
|
}
|
633
|
-
#endif /* NDEBUG */
|
634
1319
|
|
635
|
-
template <typename... Traits>
|
636
|
-
MetadataMap<Traits...>::MetadataMap(Arena* arena) :
|
637
|
-
memset(&list_, 0, sizeof(list_));
|
638
|
-
memset(&idx_, 0, sizeof(idx_));
|
639
|
-
}
|
1320
|
+
template <typename Derived, typename... Traits>
|
1321
|
+
MetadataMap<Derived, Traits...>::MetadataMap(Arena* arena) : unknown_(arena) {}
|
640
1322
|
|
641
|
-
template <typename... Traits>
|
642
|
-
MetadataMap<Traits...>::MetadataMap(MetadataMap&& other) noexcept
|
643
|
-
: table_(std::move(other.table_)) {
|
644
|
-
list_ = other.list_;
|
645
|
-
idx_ = other.idx_;
|
646
|
-
memset(&other.list_, 0, sizeof(list_));
|
647
|
-
memset(&other.idx_, 0, sizeof(idx_));
|
648
|
-
}
|
1323
|
+
template <typename Derived, typename... Traits>
|
1324
|
+
MetadataMap<Derived, Traits...>::MetadataMap(MetadataMap&& other) noexcept
|
1325
|
+
: table_(std::move(other.table_)), unknown_(std::move(other.unknown_)) {}
|
649
1326
|
|
650
|
-
|
651
|
-
|
1327
|
+
// We never create MetadataMap directly, instead we create Derived, but we want
|
1328
|
+
// to be able to move it without redeclaring this.
|
1329
|
+
// NOLINTNEXTLINE(misc-unconventional-assign-operator)
|
1330
|
+
template <typename Derived, typename... Traits>
|
1331
|
+
Derived& MetadataMap<Derived, Traits...>::operator=(
|
652
1332
|
MetadataMap&& other) noexcept {
|
653
|
-
Clear();
|
654
1333
|
table_ = std::move(other.table_);
|
655
|
-
|
656
|
-
|
657
|
-
memset(&other.list_, 0, sizeof(list_));
|
658
|
-
memset(&other.idx_, 0, sizeof(idx_));
|
659
|
-
return *this;
|
660
|
-
}
|
661
|
-
|
662
|
-
template <typename... Traits>
|
663
|
-
MetadataMap<Traits...>::~MetadataMap() {
|
664
|
-
AssertValidCallouts();
|
665
|
-
for (auto* l = list_.head; l; l = l->next) {
|
666
|
-
GRPC_MDELEM_UNREF(l->md);
|
667
|
-
}
|
668
|
-
}
|
669
|
-
|
670
|
-
template <typename... Traits>
|
671
|
-
absl::optional<grpc_slice> MetadataMap<Traits...>::Remove(grpc_slice key) {
|
672
|
-
for (auto* l = list_.head; l; l = l->next) {
|
673
|
-
if (grpc_slice_eq(GRPC_MDKEY(l->md), key)) {
|
674
|
-
auto out = grpc_slice_ref_internal(GRPC_MDVALUE(l->md));
|
675
|
-
Remove(l);
|
676
|
-
return out;
|
677
|
-
}
|
678
|
-
}
|
679
|
-
return {};
|
680
|
-
}
|
681
|
-
|
682
|
-
template <typename... Traits>
|
683
|
-
grpc_error_handle MetadataMap<Traits...>::LinkCallout(
|
684
|
-
grpc_linked_mdelem* storage, grpc_metadata_batch_callouts_index idx) {
|
685
|
-
AssertValidCallouts();
|
686
|
-
GPR_DEBUG_ASSERT(idx >= 0 && idx < GRPC_BATCH_CALLOUTS_COUNT);
|
687
|
-
if (GPR_LIKELY(idx_.array[idx] == nullptr)) {
|
688
|
-
++list_.default_count;
|
689
|
-
idx_.array[idx] = storage;
|
690
|
-
AssertValidCallouts();
|
691
|
-
return GRPC_ERROR_NONE;
|
692
|
-
}
|
693
|
-
AssertValidCallouts();
|
694
|
-
return error_with_md(storage->md);
|
695
|
-
}
|
696
|
-
|
697
|
-
template <typename... Traits>
|
698
|
-
grpc_error_handle MetadataMap<Traits...>::MaybeLinkCallout(
|
699
|
-
grpc_linked_mdelem* storage) {
|
700
|
-
grpc_metadata_batch_callouts_index idx =
|
701
|
-
GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md));
|
702
|
-
if (idx == GRPC_BATCH_CALLOUTS_COUNT) {
|
703
|
-
return GRPC_ERROR_NONE;
|
704
|
-
}
|
705
|
-
return LinkCallout(storage, idx);
|
706
|
-
}
|
707
|
-
|
708
|
-
template <typename... Traits>
|
709
|
-
void MetadataMap<Traits...>::MaybeUnlinkCallout(grpc_linked_mdelem* storage) {
|
710
|
-
grpc_metadata_batch_callouts_index idx =
|
711
|
-
GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md));
|
712
|
-
if (idx == GRPC_BATCH_CALLOUTS_COUNT) {
|
713
|
-
return;
|
714
|
-
}
|
715
|
-
--list_.default_count;
|
716
|
-
GPR_DEBUG_ASSERT(idx_.array[idx] != nullptr);
|
717
|
-
idx_.array[idx] = nullptr;
|
718
|
-
}
|
719
|
-
|
720
|
-
template <typename... Traits>
|
721
|
-
grpc_error_handle MetadataMap<Traits...>::AddHead(grpc_linked_mdelem* storage,
|
722
|
-
grpc_mdelem elem_to_add) {
|
723
|
-
GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
|
724
|
-
storage->md = elem_to_add;
|
725
|
-
return LinkHead(storage);
|
726
|
-
}
|
727
|
-
|
728
|
-
template <typename... Traits>
|
729
|
-
grpc_error_handle MetadataMap<Traits...>::LinkHead(
|
730
|
-
grpc_linked_mdelem* storage) {
|
731
|
-
AssertValidCallouts();
|
732
|
-
grpc_error_handle err = MaybeLinkCallout(storage);
|
733
|
-
if (err != GRPC_ERROR_NONE) {
|
734
|
-
AssertValidCallouts();
|
735
|
-
return err;
|
736
|
-
}
|
737
|
-
link_head(&list_, storage);
|
738
|
-
AssertValidCallouts();
|
739
|
-
return GRPC_ERROR_NONE;
|
740
|
-
}
|
741
|
-
|
742
|
-
// TODO(arjunroy): Need to revisit this and see what guarantees exist between
|
743
|
-
// C-core and the internal-metadata subsystem. E.g. can we ensure a particular
|
744
|
-
// metadata is never added twice, even in the presence of user supplied data?
|
745
|
-
template <typename... Traits>
|
746
|
-
grpc_error_handle MetadataMap<Traits...>::LinkHead(
|
747
|
-
grpc_linked_mdelem* storage, grpc_metadata_batch_callouts_index idx) {
|
748
|
-
GPR_DEBUG_ASSERT(GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md)) == idx);
|
749
|
-
AssertValidCallouts();
|
750
|
-
grpc_error_handle err = LinkCallout(storage, idx);
|
751
|
-
if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) {
|
752
|
-
AssertValidCallouts();
|
753
|
-
return err;
|
754
|
-
}
|
755
|
-
link_head(&list_, storage);
|
756
|
-
AssertValidCallouts();
|
757
|
-
return GRPC_ERROR_NONE;
|
758
|
-
}
|
759
|
-
|
760
|
-
template <typename... Traits>
|
761
|
-
grpc_error_handle MetadataMap<Traits...>::AddTail(grpc_linked_mdelem* storage,
|
762
|
-
grpc_mdelem elem_to_add) {
|
763
|
-
GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
|
764
|
-
storage->md = elem_to_add;
|
765
|
-
return LinkTail(storage);
|
766
|
-
}
|
767
|
-
|
768
|
-
template <typename... Traits>
|
769
|
-
grpc_error_handle MetadataMap<Traits...>::LinkTail(
|
770
|
-
grpc_linked_mdelem* storage) {
|
771
|
-
AssertValidCallouts();
|
772
|
-
grpc_error_handle err = MaybeLinkCallout(storage);
|
773
|
-
if (err != GRPC_ERROR_NONE) {
|
774
|
-
AssertValidCallouts();
|
775
|
-
return err;
|
776
|
-
}
|
777
|
-
link_tail(&list_, storage);
|
778
|
-
AssertValidCallouts();
|
779
|
-
return GRPC_ERROR_NONE;
|
1334
|
+
unknown_ = std::move(other.unknown_);
|
1335
|
+
return static_cast<Derived&>(*this);
|
780
1336
|
}
|
781
1337
|
|
782
|
-
template <typename... Traits>
|
783
|
-
|
784
|
-
grpc_linked_mdelem* storage, grpc_metadata_batch_callouts_index idx) {
|
785
|
-
GPR_DEBUG_ASSERT(GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md)) == idx);
|
786
|
-
AssertValidCallouts();
|
787
|
-
grpc_error_handle err = LinkCallout(storage, idx);
|
788
|
-
if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) {
|
789
|
-
AssertValidCallouts();
|
790
|
-
return err;
|
791
|
-
}
|
792
|
-
link_tail(&list_, storage);
|
793
|
-
AssertValidCallouts();
|
794
|
-
return GRPC_ERROR_NONE;
|
795
|
-
}
|
796
|
-
|
797
|
-
template <typename... Traits>
|
798
|
-
void MetadataMap<Traits...>::Remove(grpc_linked_mdelem* storage) {
|
799
|
-
AssertValidCallouts();
|
800
|
-
MaybeUnlinkCallout(storage);
|
801
|
-
unlink_storage(&list_, storage);
|
802
|
-
GRPC_MDELEM_UNREF(storage->md);
|
803
|
-
AssertValidCallouts();
|
804
|
-
}
|
1338
|
+
template <typename Derived, typename... Traits>
|
1339
|
+
MetadataMap<Derived, Traits...>::~MetadataMap() = default;
|
805
1340
|
|
806
|
-
template <typename... Traits>
|
807
|
-
void MetadataMap<Traits...>::
|
808
|
-
|
809
|
-
|
810
|
-
--list_.default_count;
|
811
|
-
unlink_storage(&list_, idx_.array[idx]);
|
812
|
-
GRPC_MDELEM_UNREF(idx_.array[idx]->md);
|
813
|
-
idx_.array[idx] = nullptr;
|
814
|
-
AssertValidCallouts();
|
1341
|
+
template <typename Derived, typename... Traits>
|
1342
|
+
void MetadataMap<Derived, Traits...>::Clear() {
|
1343
|
+
table_.ClearAll();
|
1344
|
+
unknown_.Clear();
|
815
1345
|
}
|
816
1346
|
|
817
|
-
template <typename... Traits>
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
for (grpc_linked_mdelem* md = list_.head; md != nullptr; md = md->next) {
|
823
|
-
absl::string_view key = grpc_core::StringViewFromSlice(GRPC_MDKEY(md->md));
|
824
|
-
absl::string_view value =
|
825
|
-
grpc_core::StringViewFromSlice(GRPC_MDVALUE(md->md));
|
826
|
-
if (target_key == key) values.push_back(value);
|
827
|
-
}
|
828
|
-
// If none found, no match.
|
829
|
-
if (values.empty()) return absl::nullopt;
|
830
|
-
// If exactly one found, return it as-is.
|
831
|
-
if (values.size() == 1) return values.front();
|
832
|
-
// If more than one found, concatenate the values, using
|
833
|
-
// *concatenated_values as a temporary holding place for the
|
834
|
-
// concatenated string.
|
835
|
-
*concatenated_value = absl::StrJoin(values, ",");
|
836
|
-
return *concatenated_value;
|
837
|
-
}
|
838
|
-
|
839
|
-
template <typename... Traits>
|
840
|
-
grpc_error_handle MetadataMap<Traits...>::Substitute(
|
841
|
-
grpc_linked_mdelem* storage, grpc_mdelem new_mdelem) {
|
842
|
-
AssertValidCallouts();
|
843
|
-
grpc_error_handle error = GRPC_ERROR_NONE;
|
844
|
-
grpc_mdelem old_mdelem = storage->md;
|
845
|
-
if (!grpc_slice_eq(GRPC_MDKEY(new_mdelem), GRPC_MDKEY(old_mdelem))) {
|
846
|
-
MaybeUnlinkCallout(storage);
|
847
|
-
storage->md = new_mdelem;
|
848
|
-
error = MaybeLinkCallout(storage);
|
849
|
-
if (error != GRPC_ERROR_NONE) {
|
850
|
-
unlink_storage(&list_, storage);
|
851
|
-
GRPC_MDELEM_UNREF(storage->md);
|
852
|
-
}
|
853
|
-
} else {
|
854
|
-
storage->md = new_mdelem;
|
855
|
-
}
|
856
|
-
GRPC_MDELEM_UNREF(old_mdelem);
|
857
|
-
AssertValidCallouts();
|
858
|
-
return error;
|
1347
|
+
template <typename Derived, typename... Traits>
|
1348
|
+
size_t MetadataMap<Derived, Traits...>::TransportSize() const {
|
1349
|
+
metadata_detail::TransportSizeEncoder enc;
|
1350
|
+
Encode(&enc);
|
1351
|
+
return enc.size();
|
859
1352
|
}
|
860
1353
|
|
861
|
-
template <typename... Traits>
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
new (this) MetadataMap(arena);
|
868
|
-
}
|
869
|
-
|
870
|
-
template <typename... Traits>
|
871
|
-
size_t MetadataMap<Traits...>::TransportSize() const {
|
872
|
-
size_t size = 0;
|
873
|
-
for (grpc_linked_mdelem* elem = list_.head; elem != nullptr;
|
874
|
-
elem = elem->next) {
|
875
|
-
size += GRPC_MDELEM_LENGTH(elem->md);
|
876
|
-
}
|
877
|
-
return size;
|
878
|
-
}
|
879
|
-
|
880
|
-
template <typename... Traits>
|
881
|
-
bool MetadataMap<Traits...>::ReplaceIfExists(grpc_slice key, grpc_slice value) {
|
882
|
-
AssertValidCallouts();
|
883
|
-
for (grpc_linked_mdelem* l = list_.head; l != nullptr; l = l->next) {
|
884
|
-
if (grpc_slice_eq(GRPC_MDKEY(l->md), key)) {
|
885
|
-
auto new_mdelem = grpc_mdelem_from_slices(key, value);
|
886
|
-
GRPC_MDELEM_UNREF(l->md);
|
887
|
-
l->md = new_mdelem;
|
888
|
-
AssertValidCallouts();
|
889
|
-
return true;
|
890
|
-
}
|
891
|
-
}
|
892
|
-
AssertValidCallouts();
|
893
|
-
return false;
|
1354
|
+
template <typename Derived, typename... Traits>
|
1355
|
+
Derived MetadataMap<Derived, Traits...>::Copy() const {
|
1356
|
+
Derived out(unknown_.arena());
|
1357
|
+
metadata_detail::CopySink<Derived> sink(&out);
|
1358
|
+
Encode(&sink);
|
1359
|
+
return out;
|
894
1360
|
}
|
895
1361
|
|
896
1362
|
} // namespace grpc_core
|
897
1363
|
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
}
|
923
|
-
|
924
|
-
/** Substitute a new mdelem for an old value */
|
925
|
-
inline grpc_error_handle grpc_metadata_batch_substitute(
|
926
|
-
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
|
927
|
-
grpc_mdelem new_mdelem) {
|
928
|
-
return batch->Substitute(storage, new_mdelem);
|
929
|
-
}
|
930
|
-
|
931
|
-
void grpc_metadata_batch_set_value(grpc_linked_mdelem* storage,
|
932
|
-
const grpc_slice& value);
|
933
|
-
|
934
|
-
/** Returns metadata value(s) for the specified key.
|
935
|
-
If the key is not present in the batch, returns absl::nullopt.
|
936
|
-
If the key is present exactly once in the batch, returns a string_view of
|
937
|
-
that value.
|
938
|
-
If the key is present more than once in the batch, constructs a
|
939
|
-
comma-concatenated string of all values in concatenated_value and returns a
|
940
|
-
string_view of that string. */
|
941
|
-
inline absl::optional<absl::string_view> grpc_metadata_batch_get_value(
|
942
|
-
grpc_metadata_batch* batch, absl::string_view target_key,
|
943
|
-
std::string* concatenated_value) {
|
944
|
-
return batch->GetValue(target_key, concatenated_value);
|
945
|
-
}
|
946
|
-
|
947
|
-
/** Add \a storage to the beginning of \a batch. storage->md is
|
948
|
-
assumed to be valid.
|
949
|
-
\a storage is owned by the caller and must survive for the
|
950
|
-
lifetime of batch. This usually means it should be around
|
951
|
-
for the lifetime of the call. */
|
952
|
-
inline GRPC_MUST_USE_RESULT grpc_error_handle grpc_metadata_batch_link_head(
|
953
|
-
grpc_metadata_batch* batch, grpc_linked_mdelem* storage) {
|
954
|
-
return batch->LinkHead(storage);
|
955
|
-
}
|
956
|
-
|
957
|
-
inline GRPC_MUST_USE_RESULT grpc_error_handle grpc_metadata_batch_link_head(
|
958
|
-
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
|
959
|
-
grpc_metadata_batch_callouts_index idx) {
|
960
|
-
return batch->LinkHead(storage, idx);
|
961
|
-
}
|
962
|
-
|
963
|
-
/** Add \a storage to the end of \a batch. storage->md is
|
964
|
-
assumed to be valid.
|
965
|
-
\a storage is owned by the caller and must survive for the
|
966
|
-
lifetime of batch. This usually means it should be around
|
967
|
-
for the lifetime of the call. */
|
968
|
-
inline GRPC_MUST_USE_RESULT grpc_error_handle grpc_metadata_batch_link_tail(
|
969
|
-
grpc_metadata_batch* batch, grpc_linked_mdelem* storage) {
|
970
|
-
return batch->LinkTail(storage);
|
971
|
-
}
|
972
|
-
|
973
|
-
inline GRPC_MUST_USE_RESULT grpc_error_handle grpc_metadata_batch_link_tail(
|
974
|
-
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
|
975
|
-
grpc_metadata_batch_callouts_index idx) {
|
976
|
-
return batch->LinkTail(storage, idx);
|
977
|
-
}
|
978
|
-
|
979
|
-
/** Add \a elem_to_add as the first element in \a batch, using
|
980
|
-
\a storage as backing storage for the linked list element.
|
981
|
-
\a storage is owned by the caller and must survive for the
|
982
|
-
lifetime of batch. This usually means it should be around
|
983
|
-
for the lifetime of the call.
|
984
|
-
Takes ownership of \a elem_to_add */
|
985
|
-
inline grpc_error_handle grpc_metadata_batch_add_head(
|
986
|
-
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
|
987
|
-
grpc_mdelem elem_to_add) {
|
988
|
-
return batch->AddHead(storage, elem_to_add);
|
989
|
-
}
|
990
|
-
|
991
|
-
// TODO(arjunroy, roth): Remove redundant methods.
|
992
|
-
// add/link_head/tail are almost identical.
|
993
|
-
inline grpc_error_handle GRPC_MUST_USE_RESULT grpc_metadata_batch_add_head(
|
994
|
-
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
|
995
|
-
grpc_metadata_batch_callouts_index idx) {
|
996
|
-
return grpc_metadata_batch_link_head(batch, storage, idx);
|
997
|
-
}
|
998
|
-
|
999
|
-
inline grpc_error_handle GRPC_MUST_USE_RESULT grpc_metadata_batch_add_head(
|
1000
|
-
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
|
1001
|
-
grpc_mdelem elem_to_add, grpc_metadata_batch_callouts_index idx) {
|
1002
|
-
GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
|
1003
|
-
storage->md = elem_to_add;
|
1004
|
-
return grpc_metadata_batch_add_head(batch, storage, idx);
|
1005
|
-
}
|
1006
|
-
|
1007
|
-
/** Add \a elem_to_add as the last element in \a batch, using
|
1008
|
-
\a storage as backing storage for the linked list element.
|
1009
|
-
\a storage is owned by the caller and must survive for the
|
1010
|
-
lifetime of batch. This usually means it should be around
|
1011
|
-
for the lifetime of the call.
|
1012
|
-
Takes ownership of \a elem_to_add */
|
1013
|
-
inline GRPC_MUST_USE_RESULT grpc_error_handle grpc_metadata_batch_add_tail(
|
1014
|
-
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
|
1015
|
-
grpc_mdelem elem_to_add) {
|
1016
|
-
return batch->AddTail(storage, elem_to_add);
|
1017
|
-
}
|
1018
|
-
|
1019
|
-
inline grpc_error_handle GRPC_MUST_USE_RESULT grpc_metadata_batch_add_tail(
|
1020
|
-
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
|
1021
|
-
grpc_metadata_batch_callouts_index idx) {
|
1022
|
-
return grpc_metadata_batch_link_tail(batch, storage, idx);
|
1023
|
-
}
|
1024
|
-
|
1025
|
-
inline grpc_error_handle GRPC_MUST_USE_RESULT grpc_metadata_batch_add_tail(
|
1026
|
-
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
|
1027
|
-
grpc_mdelem elem_to_add, grpc_metadata_batch_callouts_index idx) {
|
1028
|
-
GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
|
1029
|
-
storage->md = elem_to_add;
|
1030
|
-
return grpc_metadata_batch_add_tail(batch, storage, idx);
|
1031
|
-
}
|
1032
|
-
|
1033
|
-
typedef grpc_filtered_mdelem (*grpc_metadata_batch_filter_func)(
|
1034
|
-
void* user_data, grpc_mdelem elem);
|
1035
|
-
inline GRPC_MUST_USE_RESULT grpc_error_handle grpc_metadata_batch_filter(
|
1036
|
-
grpc_metadata_batch* batch, grpc_metadata_batch_filter_func func,
|
1037
|
-
void* user_data, const char* composite_error_string) {
|
1038
|
-
return batch->Filter([=](grpc_mdelem elem) { return func(user_data, elem); },
|
1039
|
-
composite_error_string);
|
1040
|
-
}
|
1041
|
-
|
1042
|
-
inline void grpc_metadata_batch_assert_ok(grpc_metadata_batch* batch) {
|
1043
|
-
batch->AssertOk();
|
1044
|
-
}
|
1045
|
-
|
1046
|
-
/// Copies \a src to \a dst.
|
1047
|
-
///
|
1048
|
-
/// For each mdelem in \a src, if the mdelem is of storage types
|
1049
|
-
/// GRPC_MDELEM_STORAGE_INTERNED or GRPC_MDELEM_STORAGE_ALLOCATED,
|
1050
|
-
/// refs the original mdelem for the copy. Otherwise, makes a new
|
1051
|
-
/// mdelem that will hold its own refs to the key and value slices.
|
1052
|
-
void grpc_metadata_batch_copy(const grpc_metadata_batch* src,
|
1053
|
-
grpc_metadata_batch* dst);
|
1364
|
+
struct grpc_metadata_batch;
|
1365
|
+
|
1366
|
+
using grpc_metadata_batch_base = grpc_core::MetadataMap<
|
1367
|
+
grpc_metadata_batch,
|
1368
|
+
// Colon prefixed headers first
|
1369
|
+
grpc_core::HttpPathMetadata, grpc_core::HttpAuthorityMetadata,
|
1370
|
+
grpc_core::HttpMethodMetadata, grpc_core::HttpStatusMetadata,
|
1371
|
+
grpc_core::HttpSchemeMetadata,
|
1372
|
+
// Non-colon prefixed headers begin here
|
1373
|
+
grpc_core::ContentTypeMetadata, grpc_core::TeMetadata,
|
1374
|
+
grpc_core::GrpcEncodingMetadata, grpc_core::GrpcInternalEncodingRequest,
|
1375
|
+
grpc_core::GrpcAcceptEncodingMetadata, grpc_core::GrpcStatusMetadata,
|
1376
|
+
grpc_core::GrpcTimeoutMetadata, grpc_core::GrpcPreviousRpcAttemptsMetadata,
|
1377
|
+
grpc_core::GrpcRetryPushbackMsMetadata, grpc_core::UserAgentMetadata,
|
1378
|
+
grpc_core::GrpcMessageMetadata, grpc_core::HostMetadata,
|
1379
|
+
grpc_core::XEndpointLoadMetricsBinMetadata,
|
1380
|
+
grpc_core::GrpcServerStatsBinMetadata, grpc_core::GrpcTraceBinMetadata,
|
1381
|
+
grpc_core::GrpcTagsBinMetadata, grpc_core::GrpcLbClientStatsMetadata,
|
1382
|
+
grpc_core::LbCostBinMetadata, grpc_core::LbTokenMetadata,
|
1383
|
+
// Non-encodable things
|
1384
|
+
grpc_core::GrpcStreamNetworkState, grpc_core::GrpcStatusContext>;
|
1385
|
+
|
1386
|
+
struct grpc_metadata_batch : public grpc_metadata_batch_base {
|
1387
|
+
using grpc_metadata_batch_base::grpc_metadata_batch_base;
|
1388
|
+
};
|
1054
1389
|
|
1055
1390
|
#endif /* GRPC_CORE_LIB_TRANSPORT_METADATA_BATCH_H */
|