grpc 1.78.0 → 1.80.0.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +22 -8
- data/include/grpc/credentials.h +47 -37
- data/include/grpc/credentials_cpp.h +39 -0
- data/include/grpc/event_engine/event_engine.h +8 -3
- data/include/grpc/grpc.h +4 -0
- data/include/grpc/impl/call.h +9 -0
- data/include/grpc/impl/channel_arg_names.h +7 -0
- data/include/grpc/module.modulemap +2 -0
- data/include/grpc/private_key_signer.h +104 -0
- data/include/grpc/support/port_platform.h +6 -0
- data/src/core/call/call_filters.h +101 -78
- data/src/core/call/call_spine.h +91 -68
- data/src/core/call/call_state.h +60 -4
- data/src/core/call/client_call.cc +9 -9
- data/src/core/call/client_call.h +1 -1
- data/src/core/call/metadata_batch.cc +2 -0
- data/src/core/call/metadata_batch.h +48 -1
- data/src/core/call/metadata_info.cc +35 -0
- data/src/core/call/metadata_info.h +2 -0
- data/src/core/call/simple_slice_based_metadata.h +2 -1
- data/src/core/channelz/channelz.cc +9 -6
- data/src/core/channelz/channelz.h +7 -4
- data/src/core/channelz/property_list.h +5 -0
- data/src/core/channelz/v2tov1/convert.cc +1 -1
- data/src/core/channelz/v2tov1/legacy_api.cc +164 -307
- data/src/core/client_channel/buffered_call.cc +7 -3
- data/src/core/client_channel/buffered_call.h +11 -5
- data/src/core/client_channel/client_channel.cc +106 -44
- data/src/core/client_channel/client_channel.h +3 -6
- data/src/core/client_channel/client_channel_filter.cc +90 -64
- data/src/core/client_channel/client_channel_filter.h +3 -6
- data/src/core/client_channel/client_channel_internal.h +5 -0
- data/src/core/client_channel/config_selector.h +17 -12
- data/src/core/client_channel/dynamic_filters.cc +8 -7
- data/src/core/client_channel/dynamic_filters.h +7 -5
- data/src/core/client_channel/retry_filter.cc +1 -1
- data/src/core/client_channel/retry_filter.h +2 -2
- data/src/core/client_channel/subchannel.cc +1682 -266
- data/src/core/client_channel/subchannel.h +411 -134
- data/src/core/client_channel/subchannel_stream_client.cc +22 -18
- data/src/core/client_channel/subchannel_stream_client.h +8 -9
- data/src/core/client_channel/subchannel_stream_limiter.cc +76 -0
- data/src/core/client_channel/subchannel_stream_limiter.h +51 -0
- data/src/core/config/config_vars.cc +9 -1
- data/src/core/config/config_vars.h +6 -0
- data/src/core/credentials/call/call_creds_registry.h +51 -22
- data/src/core/credentials/call/call_creds_registry_init.cc +86 -2
- data/src/core/credentials/call/external/aws_external_account_credentials.cc +2 -2
- data/src/core/credentials/call/external/external_account_credentials.cc +11 -4
- data/src/core/credentials/call/external/file_external_account_credentials.cc +2 -2
- data/src/core/credentials/transport/channel_creds_registry.h +71 -20
- data/src/core/credentials/transport/channel_creds_registry_init.cc +338 -29
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +43 -24
- data/src/core/credentials/transport/ssl/ssl_credentials.h +7 -1
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +2 -8
- data/src/core/credentials/transport/ssl/ssl_security_connector.h +4 -3
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +25 -5
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.h +7 -5
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +181 -109
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.h +55 -42
- data/src/core/credentials/transport/tls/grpc_tls_credentials_options.cc +28 -23
- data/src/core/credentials/transport/tls/grpc_tls_credentials_options.h +26 -23
- data/src/core/credentials/transport/tls/spiffe_utils.cc +2 -2
- data/src/core/credentials/transport/tls/ssl_utils.cc +18 -18
- data/src/core/credentials/transport/tls/ssl_utils.h +12 -10
- data/src/core/credentials/transport/tls/tls_security_connector.cc +106 -74
- data/src/core/credentials/transport/tls/tls_security_connector.h +12 -8
- data/src/core/credentials/transport/xds/xds_credentials.cc +76 -32
- data/src/core/credentials/transport/xds/xds_credentials.h +4 -2
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +117 -35
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +42 -4
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +58 -29
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +19 -11
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +82 -25
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +28 -3
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc +9 -7
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +1 -1
- data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.h +7 -1
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +117 -67
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +2 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +11 -1
- data/src/core/ext/transport/chttp2/transport/frame.cc +2 -15
- data/src/core/ext/transport/chttp2/transport/frame.h +0 -4
- data/src/core/ext/transport/chttp2/transport/goaway.cc +17 -2
- data/src/core/ext/transport/chttp2/transport/goaway.h +27 -6
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +8 -21
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +101 -40
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +95 -0
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +923 -772
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +406 -423
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +8 -1
- data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +25 -13
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +71 -24
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +25 -49
- data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +2 -2
- data/src/core/ext/transport/chttp2/transport/incoming_metadata_tracker.h +29 -9
- data/src/core/ext/transport/chttp2/transport/internal.h +6 -2
- data/src/core/ext/transport/chttp2/transport/keepalive.cc +14 -20
- data/src/core/ext/transport/chttp2/transport/keepalive.h +9 -6
- data/src/core/ext/transport/chttp2/transport/parsing.cc +11 -0
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +34 -74
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +123 -79
- data/src/core/ext/transport/chttp2/transport/security_frame.h +233 -3
- data/src/core/ext/transport/chttp2/transport/stream.h +152 -73
- data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +155 -85
- data/src/core/ext/transport/chttp2/transport/transport_common.h +0 -5
- data/src/core/ext/transport/chttp2/transport/writable_streams.h +8 -7
- data/src/core/ext/transport/chttp2/transport/write_cycle.cc +86 -0
- data/src/core/ext/transport/chttp2/transport/write_cycle.h +355 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +31 -29
- data/src/core/ext/upb-gen/cel/expr/checked.upb.h +1875 -0
- data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.c +409 -0
- data/src/core/ext/upb-gen/cel/expr/checked.upb_minitable.h +56 -0
- data/src/core/ext/upb-gen/cel/expr/syntax.upb.h +2223 -0
- data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.c +489 -0
- data/src/core/ext/upb-gen/cel/expr/syntax.upb_minitable.h +60 -0
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +2 -1
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +130 -18
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +18 -13
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +70 -38
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +20 -17
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +26 -10
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +8 -7
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb.h +495 -0
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.c +114 -0
- data/src/core/ext/upb-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upb_minitable.h +36 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +26 -10
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +8 -7
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb.h +121 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.c +54 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/cel.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +143 -9
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +18 -6
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +112 -11
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +22 -9
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb.h +276 -0
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.c +60 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.h +4 -0
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +72 -0
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +23 -2
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +129 -13
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +36 -10
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +30 -0
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +5 -3
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +16 -0
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +4 -3
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +31 -0
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +5 -3
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +2 -1
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +63 -0
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +12 -7
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +97 -81
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +40 -23
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +604 -228
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +146 -100
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +30 -0
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +5 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +35 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +7 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +66 -14
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +22 -11
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +87 -0
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c +29 -2
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +20 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +5 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +239 -60
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +59 -28
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb.h +89 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.c +50 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/call_credentials/access_token/v3/access_token_credentials.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb.h +135 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.c +53 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/tls/v3/tls_credentials.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb.h +105 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.c +51 -0
- data/src/core/ext/upb-gen/envoy/extensions/grpc_service/channel_credentials/xds/v3/xds_credentials.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.c +6 -3
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +206 -0
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +41 -8
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +64 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +4 -3
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +64 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.c +31 -5
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +283 -14
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +48 -11
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +144 -6
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +35 -7
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +42 -21
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +9 -8
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +164 -1
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +37 -6
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +2 -0
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb.h +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.c +0 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +26 -11
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +8 -8
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb.h +33 -0
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.c +14 -3
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb.h +90 -10
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.c +18 -7
- data/src/core/ext/upbdefs-gen/cel/expr/checked.upbdefs.c +248 -0
- data/src/core/ext/upbdefs-gen/cel/expr/checked.upbdefs.h +97 -0
- data/src/core/ext/upbdefs-gen/cel/expr/syntax.upbdefs.c +283 -0
- data/src/core/ext/upbdefs-gen/cel/expr/syntax.upbdefs.h +107 -0
- data/src/core/ext/upbdefs-gen/envoy/config/accesslog/v3/accesslog.upbdefs.c +213 -211
- data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +635 -614
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.c +1012 -1000
- data/src/core/ext/upbdefs-gen/envoy/config/common/matcher/v3/matcher.upbdefs.c +276 -273
- data/src/core/ext/upbdefs-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upbdefs.c +152 -0
- data/src/core/ext/upbdefs-gen/envoy/config/common/mutation_rules/v3/mutation_rules.upbdefs.h +47 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/address.upbdefs.c +149 -144
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.c +367 -370
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/cel.upbdefs.c +63 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/cel.upbdefs.h +37 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/grpc_service.upbdefs.c +297 -284
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.c +492 -469
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.c +74 -43
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/substitution_format_string.upbdefs.c +60 -59
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +202 -184
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.c +354 -339
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/quic_config.upbdefs.c +28 -19
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/metrics_service.upbdefs.c +30 -27
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/stats.upbdefs.c +71 -66
- data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.c +94 -91
- data/src/core/ext/upbdefs-gen/envoy/config/rbac/v3/rbac.upbdefs.c +386 -369
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route.upbdefs.c +60 -57
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.c +1974 -1884
- data/src/core/ext/upbdefs-gen/envoy/config/tap/v3/common.upbdefs.c +119 -112
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opentelemetry.upbdefs.c +62 -51
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/zipkin.upbdefs.c +109 -88
- data/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +54 -36
- data/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +78 -84
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +48 -46
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +1041 -984
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +304 -290
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +94 -77
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.c +246 -193
- data/src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.c +37 -23
- data/src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/envoy/type/tracing/v3/custom_tag.upbdefs.c +5 -3
- data/src/core/ext/upbdefs-gen/google/api/http.upbdefs.c +4 -4
- data/src/core/ext/upbdefs-gen/google/api/httpbody.upbdefs.c +4 -5
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.c +113 -87
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-gen/udpa/annotations/migrate.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/security.upbdefs.c +6 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/sensitive.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/status.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/udpa/annotations/versioning.upbdefs.c +5 -5
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/cel.upbdefs.c +25 -30
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/http_inputs.upbdefs.c +14 -20
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/matcher.upbdefs.c +180 -183
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/string.upbdefs.c +56 -47
- data/src/core/ext/upbdefs-gen/xds/type/v3/cel.upbdefs.c +69 -47
- data/src/core/filter/filter_chain.h +95 -0
- data/src/core/handshaker/http_connect/{http_connect_handshaker.cc → http_connect_client_handshaker.cc} +32 -31
- data/src/core/handshaker/http_connect/{http_connect_handshaker.h → http_connect_client_handshaker.h} +4 -4
- data/src/core/handshaker/http_connect/http_proxy_mapper.cc +1 -1
- data/src/core/handshaker/http_connect/xds_http_proxy_mapper.cc +1 -1
- data/src/core/handshaker/security/pipelined_secure_endpoint.cc +14 -13
- data/src/core/handshaker/security/secure_endpoint.cc +282 -68
- data/src/core/handshaker/security/secure_endpoint.h +0 -7
- data/src/core/lib/channel/channel_args.h +1 -1
- data/src/core/lib/channel/promise_based_filter.cc +17 -4
- data/src/core/lib/channel/promise_based_filter.h +3 -2
- data/src/core/lib/debug/trace_flags.cc +2 -0
- data/src/core/lib/debug/trace_flags.h +1 -0
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +35 -8
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +1 -2
- data/src/core/lib/event_engine/event_engine.cc +9 -0
- data/src/core/lib/event_engine/extensions/tcp_trace.h +0 -3
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +2 -2
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +1 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +34 -9
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +24 -2
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +1 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +141 -14
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +19 -2
- data/src/core/lib/event_engine/posix_engine/posix_interface.h +7 -0
- data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +21 -3
- data/src/core/lib/event_engine/posix_engine/posix_interface_windows.cc +16 -0
- data/src/core/lib/experiments/experiments.cc +309 -201
- data/src/core/lib/experiments/experiments.h +141 -80
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +2 -2
- data/src/core/lib/iomgr/resolve_address.h +0 -2
- data/src/core/lib/iomgr/resolved_address.h +0 -2
- data/src/core/lib/iomgr/tcp_posix.cc +13 -5
- data/src/core/lib/iomgr/tcp_server.cc +0 -5
- data/src/core/lib/iomgr/tcp_server.h +0 -7
- data/src/core/lib/iomgr/tcp_server_posix.cc +0 -17
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +0 -3
- data/src/core/lib/iomgr/tcp_server_windows.cc +12 -51
- data/src/core/lib/promise/all_ok.h +17 -12
- data/src/core/lib/promise/cancel_callback.h +12 -13
- data/src/core/lib/promise/detail/join_state.h +626 -0
- data/src/core/lib/promise/detail/promise_factory.h +14 -14
- data/src/core/lib/promise/for_each.h +32 -8
- data/src/core/lib/promise/if.h +9 -7
- data/src/core/lib/promise/loop.h +18 -16
- data/src/core/lib/promise/map.h +54 -47
- data/src/core/lib/promise/mpsc.h +11 -10
- data/src/core/lib/promise/observable.h +6 -6
- data/src/core/lib/promise/party.h +25 -19
- data/src/core/lib/promise/poll.h +5 -5
- data/src/core/lib/promise/prioritized_race.h +10 -7
- data/src/core/lib/promise/promise.h +16 -11
- data/src/core/lib/promise/race.h +6 -5
- data/src/core/lib/promise/seq.h +109 -74
- data/src/core/lib/promise/try_join.h +14 -6
- data/src/core/lib/promise/try_seq.h +76 -60
- data/src/core/lib/resource_quota/api.cc +7 -0
- data/src/core/lib/resource_quota/arena.h +1 -1
- data/src/core/lib/resource_quota/memory_quota.cc +4 -1
- data/src/core/lib/resource_quota/resource_quota.cc +2 -1
- data/src/core/lib/resource_quota/resource_quota.h +3 -0
- data/src/core/lib/resource_quota/stream_quota.cc +77 -1
- data/src/core/lib/resource_quota/stream_quota.h +64 -1
- data/src/core/lib/resource_quota/telemetry.h +1 -1
- data/src/core/lib/surface/call.cc +13 -0
- data/src/core/lib/surface/call_utils.h +58 -43
- data/src/core/lib/surface/channel.h +1 -4
- data/src/core/lib/surface/completion_queue.cc +13 -6
- data/src/core/lib/surface/validate_metadata.cc +20 -15
- data/src/core/lib/surface/validate_metadata.h +3 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/promise_endpoint.cc +1 -1
- data/src/core/lib/transport/promise_endpoint.h +1 -1
- data/src/core/lib/transport/transport.h +5 -0
- data/src/core/load_balancing/health_check_client.cc +1 -15
- data/src/core/load_balancing/health_check_client_internal.h +0 -2
- data/src/core/load_balancing/oob_backend_metric.cc +1 -5
- data/src/core/load_balancing/oob_backend_metric_internal.h +0 -1
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +12 -9
- data/src/core/plugin_registry/grpc_plugin_registry.cc +3 -2
- data/src/core/resolver/xds/xds_resolver.cc +162 -116
- data/src/core/server/server.cc +18 -1
- data/src/core/server/server.h +2 -0
- data/src/core/server/xds_server_config_fetcher.cc +4 -4
- data/src/core/telemetry/call_tracer.cc +87 -2
- data/src/core/telemetry/call_tracer.h +46 -8
- data/src/core/telemetry/instrument.cc +102 -40
- data/src/core/telemetry/instrument.h +246 -65
- data/src/core/tsi/fake_transport_security.cc +3 -1
- data/src/core/tsi/ssl_transport_security.cc +516 -137
- data/src/core/tsi/ssl_transport_security.h +28 -22
- data/src/core/tsi/ssl_transport_security_utils.cc +2 -2
- data/src/core/tsi/ssl_transport_security_utils.h +2 -2
- data/src/core/util/bitset.h +6 -0
- data/src/core/util/function_signature.h +3 -1
- data/src/core/util/http_client/httpcli_security_connector.cc +2 -1
- data/src/core/util/json/json_reader.cc +0 -4
- data/src/core/xds/grpc/certificate_provider_store.cc +2 -1
- data/src/core/xds/grpc/certificate_provider_store.h +3 -17
- data/src/core/xds/grpc/certificate_provider_store_interface.h +61 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +48 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +18 -0
- data/src/core/xds/grpc/xds_certificate_provider.cc +7 -2
- data/src/core/xds/grpc/xds_certificate_provider.h +13 -2
- data/src/core/xds/grpc/xds_client_grpc.cc +13 -6
- data/src/core/xds/grpc/xds_client_grpc.h +10 -7
- data/src/core/xds/grpc/xds_cluster.cc +18 -4
- data/src/core/xds/grpc/xds_cluster.h +17 -2
- data/src/core/xds/grpc/xds_cluster_parser.cc +36 -11
- data/src/core/xds/grpc/xds_common_types.cc +45 -0
- data/src/core/xds/grpc/xds_common_types.h +31 -0
- data/src/core/xds/grpc/xds_common_types_parser.cc +274 -16
- data/src/core/xds/grpc/xds_common_types_parser.h +12 -0
- data/src/core/xds/grpc/xds_http_fault_filter.cc +128 -24
- data/src/core/xds/grpc/xds_http_fault_filter.h +19 -10
- data/src/core/xds/grpc/xds_http_filter.cc +38 -0
- data/src/core/xds/grpc/xds_http_filter.h +70 -47
- data/src/core/xds/grpc/xds_http_filter_registry.cc +48 -14
- data/src/core/xds/grpc/xds_http_filter_registry.h +29 -15
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +88 -22
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +22 -11
- data/src/core/xds/grpc/xds_http_rbac_filter.cc +36 -20
- data/src/core/xds/grpc/xds_http_rbac_filter.h +19 -10
- data/src/core/xds/grpc/xds_http_stateful_session_filter.cc +143 -26
- data/src/core/xds/grpc/xds_http_stateful_session_filter.h +19 -10
- data/src/core/xds/grpc/xds_listener.cc +4 -1
- data/src/core/xds/grpc/xds_listener.h +10 -2
- data/src/core/xds/grpc/xds_listener_parser.cc +23 -18
- data/src/core/xds/grpc/xds_matcher.cc +40 -5
- data/src/core/xds/grpc/xds_matcher.h +13 -0
- data/src/core/xds/grpc/xds_matcher_action.h +1 -1
- data/src/core/xds/grpc/xds_matcher_parse.cc +60 -40
- data/src/core/xds/grpc/xds_matcher_parse.h +2 -1
- data/src/core/xds/grpc/xds_route_config.cc +12 -1
- data/src/core/xds/grpc/xds_route_config.h +15 -2
- data/src/core/xds/grpc/xds_route_config_parser.cc +11 -5
- data/src/core/xds/grpc/xds_routing.cc +181 -6
- data/src/core/xds/grpc/xds_routing.h +57 -0
- data/src/core/xds/grpc/xds_server_grpc.cc +55 -43
- data/src/core/xds/grpc/xds_server_grpc.h +13 -6
- data/src/core/xds/grpc/xds_server_grpc_interface.h +3 -2
- data/src/core/xds/grpc/xds_transport_grpc.cc +12 -6
- data/src/core/xds/grpc/xds_transport_grpc.h +5 -1
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -8
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +18 -12
- data/src/ruby/lib/grpc/grpc.rb +7 -9
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -1
- data/src/ruby/spec/client_server_spec.rb +1 -1
- data/src/ruby/spec/generic/rpc_server_pool_spec.rb +1 -1
- data/src/ruby/spec/generic/rpc_server_spec.rb +3 -4
- data/src/ruby/spec/spec_helper.rb +1 -1
- metadata +64 -14
- data/src/core/ext/transport/chttp2/transport/security_frame.cc +0 -31
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +0 -597
|
@@ -44,9 +44,11 @@
|
|
|
44
44
|
#include <variant>
|
|
45
45
|
#include <vector>
|
|
46
46
|
|
|
47
|
+
#include "src/core/call/metadata.h"
|
|
47
48
|
#include "src/core/call/metadata_batch.h"
|
|
48
49
|
#include "src/core/call/metadata_info.h"
|
|
49
50
|
#include "src/core/channelz/property_list.h"
|
|
51
|
+
#include "src/core/client_channel/client_channel_internal.h"
|
|
50
52
|
#include "src/core/config/config_vars.h"
|
|
51
53
|
#include "src/core/ext/transport/chttp2/transport/call_tracer_wrapper.h"
|
|
52
54
|
#include "src/core/ext/transport/chttp2/transport/flow_control.h"
|
|
@@ -169,8 +171,9 @@ static void read_action_locked(grpc_core::RefCountedPtr<grpc_chttp2_transport>,
|
|
|
169
171
|
static void continue_read_action_locked(
|
|
170
172
|
grpc_core::RefCountedPtr<grpc_chttp2_transport> t);
|
|
171
173
|
|
|
172
|
-
static void close_from_api(
|
|
173
|
-
|
|
174
|
+
static void close_from_api(
|
|
175
|
+
grpc_chttp2_transport* t, grpc_chttp2_stream* s, grpc_error_handle error,
|
|
176
|
+
bool tarpit, grpc_core::ServerMetadataHandle send_trailing_metadata);
|
|
174
177
|
|
|
175
178
|
// Start new streams that have been created if we can
|
|
176
179
|
static void maybe_start_some_streams(grpc_chttp2_transport* t);
|
|
@@ -347,6 +350,17 @@ std::string HttpAnnotation::ToString() const {
|
|
|
347
350
|
return s;
|
|
348
351
|
}
|
|
349
352
|
|
|
353
|
+
void HttpAnnotation::ForEachKeyValue(
|
|
354
|
+
absl::FunctionRef<void(absl::string_view, ValueType)> f) const {
|
|
355
|
+
f("type", static_cast<int64_t>(type_));
|
|
356
|
+
f("time_sec", static_cast<int64_t>(time_.tv_sec));
|
|
357
|
+
f("time_nsec", static_cast<int64_t>(time_.tv_nsec));
|
|
358
|
+
if (write_stats_.has_value()) {
|
|
359
|
+
f("target_write_size",
|
|
360
|
+
static_cast<int64_t>(write_stats_->target_write_size));
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
350
364
|
} // namespace grpc_core
|
|
351
365
|
|
|
352
366
|
//
|
|
@@ -692,6 +706,8 @@ grpc_chttp2_transport::grpc_chttp2_transport(
|
|
|
692
706
|
memory_owner(channel_args.GetObject<grpc_core::ResourceQuota>()
|
|
693
707
|
->memory_quota()
|
|
694
708
|
->CreateMemoryOwner()),
|
|
709
|
+
stream_quota(
|
|
710
|
+
channel_args.GetObject<grpc_core::ResourceQuota>()->stream_quota()),
|
|
695
711
|
self_reservation(
|
|
696
712
|
memory_owner.MakeReservation(sizeof(grpc_chttp2_transport))),
|
|
697
713
|
// TODO(ctiller): clean this up so we don't need to RefAsSubclass
|
|
@@ -1393,7 +1409,7 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
|
|
1393
1409
|
t->keepalive_time.millis() > max_keepalive_time_millis
|
|
1394
1410
|
? INT_MAX
|
|
1395
1411
|
: t->keepalive_time.millis() * KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
|
|
1396
|
-
if (!grpc_core::
|
|
1412
|
+
if (!grpc_core::IsSubchannelConnectionScalingEnabled()) {
|
|
1397
1413
|
status.SetPayload(grpc_core::kKeepaliveThrottlingKey,
|
|
1398
1414
|
absl::Cord(std::to_string(throttled_keepalive_time)));
|
|
1399
1415
|
}
|
|
@@ -1405,8 +1421,8 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
|
|
1405
1421
|
if (!grpc_core::test_only_disable_transient_failure_state_notification) {
|
|
1406
1422
|
connectivity_state_set(t, GRPC_CHANNEL_TRANSIENT_FAILURE, status,
|
|
1407
1423
|
"got_goaway");
|
|
1424
|
+
t->NotifyStateWatcherOnDisconnectLocked(std::move(status), disconnect_info);
|
|
1408
1425
|
}
|
|
1409
|
-
t->NotifyStateWatcherOnDisconnectLocked(std::move(status), disconnect_info);
|
|
1410
1426
|
}
|
|
1411
1427
|
|
|
1412
1428
|
static void maybe_start_some_streams(grpc_chttp2_transport* t) {
|
|
@@ -1829,8 +1845,10 @@ static void perform_stream_op_locked(void* stream_op,
|
|
|
1829
1845
|
}
|
|
1830
1846
|
|
|
1831
1847
|
if (op->cancel_stream) {
|
|
1832
|
-
grpc_chttp2_cancel_stream(
|
|
1833
|
-
|
|
1848
|
+
grpc_chttp2_cancel_stream(
|
|
1849
|
+
t, s, op_payload->cancel_stream.cancel_error,
|
|
1850
|
+
op_payload->cancel_stream.tarpit,
|
|
1851
|
+
std::move(op_payload->cancel_stream.send_trailing_metadata));
|
|
1834
1852
|
}
|
|
1835
1853
|
|
|
1836
1854
|
if (op->send_initial_metadata) {
|
|
@@ -2443,15 +2461,23 @@ void MaybeTarpit(grpc_chttp2_transport* t, bool tarpit, F fn) {
|
|
|
2443
2461
|
} // namespace
|
|
2444
2462
|
} // namespace grpc_core
|
|
2445
2463
|
|
|
2446
|
-
void grpc_chttp2_cancel_stream(
|
|
2447
|
-
|
|
2464
|
+
void grpc_chttp2_cancel_stream(
|
|
2465
|
+
grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
2466
|
+
grpc_error_handle due_to_error, bool tarpit,
|
|
2467
|
+
grpc_core::ServerMetadataHandle send_trailing_metadata) {
|
|
2448
2468
|
if (!t->is_client && !s->sent_trailing_metadata &&
|
|
2449
2469
|
grpc_error_has_clear_grpc_status(due_to_error) &&
|
|
2450
2470
|
!(s->read_closed && s->write_closed)) {
|
|
2451
|
-
close_from_api(t, s, due_to_error, tarpit
|
|
2471
|
+
close_from_api(t, s, due_to_error, tarpit,
|
|
2472
|
+
std::move(send_trailing_metadata));
|
|
2452
2473
|
return;
|
|
2453
2474
|
}
|
|
2454
2475
|
|
|
2476
|
+
if (grpc_core::IsPromiseFilterSendCancelMetadataEnabled()) {
|
|
2477
|
+
send_trailing_metadata.reset();
|
|
2478
|
+
}
|
|
2479
|
+
GRPC_DCHECK(send_trailing_metadata == nullptr);
|
|
2480
|
+
|
|
2455
2481
|
if (!due_to_error.ok() && !s->seen_error) {
|
|
2456
2482
|
s->seen_error = true;
|
|
2457
2483
|
}
|
|
@@ -2637,8 +2663,9 @@ grpc_chttp2_transport::RemovedStreamHandle grpc_chttp2_mark_stream_closed(
|
|
|
2637
2663
|
return rsh;
|
|
2638
2664
|
}
|
|
2639
2665
|
|
|
2640
|
-
static void close_from_api(
|
|
2641
|
-
|
|
2666
|
+
static void close_from_api(
|
|
2667
|
+
grpc_chttp2_transport* t, grpc_chttp2_stream* s, grpc_error_handle error,
|
|
2668
|
+
bool tarpit, grpc_core::ServerMetadataHandle send_trailing_metadata) {
|
|
2642
2669
|
grpc_status_code grpc_status;
|
|
2643
2670
|
std::string message;
|
|
2644
2671
|
grpc_error_get_status(error, s->deadline, &grpc_status, &message, nullptr,
|
|
@@ -2650,9 +2677,9 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
|
2650
2677
|
auto remove_stream_handle = grpc_chttp2_mark_stream_closed(t, s, 1, 1, error);
|
|
2651
2678
|
grpc_core::MaybeTarpit(
|
|
2652
2679
|
t, tarpit,
|
|
2653
|
-
[
|
|
2654
|
-
sent_initial_metadata = s->sent_initial_metadata, id = s->id,
|
|
2680
|
+
[sent_initial_metadata = s->sent_initial_metadata, id = s->id,
|
|
2655
2681
|
grpc_status, message = std::move(message),
|
|
2682
|
+
send_trailing_metadata = std::move(send_trailing_metadata),
|
|
2656
2683
|
remove_stream_handle =
|
|
2657
2684
|
std::move(remove_stream_handle)](grpc_chttp2_transport* t) mutable {
|
|
2658
2685
|
grpc_slice hdr;
|
|
@@ -2660,6 +2687,9 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
|
2660
2687
|
grpc_slice http_status_hdr;
|
|
2661
2688
|
grpc_slice content_type_hdr;
|
|
2662
2689
|
grpc_slice message_pfx;
|
|
2690
|
+
size_t msg_len = message.length();
|
|
2691
|
+
grpc_core::Slice message_slice =
|
|
2692
|
+
grpc_core::Slice::FromCopiedString(std::move(message));
|
|
2663
2693
|
uint8_t* p;
|
|
2664
2694
|
uint32_t len = 0;
|
|
2665
2695
|
|
|
@@ -2726,57 +2756,70 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
|
2726
2756
|
len += static_cast<uint32_t> GRPC_SLICE_LENGTH(content_type_hdr);
|
|
2727
2757
|
}
|
|
2728
2758
|
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
*p++ = 'a';
|
|
2741
|
-
*p++ = 't';
|
|
2742
|
-
*p++ = 'u';
|
|
2743
|
-
*p++ = 's';
|
|
2744
|
-
if (grpc_status < 10) {
|
|
2745
|
-
*p++ = 1;
|
|
2746
|
-
*p++ = static_cast<uint8_t>('0' + grpc_status);
|
|
2759
|
+
grpc_core::RawEncoder raw_encoder(
|
|
2760
|
+
t->settings.peer().allow_true_binary_metadata());
|
|
2761
|
+
|
|
2762
|
+
if (grpc_core::IsPromiseFilterSendCancelMetadataEnabled()) {
|
|
2763
|
+
raw_encoder.Encode(grpc_core::GrpcStatusMetadata(), grpc_status);
|
|
2764
|
+
raw_encoder.Encode(grpc_core::GrpcMessageMetadata(), message_slice);
|
|
2765
|
+
if (send_trailing_metadata != nullptr) {
|
|
2766
|
+
send_trailing_metadata->Encode(&raw_encoder);
|
|
2767
|
+
send_trailing_metadata.reset();
|
|
2768
|
+
}
|
|
2769
|
+
len += raw_encoder.Length();
|
|
2747
2770
|
} else {
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
*p++ =
|
|
2771
|
+
status_hdr = GRPC_SLICE_MALLOC(15 + (grpc_status >= 10));
|
|
2772
|
+
p = GRPC_SLICE_START_PTR(status_hdr);
|
|
2773
|
+
*p++ = 0x00; // literal header, not indexed
|
|
2774
|
+
*p++ = 11; // len(grpc-status)
|
|
2775
|
+
*p++ = 'g';
|
|
2776
|
+
*p++ = 'r';
|
|
2777
|
+
*p++ = 'p';
|
|
2778
|
+
*p++ = 'c';
|
|
2779
|
+
*p++ = '-';
|
|
2780
|
+
*p++ = 's';
|
|
2781
|
+
*p++ = 't';
|
|
2782
|
+
*p++ = 'a';
|
|
2783
|
+
*p++ = 't';
|
|
2784
|
+
*p++ = 'u';
|
|
2785
|
+
*p++ = 's';
|
|
2786
|
+
if (grpc_status < 10) {
|
|
2787
|
+
*p++ = 1;
|
|
2788
|
+
*p++ = static_cast<uint8_t>('0' + grpc_status);
|
|
2789
|
+
} else {
|
|
2790
|
+
*p++ = 2;
|
|
2791
|
+
*p++ = static_cast<uint8_t>('0' + (grpc_status / 10));
|
|
2792
|
+
*p++ = static_cast<uint8_t>('0' + (grpc_status % 10));
|
|
2793
|
+
}
|
|
2794
|
+
GRPC_CHECK(p == GRPC_SLICE_END_PTR(status_hdr));
|
|
2795
|
+
len += static_cast<uint32_t> GRPC_SLICE_LENGTH(status_hdr);
|
|
2796
|
+
|
|
2797
|
+
GRPC_CHECK(msg_len <= UINT32_MAX);
|
|
2798
|
+
grpc_core::VarintWriter<1> msg_len_writer(
|
|
2799
|
+
static_cast<uint32_t>(msg_len));
|
|
2800
|
+
message_pfx = GRPC_SLICE_MALLOC(14 + msg_len_writer.length());
|
|
2801
|
+
p = GRPC_SLICE_START_PTR(message_pfx);
|
|
2802
|
+
*p++ = 0x00; // literal header, not indexed
|
|
2803
|
+
*p++ = 12; // len(grpc-message)
|
|
2804
|
+
*p++ = 'g';
|
|
2805
|
+
*p++ = 'r';
|
|
2806
|
+
*p++ = 'p';
|
|
2807
|
+
*p++ = 'c';
|
|
2808
|
+
*p++ = '-';
|
|
2809
|
+
*p++ = 'm';
|
|
2810
|
+
*p++ = 'e';
|
|
2811
|
+
*p++ = 's';
|
|
2812
|
+
*p++ = 's';
|
|
2813
|
+
*p++ = 'a';
|
|
2814
|
+
*p++ = 'g';
|
|
2815
|
+
*p++ = 'e';
|
|
2816
|
+
msg_len_writer.Write(0, p);
|
|
2817
|
+
p += msg_len_writer.length();
|
|
2818
|
+
GRPC_CHECK(p == GRPC_SLICE_END_PTR(message_pfx));
|
|
2819
|
+
len += static_cast<uint32_t> GRPC_SLICE_LENGTH(message_pfx);
|
|
2820
|
+
len += static_cast<uint32_t>(msg_len);
|
|
2751
2821
|
}
|
|
2752
|
-
|
|
2753
|
-
len += static_cast<uint32_t> GRPC_SLICE_LENGTH(status_hdr);
|
|
2754
|
-
|
|
2755
|
-
size_t msg_len = message.length();
|
|
2756
|
-
GRPC_CHECK(msg_len <= UINT32_MAX);
|
|
2757
|
-
grpc_core::VarintWriter<1> msg_len_writer(
|
|
2758
|
-
static_cast<uint32_t>(msg_len));
|
|
2759
|
-
message_pfx = GRPC_SLICE_MALLOC(14 + msg_len_writer.length());
|
|
2760
|
-
p = GRPC_SLICE_START_PTR(message_pfx);
|
|
2761
|
-
*p++ = 0x00; // literal header, not indexed
|
|
2762
|
-
*p++ = 12; // len(grpc-message)
|
|
2763
|
-
*p++ = 'g';
|
|
2764
|
-
*p++ = 'r';
|
|
2765
|
-
*p++ = 'p';
|
|
2766
|
-
*p++ = 'c';
|
|
2767
|
-
*p++ = '-';
|
|
2768
|
-
*p++ = 'm';
|
|
2769
|
-
*p++ = 'e';
|
|
2770
|
-
*p++ = 's';
|
|
2771
|
-
*p++ = 's';
|
|
2772
|
-
*p++ = 'a';
|
|
2773
|
-
*p++ = 'g';
|
|
2774
|
-
*p++ = 'e';
|
|
2775
|
-
msg_len_writer.Write(0, p);
|
|
2776
|
-
p += msg_len_writer.length();
|
|
2777
|
-
GRPC_CHECK(p == GRPC_SLICE_END_PTR(message_pfx));
|
|
2778
|
-
len += static_cast<uint32_t> GRPC_SLICE_LENGTH(message_pfx);
|
|
2779
|
-
len += static_cast<uint32_t>(msg_len);
|
|
2822
|
+
GRPC_DCHECK(send_trailing_metadata == nullptr);
|
|
2780
2823
|
|
|
2781
2824
|
hdr = GRPC_SLICE_MALLOC(9);
|
|
2782
2825
|
p = GRPC_SLICE_START_PTR(hdr);
|
|
@@ -2797,10 +2840,13 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
|
2797
2840
|
grpc_slice_buffer_add(&t->qbuf, http_status_hdr);
|
|
2798
2841
|
grpc_slice_buffer_add(&t->qbuf, content_type_hdr);
|
|
2799
2842
|
}
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2843
|
+
if (grpc_core::IsPromiseFilterSendCancelMetadataEnabled()) {
|
|
2844
|
+
std::move(raw_encoder).Flush(&t->qbuf);
|
|
2845
|
+
} else {
|
|
2846
|
+
grpc_slice_buffer_add(&t->qbuf, status_hdr);
|
|
2847
|
+
grpc_slice_buffer_add(&t->qbuf, message_pfx);
|
|
2848
|
+
grpc_slice_buffer_add(&t->qbuf, message_slice.TakeCSlice());
|
|
2849
|
+
}
|
|
2804
2850
|
grpc_chttp2_reset_ping_clock(t);
|
|
2805
2851
|
grpc_chttp2_add_rst_stream_to_next_write(
|
|
2806
2852
|
t, id, static_cast<intptr_t>(Http2ErrorCode::kNoError), nullptr);
|
|
@@ -3668,6 +3714,10 @@ void grpc_chttp2_transport::MaybeNotifyOnReceiveSettingsLocked(
|
|
|
3668
3714
|
[notify_on_receive_settings = std::move(notify_on_receive_settings),
|
|
3669
3715
|
max_concurrent_streams]() mutable {
|
|
3670
3716
|
grpc_core::ExecCtx exec_ctx;
|
|
3671
|
-
|
|
3717
|
+
notify_on_receive_settings(max_concurrent_streams);
|
|
3718
|
+
// Ensure the captured callback is destroyed while ExecCtx is still
|
|
3719
|
+
// alive. Its destructor may trigger work that needs to schedule
|
|
3720
|
+
// closures on the ExecCtx.
|
|
3721
|
+
notify_on_receive_settings = nullptr;
|
|
3672
3722
|
});
|
|
3673
3723
|
}
|
|
@@ -135,6 +135,8 @@ class HttpAnnotation : public CallTracerAnnotationInterface::Annotation {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
std::string ToString() const override;
|
|
138
|
+
void ForEachKeyValue(
|
|
139
|
+
absl::FunctionRef<void(absl::string_view, ValueType)> f) const override;
|
|
138
140
|
|
|
139
141
|
Type http_type() const { return type_; }
|
|
140
142
|
gpr_timespec time() const { return time_; }
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
#include "src/core/lib/transport/bdp_estimator.h"
|
|
38
38
|
#include "src/core/util/grpc_check.h"
|
|
39
39
|
#include "src/core/util/time.h"
|
|
40
|
+
#include "absl/container/flat_hash_set.h"
|
|
40
41
|
#include "absl/functional/function_ref.h"
|
|
41
42
|
#include "absl/log/log.h"
|
|
42
43
|
#include "absl/status/status.h"
|
|
@@ -404,6 +405,14 @@ class TransportFlowControl final {
|
|
|
404
405
|
return stats;
|
|
405
406
|
}
|
|
406
407
|
|
|
408
|
+
void AddStreamToWindowUpdateList(const uint32_t stream_id) {
|
|
409
|
+
window_update_list_.insert(stream_id);
|
|
410
|
+
}
|
|
411
|
+
absl::flat_hash_set<uint32_t> DrainWindowUpdateList() {
|
|
412
|
+
return std::exchange(window_update_list_, {});
|
|
413
|
+
}
|
|
414
|
+
size_t window_update_list_size() const { return window_update_list_.size(); }
|
|
415
|
+
|
|
407
416
|
private:
|
|
408
417
|
friend class StreamFlowControl;
|
|
409
418
|
|
|
@@ -461,6 +470,7 @@ class TransportFlowControl final {
|
|
|
461
470
|
int64_t announced_window_ = kDefaultWindow;
|
|
462
471
|
uint32_t acked_init_window_ = kDefaultWindow;
|
|
463
472
|
uint32_t sent_init_window_ = kDefaultWindow;
|
|
473
|
+
absl::flat_hash_set<uint32_t> window_update_list_;
|
|
464
474
|
};
|
|
465
475
|
|
|
466
476
|
// Implementation of flow control that abides to HTTP/2 spec and attempts
|
|
@@ -599,7 +609,7 @@ class StreamFlowControl final {
|
|
|
599
609
|
return stats;
|
|
600
610
|
}
|
|
601
611
|
|
|
602
|
-
void ReportIfStalled(bool is_client, uint32_t stream_id,
|
|
612
|
+
void ReportIfStalled(const bool is_client, const uint32_t stream_id,
|
|
603
613
|
const Http2Settings& peer_settings) const {
|
|
604
614
|
if (remote_window_delta() + peer_settings.initial_window_size() <= 0 ||
|
|
605
615
|
tfc_->remote_window_ == 0) {
|
|
@@ -223,8 +223,7 @@ class SerializeHeaderAndPayload {
|
|
|
223
223
|
GRPC_HTTP2_FRAME_DLOG
|
|
224
224
|
<< "SerializeHeaderAndPayload Http2DataFrame Type:0 { stream_id:"
|
|
225
225
|
<< frame.stream_id << ", end_stream:" << frame.end_stream
|
|
226
|
-
<< ", payload_length:" << frame.payload.Length()
|
|
227
|
-
<< ", payload:" << MaybeTruncatePayload(frame.payload) << "}";
|
|
226
|
+
<< ", payload_length:" << frame.payload.Length() << "}";
|
|
228
227
|
auto hdr = extra_bytes_.TakeFirst(kFrameHeaderSize);
|
|
229
228
|
Http2FrameHeader{static_cast<uint32_t>(frame.payload.Length()),
|
|
230
229
|
static_cast<uint8_t>(FrameType::kData),
|
|
@@ -241,8 +240,7 @@ class SerializeHeaderAndPayload {
|
|
|
241
240
|
<< "SerializeHeaderAndPayload Http2HeaderFrame Type:1 { stream_id:"
|
|
242
241
|
<< frame.stream_id << ", end_headers:" << frame.end_headers
|
|
243
242
|
<< ", end_stream:" << frame.end_stream
|
|
244
|
-
<< ", payload_length:" << frame.payload.Length()
|
|
245
|
-
<< ", payload:" << MaybeTruncatePayload(frame.payload) << "}";
|
|
243
|
+
<< ", payload_length:" << frame.payload.Length() << "}";
|
|
246
244
|
auto hdr = extra_bytes_.TakeFirst(kFrameHeaderSize);
|
|
247
245
|
Http2FrameHeader{
|
|
248
246
|
static_cast<uint32_t>(frame.payload.Length()),
|
|
@@ -262,7 +260,6 @@ class SerializeHeaderAndPayload {
|
|
|
262
260
|
<< frame.stream_id
|
|
263
261
|
<< ", end_headers:" << frame.end_headers
|
|
264
262
|
<< ", payload_length:" << frame.payload.Length()
|
|
265
|
-
<< ", payload:" << MaybeTruncatePayload(frame.payload)
|
|
266
263
|
<< "}";
|
|
267
264
|
auto hdr = extra_bytes_.TakeFirst(kFrameHeaderSize);
|
|
268
265
|
Http2FrameHeader{
|
|
@@ -880,14 +877,4 @@ Http2Status ValidateFrameHeader(const uint32_t max_frame_size_setting,
|
|
|
880
877
|
// for server.
|
|
881
878
|
return Http2Status::Ok();
|
|
882
879
|
}
|
|
883
|
-
|
|
884
|
-
std::string MaybeTruncatePayload(SliceBuffer& payload, const uint32_t length) {
|
|
885
|
-
if (payload.Length() <= length) {
|
|
886
|
-
return payload.JoinIntoString();
|
|
887
|
-
}
|
|
888
|
-
std::string result(length, '\0');
|
|
889
|
-
payload.CopyFirstNBytesIntoBuffer(length, result.data());
|
|
890
|
-
return absl::StrCat(result, "<clipped>");
|
|
891
|
-
}
|
|
892
|
-
|
|
893
880
|
} // namespace grpc_core
|
|
@@ -32,10 +32,6 @@
|
|
|
32
32
|
|
|
33
33
|
namespace grpc_core {
|
|
34
34
|
|
|
35
|
-
// Prints the first `length` bytes of the payload. If the payload is longer than
|
|
36
|
-
// `length`, it appends "<clipped>" to the output.
|
|
37
|
-
std::string MaybeTruncatePayload(SliceBuffer& payload, uint32_t length = 15);
|
|
38
|
-
|
|
39
35
|
///////////////////////////////////////////////////////////////////////////////
|
|
40
36
|
// Frame types
|
|
41
37
|
//
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
|
|
19
19
|
#include "src/core/ext/transport/chttp2/transport/goaway.h"
|
|
20
20
|
|
|
21
|
+
#include <utility>
|
|
22
|
+
|
|
23
|
+
#include "src/core/ext/transport/chttp2/transport/write_cycle.h"
|
|
21
24
|
#include "src/core/util/grpc_check.h"
|
|
22
25
|
|
|
23
26
|
namespace grpc_core {
|
|
@@ -57,14 +60,14 @@ std::optional<Http2Frame> GoawayManager::MaybeGetGoawayFrame() {
|
|
|
57
60
|
return std::nullopt;
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
void GoawayManager::MaybeGetSerializedGoawayFrame(
|
|
63
|
+
void GoawayManager::MaybeGetSerializedGoawayFrame(FrameSender& frame_sender) {
|
|
61
64
|
GRPC_HTTP2_GOAWAY_LOG << "MaybeGetSerializedGoawayFrames: current state: "
|
|
62
65
|
<< context_->GoawayStateToString(
|
|
63
66
|
context_->goaway_state);
|
|
64
67
|
|
|
65
68
|
std::optional<Http2Frame> goaway_frame = MaybeGetGoawayFrame();
|
|
66
69
|
if (goaway_frame.has_value()) {
|
|
67
|
-
|
|
70
|
+
frame_sender.AddRegularFrame(std::move(goaway_frame.value()));
|
|
68
71
|
GRPC_HTTP2_GOAWAY_LOG << "GOAWAY frame serialized.";
|
|
69
72
|
}
|
|
70
73
|
}
|
|
@@ -117,6 +120,18 @@ std::string GoawayManager::Context::GoawayStateToString(
|
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
122
|
|
|
123
|
+
absl::Status GoawayManager::Context::TriggerWriteCycle() {
|
|
124
|
+
GRPC_HTTP2_GOAWAY_LOG << "TriggerWriteCycle: current state: "
|
|
125
|
+
<< GoawayStateToString(goaway_state);
|
|
126
|
+
absl::Status status = goaway_interface->TriggerWriteCycle();
|
|
127
|
+
if (!status.ok()) {
|
|
128
|
+
GRPC_HTTP2_GOAWAY_LOG << "TriggerWriteCycle failed with status: " << status;
|
|
129
|
+
goaway_state = GoawayState::kDone;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return status;
|
|
133
|
+
}
|
|
134
|
+
|
|
120
135
|
std::optional<Http2Frame> GoawayManager::TestOnlyMaybeGetGoawayFrame() {
|
|
121
136
|
GRPC_HTTP2_GOAWAY_LOG << "TestOnlyMaybeGetGoawayFrame: current state: "
|
|
122
137
|
<< context_->GoawayStateToString(
|
|
@@ -19,8 +19,12 @@
|
|
|
19
19
|
#ifndef GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_GOAWAY_H
|
|
20
20
|
#define GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_GOAWAY_H
|
|
21
21
|
|
|
22
|
+
#include <cstdint>
|
|
23
|
+
#include <optional>
|
|
24
|
+
|
|
22
25
|
#include "src/core/ext/transport/chttp2/transport/frame.h"
|
|
23
26
|
#include "src/core/ext/transport/chttp2/transport/http2_status.h"
|
|
27
|
+
#include "src/core/ext/transport/chttp2/transport/write_cycle.h"
|
|
24
28
|
#include "src/core/lib/promise/activity.h"
|
|
25
29
|
#include "src/core/lib/promise/if.h"
|
|
26
30
|
#include "src/core/lib/promise/promise.h"
|
|
@@ -47,7 +51,7 @@ class GoawayInterface {
|
|
|
47
51
|
virtual Promise<absl::Status> SendPingAndWaitForAck() = 0;
|
|
48
52
|
|
|
49
53
|
// Triggers a transport write cycle.
|
|
50
|
-
virtual
|
|
54
|
+
virtual absl::Status TriggerWriteCycle() = 0;
|
|
51
55
|
|
|
52
56
|
// Only used for graceful GOAWAY (and by extension relevant only for server).
|
|
53
57
|
// Returns the last accepted stream id by the transport.
|
|
@@ -154,6 +158,7 @@ class GoawayManager {
|
|
|
154
158
|
std::string GoawayStateToString(GoawayState goaway_state);
|
|
155
159
|
|
|
156
160
|
void SentGoawayTransition();
|
|
161
|
+
absl::Status TriggerWriteCycle();
|
|
157
162
|
|
|
158
163
|
GoawayState goaway_state = GoawayState::kIdle;
|
|
159
164
|
std::unique_ptr<GoawayInterface> goaway_interface;
|
|
@@ -222,7 +227,10 @@ class GoawayManager {
|
|
|
222
227
|
/*error_code=*/static_cast<uint32_t>(error_code),
|
|
223
228
|
/*debug_data=*/debug_data.TakeOwned(),
|
|
224
229
|
/*last_good_stream_id=*/last_good_stream_id);
|
|
225
|
-
ctx->
|
|
230
|
+
absl::Status status = ctx->TriggerWriteCycle();
|
|
231
|
+
if (!status.ok()) {
|
|
232
|
+
return status;
|
|
233
|
+
}
|
|
226
234
|
return Pending{};
|
|
227
235
|
};
|
|
228
236
|
}
|
|
@@ -272,8 +280,11 @@ class GoawayManager {
|
|
|
272
280
|
/*error_code=*/static_cast<uint32_t>(Http2ErrorCode::kNoError),
|
|
273
281
|
/*debug_data=*/debug_data.TakeOwned(),
|
|
274
282
|
/*last_good_stream_id=*/last_good_stream_id);
|
|
275
|
-
|
|
276
|
-
return TrySeq(ctx->
|
|
283
|
+
|
|
284
|
+
return TrySeq([ctx]() { return ctx->TriggerWriteCycle(); },
|
|
285
|
+
[ctx]() {
|
|
286
|
+
return ctx->goaway_interface->SendPingAndWaitForAck();
|
|
287
|
+
},
|
|
277
288
|
[ctx]() -> Poll<absl::Status> {
|
|
278
289
|
GRPC_HTTP2_GOAWAY_LOG
|
|
279
290
|
<< "Ping resolved. Current state: "
|
|
@@ -287,7 +298,11 @@ class GoawayManager {
|
|
|
287
298
|
"kFinalGracefulGoawayScheduled.";
|
|
288
299
|
ctx->goaway_state =
|
|
289
300
|
GoawayState::kFinalGracefulGoawayScheduled;
|
|
290
|
-
|
|
301
|
+
absl::Status status =
|
|
302
|
+
ctx->goaway_interface->TriggerWriteCycle();
|
|
303
|
+
if (!status.ok()) {
|
|
304
|
+
return status;
|
|
305
|
+
}
|
|
291
306
|
}
|
|
292
307
|
return Pending{};
|
|
293
308
|
});
|
|
@@ -328,7 +343,7 @@ class GoawayManager {
|
|
|
328
343
|
|
|
329
344
|
// Called from the transport write cycle to serialize the GOAWAY frame if
|
|
330
345
|
// needed.
|
|
331
|
-
void MaybeGetSerializedGoawayFrame(
|
|
346
|
+
void MaybeGetSerializedGoawayFrame(FrameSender& frame_sender);
|
|
332
347
|
|
|
333
348
|
bool IsImmediateGoAway() const {
|
|
334
349
|
return context_->goaway_state == GoawayState::kImmediateGoawayRequested;
|
|
@@ -339,6 +354,12 @@ class GoawayManager {
|
|
|
339
354
|
// write cycle, this function handles the needed state transition.
|
|
340
355
|
void NotifyGoawaySent();
|
|
341
356
|
|
|
357
|
+
static bool IsGracefulGoaway(Http2GoawayFrame& frame) {
|
|
358
|
+
return frame.error_code ==
|
|
359
|
+
static_cast<uint32_t>(Http2ErrorCode::kNoError) &&
|
|
360
|
+
frame.last_stream_id == RFC9113::kMaxStreamId31Bit;
|
|
361
|
+
}
|
|
362
|
+
|
|
342
363
|
// Returns the current GOAWAY state.
|
|
343
364
|
GoawayState TestOnlyGetGoawayState() const { return context_->goaway_state; }
|
|
344
365
|
std::optional<Http2Frame> TestOnlyMaybeGetGoawayFrame();
|
|
@@ -57,21 +57,6 @@ constexpr absl::string_view kAssemblerHpackError =
|
|
|
57
57
|
"RFC9113 : A decoding error in a field block MUST be treated as a "
|
|
58
58
|
"connection error of type COMPRESSION_ERROR.";
|
|
59
59
|
|
|
60
|
-
constexpr absl::string_view kGrpcErrorMaxTwoHeaderFrames =
|
|
61
|
-
"Too many header frames sent by peer";
|
|
62
|
-
|
|
63
|
-
// A gRPC server is permitted to send both initial metadata and trailing
|
|
64
|
-
// metadata where initial metadata is optional. A gRPC C++ client is permitted
|
|
65
|
-
// to send only initial metadata. However, other gRPC Client implementations may
|
|
66
|
-
// send trailing metadata too. So we allow only a maximum of 2 metadata per
|
|
67
|
-
// streams. Which means only 2 HEADER frames are legal per stream.
|
|
68
|
-
constexpr uint8_t kMaxHeaderFrames = 2;
|
|
69
|
-
|
|
70
|
-
// TODO(tjagtap) : [PH2][P3] : Handle the case where a Server receives two
|
|
71
|
-
// header frames. Which means that the client sent trailing metadata. While we
|
|
72
|
-
// dont expect a gRPC C++ peer to behave like this, this might break interop
|
|
73
|
-
// tests and genuine interop cases.
|
|
74
|
-
|
|
75
60
|
// RFC9113
|
|
76
61
|
// https://www.rfc-editor.org/rfc/rfc9113.html#name-field-section-compression-a
|
|
77
62
|
// A complete field section (which contains our gRPC Metadata) consists of
|
|
@@ -154,7 +139,7 @@ class HeaderAssembler {
|
|
|
154
139
|
|
|
155
140
|
// The caller MUST check using IsReady() before calling this function
|
|
156
141
|
ValueOrHttp2Status<Arena::PoolPtr<grpc_metadata_batch>> ReadMetadata(
|
|
157
|
-
HPackParser& parser, bool is_initial_metadata,
|
|
142
|
+
HPackParser& parser, bool is_initial_metadata,
|
|
158
143
|
const uint32_t max_header_list_size_soft_limit,
|
|
159
144
|
const uint32_t max_header_list_size_hard_limit) {
|
|
160
145
|
ASSEMBLER_LOG << "HeaderAssembler::ReadMetadata " << buffer_.Length()
|
|
@@ -185,7 +170,7 @@ class HeaderAssembler {
|
|
|
185
170
|
ParseHeaderArgs{
|
|
186
171
|
/*is_initial_metadata=*/is_initial_metadata,
|
|
187
172
|
/*is_end_headers=*/is_ready_,
|
|
188
|
-
/*is_client=*/
|
|
173
|
+
/*is_client=*/is_client_,
|
|
189
174
|
/*max_header_list_size_soft_limit=*/max_header_list_size_soft_limit,
|
|
190
175
|
/*max_header_list_size_hard_limit=*/max_header_list_size_hard_limit,
|
|
191
176
|
/*stream_id=*/stream_id_,
|
|
@@ -199,13 +184,13 @@ class HeaderAssembler {
|
|
|
199
184
|
}
|
|
200
185
|
|
|
201
186
|
Http2Status ParseAndDiscardHeaders(
|
|
202
|
-
HPackParser& parser, const bool is_initial_metadata,
|
|
187
|
+
HPackParser& parser, const bool is_initial_metadata,
|
|
203
188
|
const uint32_t max_header_list_size_soft_limit,
|
|
204
189
|
const uint32_t max_header_list_size_hard_limit) {
|
|
205
190
|
ASSEMBLER_LOG << "HeaderAssembler::ParseAndDiscardHeaders "
|
|
206
191
|
<< buffer_.Length() << " Bytes"
|
|
207
192
|
<< " is_initial_metadata: " << is_initial_metadata
|
|
208
|
-
<< " is_client: " <<
|
|
193
|
+
<< " is_client: " << is_client_
|
|
209
194
|
<< " max_header_list_size_soft_limit: "
|
|
210
195
|
<< max_header_list_size_soft_limit
|
|
211
196
|
<< "max_header_list_size_hard_limit: "
|
|
@@ -215,7 +200,7 @@ class HeaderAssembler {
|
|
|
215
200
|
ParseHeaderArgs{
|
|
216
201
|
/*is_initial_metadata=*/is_initial_metadata,
|
|
217
202
|
/*is_end_headers=*/is_ready_,
|
|
218
|
-
/*is_client=*/
|
|
203
|
+
/*is_client=*/is_client_,
|
|
219
204
|
/*max_header_list_size_soft_limit=*/max_header_list_size_soft_limit,
|
|
220
205
|
/*max_header_list_size_hard_limit=*/max_header_list_size_hard_limit,
|
|
221
206
|
/*stream_id=*/stream_id_,
|
|
@@ -229,10 +214,11 @@ class HeaderAssembler {
|
|
|
229
214
|
// This value MUST be checked before calling ReadMetadata()
|
|
230
215
|
bool IsReady() const { return is_ready_; }
|
|
231
216
|
|
|
232
|
-
explicit HeaderAssembler()
|
|
217
|
+
explicit HeaderAssembler(const bool is_client)
|
|
233
218
|
: header_in_progress_(false),
|
|
234
219
|
is_ready_(false),
|
|
235
220
|
allow_true_binary_metadata_acked_(true),
|
|
221
|
+
is_client_(is_client),
|
|
236
222
|
stream_id_(0) {}
|
|
237
223
|
|
|
238
224
|
~HeaderAssembler() = default;
|
|
@@ -338,6 +324,7 @@ class HeaderAssembler {
|
|
|
338
324
|
bool header_in_progress_;
|
|
339
325
|
bool is_ready_;
|
|
340
326
|
bool allow_true_binary_metadata_acked_;
|
|
327
|
+
const bool is_client_;
|
|
341
328
|
uint32_t stream_id_;
|
|
342
329
|
SliceBuffer buffer_;
|
|
343
330
|
};
|