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
|
@@ -100,6 +100,7 @@ Http2ErrorCode Http2Settings::Apply(uint16_t key, uint32_t value) {
|
|
|
100
100
|
enable_push_ = value != 0;
|
|
101
101
|
break;
|
|
102
102
|
case kMaxConcurrentStreamsWireId:
|
|
103
|
+
initial_max_concurrent_streams_ = value;
|
|
103
104
|
max_concurrent_streams_ = value;
|
|
104
105
|
break;
|
|
105
106
|
case kInitialWindowSizeWireId:
|
|
@@ -67,7 +67,13 @@ class Http2Settings {
|
|
|
67
67
|
bool allow_security_frame() const { return allow_security_frame_; }
|
|
68
68
|
|
|
69
69
|
void SetHeaderTableSize(uint32_t x) { header_table_size_ = x; }
|
|
70
|
-
void SetMaxConcurrentStreams(uint32_t x) {
|
|
70
|
+
void SetMaxConcurrentStreams(uint32_t x) {
|
|
71
|
+
initial_max_concurrent_streams_ = x;
|
|
72
|
+
max_concurrent_streams_ = x;
|
|
73
|
+
}
|
|
74
|
+
void UpdateMaxConcurrentStreams(uint32_t x) {
|
|
75
|
+
max_concurrent_streams_ = std::min(x, initial_max_concurrent_streams_);
|
|
76
|
+
}
|
|
71
77
|
void SetInitialWindowSize(uint32_t x) {
|
|
72
78
|
initial_window_size_ = std::min(x, max_initial_window_size());
|
|
73
79
|
}
|
|
@@ -161,6 +167,7 @@ class Http2Settings {
|
|
|
161
167
|
// to 0 for client.
|
|
162
168
|
// SERVER : This setting can change for the server. This is usually changed to
|
|
163
169
|
// handle memory pressure.
|
|
170
|
+
uint32_t initial_max_concurrent_streams_ = 4294967295u;
|
|
164
171
|
uint32_t max_concurrent_streams_ = 4294967295u;
|
|
165
172
|
|
|
166
173
|
// RFC9113 states the default for SETTINGS_INITIAL_WINDOW_SIZE
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
|
|
36
36
|
#include "src/core/ext/transport/chttp2/transport/http2_settings_manager.h"
|
|
37
37
|
#include "src/core/ext/transport/chttp2/transport/http2_status.h"
|
|
38
|
+
#include "src/core/ext/transport/chttp2/transport/write_cycle.h"
|
|
38
39
|
#include "src/core/lib/channel/channel_args.h"
|
|
39
40
|
#include "src/core/lib/iomgr/exec_ctx.h"
|
|
40
41
|
#include "src/core/lib/promise/activity.h"
|
|
@@ -208,12 +209,14 @@ class SettingsPromiseManager final : public RefCounted<SettingsPromiseManager> {
|
|
|
208
209
|
// written to apply the settings. If the first settings frame is received from
|
|
209
210
|
// the peer that that needs some special handling too.
|
|
210
211
|
http2::Http2ErrorCode MaybeReportAndApplyBufferedPeerSettings(
|
|
211
|
-
grpc_event_engine::experimental::EventEngine* event_engine
|
|
212
|
+
grpc_event_engine::experimental::EventEngine* event_engine,
|
|
213
|
+
bool& should_spawn_security_frame_loop) {
|
|
212
214
|
http2::Http2ErrorCode status = settings_.ApplyIncomingSettings(
|
|
213
215
|
std::exchange(pending_peer_settings_, {}));
|
|
214
216
|
if (state_ == SettingsState::kFirstPeerSettingsReceived) {
|
|
215
217
|
MaybeReportInitialSettings(event_engine);
|
|
216
218
|
state_ = SettingsState::kReady;
|
|
219
|
+
should_spawn_security_frame_loop = IsSecurityFrameExpected();
|
|
217
220
|
}
|
|
218
221
|
return status;
|
|
219
222
|
}
|
|
@@ -227,15 +230,15 @@ class SettingsPromiseManager final : public RefCounted<SettingsPromiseManager> {
|
|
|
227
230
|
// acknowledgment. This MUST be called only after the
|
|
228
231
|
// MaybeReportAndApplyBufferedPeerSettings function.
|
|
229
232
|
void MaybeGetSettingsAndSettingsAckFrames(
|
|
230
|
-
chttp2::TransportFlowControl& flow_control,
|
|
233
|
+
chttp2::TransportFlowControl& flow_control,
|
|
234
|
+
http2::FrameSender& frame_sender) {
|
|
231
235
|
GRPC_SETTINGS_TIMEOUT_DLOG << "MaybeGetSettingsAndSettingsAckFrames";
|
|
232
236
|
if (did_previous_settings_promise_resolve_) {
|
|
233
237
|
std::optional<Http2Frame> settings_frame = settings_.MaybeSendUpdate();
|
|
234
238
|
if (settings_frame.has_value()) {
|
|
235
239
|
GRPC_SETTINGS_TIMEOUT_DLOG
|
|
236
240
|
<< "MaybeGetSettingsAndSettingsAckFrames Frame Settings ";
|
|
237
|
-
|
|
238
|
-
output_buf);
|
|
241
|
+
frame_sender.AddRegularFrame(std::move(*settings_frame));
|
|
239
242
|
flow_control.FlushedSettings();
|
|
240
243
|
WillSendSettings();
|
|
241
244
|
}
|
|
@@ -243,11 +246,11 @@ class SettingsPromiseManager final : public RefCounted<SettingsPromiseManager> {
|
|
|
243
246
|
if (num_acks_to_send_ > 0) {
|
|
244
247
|
GRPC_SETTINGS_TIMEOUT_DLOG << "Sending " << num_acks_to_send_
|
|
245
248
|
<< " settings ACK frames";
|
|
246
|
-
|
|
249
|
+
frame_sender.ReserveRegularFrames(num_acks_to_send_);
|
|
247
250
|
for (uint32_t i = 0; i < num_acks_to_send_; ++i) {
|
|
248
|
-
|
|
251
|
+
frame_sender.AddRegularFrame(Http2SettingsFrame{true, {}});
|
|
249
252
|
}
|
|
250
|
-
|
|
253
|
+
|
|
251
254
|
num_acks_to_send_ = 0;
|
|
252
255
|
}
|
|
253
256
|
}
|
|
@@ -259,6 +262,9 @@ class SettingsPromiseManager final : public RefCounted<SettingsPromiseManager> {
|
|
|
259
262
|
const Http2Settings& acked() const { return settings_.acked(); }
|
|
260
263
|
const Http2Settings& peer() const { return settings_.peer(); }
|
|
261
264
|
|
|
265
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
266
|
+
// ChannelZ and Security Frame Stuff
|
|
267
|
+
|
|
262
268
|
channelz::PropertyGrid ChannelzProperties() const {
|
|
263
269
|
return settings_.ChannelzProperties();
|
|
264
270
|
}
|
|
@@ -268,8 +274,7 @@ class SettingsPromiseManager final : public RefCounted<SettingsPromiseManager> {
|
|
|
268
274
|
<< "Security frame must not be received before SETTINGS frame";
|
|
269
275
|
// TODO(tjagtap) : [PH2][P3] : Evaluate when to accept the frame and when to
|
|
270
276
|
// reject it. Compare it with the requirement and with CHTTP2.
|
|
271
|
-
return (settings_.
|
|
272
|
-
settings_.local().allow_security_frame()) &&
|
|
277
|
+
return (settings_.local().allow_security_frame()) &&
|
|
273
278
|
settings_.peer().allow_security_frame();
|
|
274
279
|
};
|
|
275
280
|
|
|
@@ -291,7 +296,11 @@ class SettingsPromiseManager final : public RefCounted<SettingsPromiseManager> {
|
|
|
291
296
|
peer_max_concurrent_streams =
|
|
292
297
|
settings_.peer().max_concurrent_streams()]() mutable {
|
|
293
298
|
ExecCtx exec_ctx;
|
|
294
|
-
|
|
299
|
+
on_receive_settings(peer_max_concurrent_streams);
|
|
300
|
+
// Ensure the captured callback is destroyed while ExecCtx is still
|
|
301
|
+
// alive. Its destructor may trigger work that needs to schedule
|
|
302
|
+
// closures on the ExecCtx.
|
|
303
|
+
on_receive_settings = nullptr;
|
|
295
304
|
});
|
|
296
305
|
GRPC_DCHECK(on_receive_first_settings_ == nullptr);
|
|
297
306
|
}
|
|
@@ -307,8 +316,11 @@ class SettingsPromiseManager final : public RefCounted<SettingsPromiseManager> {
|
|
|
307
316
|
event_engine->Run([on_receive_settings =
|
|
308
317
|
std::move(on_receive_first_settings_)]() mutable {
|
|
309
318
|
ExecCtx exec_ctx;
|
|
310
|
-
|
|
311
|
-
|
|
319
|
+
on_receive_settings(absl::UnavailableError("transport closed"));
|
|
320
|
+
// Ensure the captured callback is destroyed while ExecCtx is still
|
|
321
|
+
// alive. Its destructor may trigger work that needs to schedule
|
|
322
|
+
// closures on the ExecCtx.
|
|
323
|
+
on_receive_settings = nullptr;
|
|
312
324
|
});
|
|
313
325
|
GRPC_DCHECK(on_receive_first_settings_ == nullptr);
|
|
314
326
|
}
|
|
@@ -385,8 +397,8 @@ class SettingsPromiseManager final : public RefCounted<SettingsPromiseManager> {
|
|
|
385
397
|
// better debuggability.
|
|
386
398
|
Timestamp sent_time_ = Timestamp::InfFuture();
|
|
387
399
|
Waker ack_timeout_waker_;
|
|
388
|
-
bool did_register_ack_timeout_waker_ = false;
|
|
389
400
|
int number_of_acks_unprocessed_ = 0;
|
|
401
|
+
bool did_register_ack_timeout_waker_ = false;
|
|
390
402
|
bool should_wait_for_settings_ack_ = false;
|
|
391
403
|
|
|
392
404
|
// For CHTTP2, MaybeSendUpdate() checks `update_state_` to ensure only one
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
#include "src/core/ext/transport/chttp2/transport/http2_transport.h"
|
|
20
20
|
|
|
21
|
+
#include <grpc/event_engine/event_engine.h>
|
|
21
22
|
#include <grpc/grpc.h>
|
|
22
23
|
#include <grpc/impl/channel_arg_names.h>
|
|
23
24
|
|
|
@@ -37,11 +38,11 @@
|
|
|
37
38
|
#include "src/core/ext/transport/chttp2/transport/header_assembler.h"
|
|
38
39
|
#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
|
|
39
40
|
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
|
|
40
|
-
#include "src/core/ext/transport/chttp2/transport/http2_settings_manager.h"
|
|
41
41
|
#include "src/core/ext/transport/chttp2/transport/http2_settings_promises.h"
|
|
42
42
|
#include "src/core/ext/transport/chttp2/transport/http2_status.h"
|
|
43
43
|
#include "src/core/ext/transport/chttp2/transport/internal_channel_arg_names.h"
|
|
44
44
|
#include "src/core/ext/transport/chttp2/transport/stream.h"
|
|
45
|
+
#include "src/core/ext/transport/chttp2/transport/write_cycle.h"
|
|
45
46
|
#include "src/core/lib/channel/channel_args.h"
|
|
46
47
|
#include "src/core/lib/event_engine/tcp_socket_utils.h"
|
|
47
48
|
#include "src/core/lib/slice/slice_buffer.h"
|
|
@@ -49,7 +50,8 @@
|
|
|
49
50
|
#include "src/core/util/ref_counted_ptr.h"
|
|
50
51
|
#include "src/core/util/time.h"
|
|
51
52
|
#include "absl/log/log.h"
|
|
52
|
-
#include "absl/
|
|
53
|
+
#include "absl/status/status.h"
|
|
54
|
+
#include "absl/strings/str_cat.h"
|
|
53
55
|
|
|
54
56
|
namespace grpc_core {
|
|
55
57
|
namespace http2 {
|
|
@@ -86,13 +88,33 @@ constexpr Duration kServerKeepaliveTime = Duration::Hours(2);
|
|
|
86
88
|
// Do not use or edit any of these functions unless you are
|
|
87
89
|
// familiar with the PH2 project (Moving chttp2 to promises.)
|
|
88
90
|
|
|
91
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
92
|
+
// Read and Write helpers
|
|
93
|
+
|
|
94
|
+
// This is only called by the HTTP2 Server Transport to validate the incoming
|
|
95
|
+
// connection preface. Since a server does not send a connection preface, this
|
|
96
|
+
// validation is not needed for the client transport.
|
|
97
|
+
Http2Status ValidateIncomingConnectionPreface(
|
|
98
|
+
const absl::StatusOr<Slice>& status) {
|
|
99
|
+
if (!status.ok()) {
|
|
100
|
+
return ToHttpOkOrConnError(status.status());
|
|
101
|
+
} else if (status.value() !=
|
|
102
|
+
Slice::FromStaticString(GRPC_CHTTP2_CLIENT_CONNECT_STRING)) {
|
|
103
|
+
return Http2Status::Http2ConnectionError(
|
|
104
|
+
Http2ErrorCode::kProtocolError,
|
|
105
|
+
std::string(RFC9113::kFirstSettingsFrameServer));
|
|
106
|
+
}
|
|
107
|
+
return Http2Status::Ok();
|
|
108
|
+
}
|
|
109
|
+
|
|
89
110
|
///////////////////////////////////////////////////////////////////////////////
|
|
90
111
|
// Settings helpers
|
|
91
112
|
|
|
92
113
|
void InitLocalSettings(Http2Settings& settings, const bool is_client) {
|
|
93
114
|
if (is_client) {
|
|
94
115
|
// gRPC has never supported PUSH_PROMISE and we have no plan to do so in the
|
|
95
|
-
// future.
|
|
116
|
+
// future. We are not setting this to false for Server to be consistent
|
|
117
|
+
// with the legacy CHTTP2 transport.
|
|
96
118
|
settings.SetEnablePush(false);
|
|
97
119
|
// This is to make it double-sure that server cannot initiate a stream.
|
|
98
120
|
settings.SetMaxConcurrentStreams(0);
|
|
@@ -103,6 +125,21 @@ void InitLocalSettings(Http2Settings& settings, const bool is_client) {
|
|
|
103
125
|
|
|
104
126
|
////////////////////////////////////////////////////////////////////////////////
|
|
105
127
|
// Channel Args helpers
|
|
128
|
+
|
|
129
|
+
std::string TransportChannelArgs::DebugString() const {
|
|
130
|
+
return absl::StrCat(
|
|
131
|
+
"keepalive_time: ", keepalive_time,
|
|
132
|
+
" keepalive_timeout: ", keepalive_timeout,
|
|
133
|
+
" ping_timeout: ", ping_timeout, " settings_timeout: ", settings_timeout,
|
|
134
|
+
" keepalive_permit_without_calls: ", keepalive_permit_without_calls,
|
|
135
|
+
" enable_preferred_rx_crypto_frame_advertisement: ",
|
|
136
|
+
enable_preferred_rx_crypto_frame_advertisement,
|
|
137
|
+
" max_header_list_size_soft_limit: ", max_header_list_size_soft_limit,
|
|
138
|
+
" max_usable_hpack_table_size: ", max_usable_hpack_table_size,
|
|
139
|
+
" initial_sequence_number: ", initial_sequence_number,
|
|
140
|
+
" test_only_ack_pings: ", test_only_ack_pings);
|
|
141
|
+
}
|
|
142
|
+
|
|
106
143
|
void ReadChannelArgs(const ChannelArgs& channel_args,
|
|
107
144
|
TransportChannelArgs& args, Http2Settings& local_settings,
|
|
108
145
|
chttp2::TransportFlowControl& flow_control,
|
|
@@ -276,7 +313,7 @@ void ProcessOutgoingDataFrameFlowControl(
|
|
|
276
313
|
ValueOrHttp2Status<chttp2::FlowControlAction>
|
|
277
314
|
ProcessIncomingDataFrameFlowControl(Http2FrameHeader& frame_header,
|
|
278
315
|
chttp2::TransportFlowControl& flow_control,
|
|
279
|
-
|
|
316
|
+
Stream* stream) {
|
|
280
317
|
GRPC_DCHECK_EQ(frame_header.type, 0u);
|
|
281
318
|
if (frame_header.length > 0) {
|
|
282
319
|
if (stream == nullptr) {
|
|
@@ -301,7 +338,7 @@ ProcessIncomingDataFrameFlowControl(Http2FrameHeader& frame_header,
|
|
|
301
338
|
return action;
|
|
302
339
|
} else {
|
|
303
340
|
chttp2::StreamFlowControl::IncomingUpdateContext stream_fc(
|
|
304
|
-
&stream->
|
|
341
|
+
&stream->GetStreamFlowControl());
|
|
305
342
|
absl::Status fc_status = stream_fc.RecvData(frame_header.length);
|
|
306
343
|
chttp2::FlowControlAction action = stream_fc.MakeAction();
|
|
307
344
|
GRPC_HTTP2_COMMON_DLOG
|
|
@@ -325,14 +362,14 @@ ProcessIncomingDataFrameFlowControl(Http2FrameHeader& frame_header,
|
|
|
325
362
|
|
|
326
363
|
bool ProcessIncomingWindowUpdateFrameFlowControl(
|
|
327
364
|
const Http2WindowUpdateFrame& frame,
|
|
328
|
-
chttp2::TransportFlowControl& flow_control,
|
|
365
|
+
chttp2::TransportFlowControl& flow_control, Stream* stream) {
|
|
329
366
|
if (frame.stream_id != 0) {
|
|
330
367
|
if (stream != nullptr) {
|
|
331
368
|
GRPC_HTTP2_COMMON_DLOG
|
|
332
369
|
<< "ProcessIncomingWindowUpdateFrameFlowControl stream "
|
|
333
370
|
<< frame.stream_id << " increment " << frame.increment;
|
|
334
371
|
chttp2::StreamFlowControl::OutgoingUpdateContext fc_update(
|
|
335
|
-
&stream->
|
|
372
|
+
&stream->GetStreamFlowControl());
|
|
336
373
|
fc_update.RecvUpdate(frame.increment);
|
|
337
374
|
} else {
|
|
338
375
|
// If stream id is non zero, and stream is nullptr, maybe the stream was
|
|
@@ -362,25 +399,36 @@ bool ProcessIncomingWindowUpdateFrameFlowControl(
|
|
|
362
399
|
return false;
|
|
363
400
|
}
|
|
364
401
|
|
|
365
|
-
void
|
|
366
|
-
|
|
402
|
+
void MaybeAddTransportWindowUpdateFrame(
|
|
403
|
+
chttp2::TransportFlowControl& flow_control, FrameSender& frame_sender) {
|
|
404
|
+
uint32_t window_size =
|
|
405
|
+
flow_control.DesiredAnnounceSize(/*writing_anyway=*/true);
|
|
406
|
+
if (window_size > 0) {
|
|
407
|
+
GRPC_HTTP2_COMMON_DLOG
|
|
408
|
+
<< "MaybeGetWindowUpdateFrames Transport Window Update : "
|
|
409
|
+
<< window_size;
|
|
410
|
+
frame_sender.AddRegularFrame(
|
|
411
|
+
Http2WindowUpdateFrame{/*stream_id=*/0, window_size});
|
|
412
|
+
flow_control.SentUpdate(window_size);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
void MaybeAddStreamWindowUpdateFrame(Stream& stream,
|
|
417
|
+
FrameSender& frame_sender) {
|
|
367
418
|
GRPC_HTTP2_COMMON_DLOG << "MaybeAddStreamWindowUpdateFrame stream="
|
|
368
|
-
<< (
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
stream->CanSendWindowUpdateFrames()));
|
|
374
|
-
if (stream != nullptr && stream->CanSendWindowUpdateFrames()) {
|
|
375
|
-
const uint32_t increment = stream->flow_control.MaybeSendUpdate();
|
|
419
|
+
<< stream.GetStreamId()
|
|
420
|
+
<< " CanSendWindowUpdateFrames="
|
|
421
|
+
<< stream.CanSendWindowUpdateFrames();
|
|
422
|
+
if (stream.CanSendWindowUpdateFrames()) {
|
|
423
|
+
const uint32_t increment = stream.GetStreamFlowControl().MaybeSendUpdate();
|
|
376
424
|
GRPC_HTTP2_COMMON_DLOG
|
|
377
425
|
<< "MaybeAddStreamWindowUpdateFrame MaybeSendUpdate { "
|
|
378
|
-
<< stream
|
|
426
|
+
<< stream.GetStreamId() << ", " << increment << " }"
|
|
379
427
|
<< (increment == 0 ? ". The frame will NOT be sent for increment 0"
|
|
380
428
|
: "");
|
|
381
429
|
if (increment > 0) {
|
|
382
|
-
|
|
383
|
-
Http2WindowUpdateFrame{stream
|
|
430
|
+
frame_sender.AddRegularFrame(
|
|
431
|
+
Http2WindowUpdateFrame{stream.GetStreamId(), increment});
|
|
384
432
|
}
|
|
385
433
|
}
|
|
386
434
|
}
|
|
@@ -390,7 +438,7 @@ void MaybeAddStreamWindowUpdateFrame(RefCountedPtr<Stream> stream,
|
|
|
390
438
|
|
|
391
439
|
Http2Status ParseAndDiscardHeaders(HPackParser& parser, SliceBuffer&& buffer,
|
|
392
440
|
HeaderAssembler::ParseHeaderArgs args,
|
|
393
|
-
|
|
441
|
+
Stream* stream,
|
|
394
442
|
Http2Status&& original_status) {
|
|
395
443
|
GRPC_HTTP2_COMMON_DLOG << "ParseAndDiscardHeaders buffer "
|
|
396
444
|
"size: "
|
|
@@ -402,9 +450,8 @@ Http2Status ParseAndDiscardHeaders(HPackParser& parser, SliceBuffer&& buffer,
|
|
|
402
450
|
|
|
403
451
|
if (stream != nullptr) {
|
|
404
452
|
// Parse all the data in the header assembler
|
|
405
|
-
Http2Status result = stream->
|
|
406
|
-
parser, args.is_initial_metadata, args.
|
|
407
|
-
args.max_header_list_size_soft_limit,
|
|
453
|
+
Http2Status result = stream->GetHeaderAssembler().ParseAndDiscardHeaders(
|
|
454
|
+
parser, args.is_initial_metadata, args.max_header_list_size_soft_limit,
|
|
408
455
|
args.max_header_list_size_hard_limit);
|
|
409
456
|
if (!result.IsOk()) {
|
|
410
457
|
GRPC_DCHECK(result.GetType() ==
|
|
@@ -27,14 +27,12 @@
|
|
|
27
27
|
#include "src/core/ext/transport/chttp2/transport/frame.h"
|
|
28
28
|
#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
|
|
29
29
|
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
|
|
30
|
-
#include "src/core/ext/transport/chttp2/transport/http2_settings_manager.h"
|
|
31
|
-
#include "src/core/ext/transport/chttp2/transport/http2_settings_promises.h"
|
|
32
30
|
#include "src/core/ext/transport/chttp2/transport/http2_status.h"
|
|
33
31
|
#include "src/core/ext/transport/chttp2/transport/stream.h"
|
|
32
|
+
#include "src/core/ext/transport/chttp2/transport/write_cycle.h"
|
|
34
33
|
#include "src/core/lib/promise/activity.h"
|
|
35
|
-
#include "src/core/lib/promise/context.h"
|
|
36
34
|
#include "src/core/lib/promise/poll.h"
|
|
37
|
-
#include "src/core/lib/
|
|
35
|
+
#include "src/core/lib/slice/slice.h"
|
|
38
36
|
#include "src/core/util/ref_counted_ptr.h"
|
|
39
37
|
#include "absl/log/log.h"
|
|
40
38
|
#include "absl/status/status.h"
|
|
@@ -52,14 +50,15 @@ namespace http2 {
|
|
|
52
50
|
#define GRPC_HTTP2_CLIENT_DLOG \
|
|
53
51
|
DLOG_IF(INFO, GRPC_TRACE_FLAG_ENABLED(http2_ph2_transport))
|
|
54
52
|
|
|
53
|
+
#define GRPC_HTTP2_SERVER_DLOG \
|
|
54
|
+
DLOG_IF(INFO, GRPC_TRACE_FLAG_ENABLED(http2_ph2_transport))
|
|
55
|
+
|
|
55
56
|
#define GRPC_HTTP2_CLIENT_ERROR_DLOG \
|
|
56
57
|
LOG_IF(ERROR, GRPC_TRACE_FLAG_ENABLED(http2_ph2_transport))
|
|
57
58
|
|
|
58
59
|
#define GRPC_HTTP2_COMMON_DLOG \
|
|
59
60
|
DLOG_IF(INFO, GRPC_TRACE_FLAG_ENABLED(http2_ph2_transport))
|
|
60
61
|
|
|
61
|
-
constexpr uint32_t kMaxWriteSize = /*10 MB*/ 10u * 1024u * 1024u;
|
|
62
|
-
|
|
63
62
|
constexpr uint32_t kGoawaySendTimeoutSeconds = 5u;
|
|
64
63
|
|
|
65
64
|
struct CloseStreamArgs {
|
|
@@ -67,11 +66,21 @@ struct CloseStreamArgs {
|
|
|
67
66
|
bool close_writes;
|
|
68
67
|
};
|
|
69
68
|
|
|
69
|
+
// TODO(akshitpatel) [PH2][P3] : Write a way to measure the total size of a
|
|
70
|
+
// transport object. Reference :
|
|
71
|
+
// https://github.com/grpc/grpc/pull/41294/files#diff-c685cc4847f228327938326e2a45083a2d0845bacff0ac004bd802027a670c4e
|
|
72
|
+
|
|
70
73
|
///////////////////////////////////////////////////////////////////////////////
|
|
71
74
|
// Read and Write helpers
|
|
72
75
|
|
|
73
76
|
class Http2ReadContext {
|
|
74
77
|
public:
|
|
78
|
+
Http2ReadContext() = default;
|
|
79
|
+
Http2ReadContext(const Http2ReadContext&) = delete;
|
|
80
|
+
Http2ReadContext& operator=(const Http2ReadContext&) = delete;
|
|
81
|
+
Http2ReadContext(Http2ReadContext&&) = delete;
|
|
82
|
+
Http2ReadContext& operator=(Http2ReadContext&&) = delete;
|
|
83
|
+
|
|
75
84
|
// Signals that the read loop should pause. If it's already paused, this is a
|
|
76
85
|
// no-op.
|
|
77
86
|
void SetPauseReadLoop() {
|
|
@@ -107,30 +116,8 @@ class Http2ReadContext {
|
|
|
107
116
|
Waker read_loop_waker_;
|
|
108
117
|
};
|
|
109
118
|
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
PromiseEndpoint::WriteArgs args;
|
|
113
|
-
int max_frame_size = peer_settings.preferred_receive_crypto_message_size();
|
|
114
|
-
// Note: max frame size is 0 if the remote peer does not support adjusting the
|
|
115
|
-
// sending frame size.
|
|
116
|
-
if (max_frame_size == 0) {
|
|
117
|
-
max_frame_size = INT_MAX;
|
|
118
|
-
}
|
|
119
|
-
// `WriteArgs.max_frame_size` is a suggestion to the endpoint implementation
|
|
120
|
-
// to group data to be written into frames of the specified max_frame_size. It
|
|
121
|
-
// is different from HTTP2 SETTINGS_MAX_FRAME_SIZE. That setting limits HTTP2
|
|
122
|
-
// frame payload size.
|
|
123
|
-
args.set_max_frame_size(max_frame_size);
|
|
124
|
-
|
|
125
|
-
// TODO(akshitpatel) [PH2][P1] : Currently only the WriteArgs related to
|
|
126
|
-
// preferred_receive_crypto_message_size have been plumbed. The other write
|
|
127
|
-
// args may need to be plumbed for PH2.
|
|
128
|
-
// CHTTP2 : Reference :
|
|
129
|
-
// File : src/core/ext/transport/chttp2/transport/chttp2_transport.cc
|
|
130
|
-
// Function : write_action
|
|
131
|
-
|
|
132
|
-
return args;
|
|
133
|
-
}
|
|
119
|
+
Http2Status ValidateIncomingConnectionPreface(
|
|
120
|
+
const absl::StatusOr<Slice>& status);
|
|
134
121
|
|
|
135
122
|
///////////////////////////////////////////////////////////////////////////////
|
|
136
123
|
// Settings helpers
|
|
@@ -153,20 +140,7 @@ struct TransportChannelArgs {
|
|
|
153
140
|
int max_usable_hpack_table_size;
|
|
154
141
|
int initial_sequence_number;
|
|
155
142
|
|
|
156
|
-
std::string DebugString() const
|
|
157
|
-
return absl::StrCat(
|
|
158
|
-
"keepalive_time: ", keepalive_time,
|
|
159
|
-
" keepalive_timeout: ", keepalive_timeout,
|
|
160
|
-
" ping_timeout: ", ping_timeout,
|
|
161
|
-
" settings_timeout: ", settings_timeout,
|
|
162
|
-
" keepalive_permit_without_calls: ", keepalive_permit_without_calls,
|
|
163
|
-
" enable_preferred_rx_crypto_frame_advertisement: ",
|
|
164
|
-
enable_preferred_rx_crypto_frame_advertisement,
|
|
165
|
-
" max_header_list_size_soft_limit: ", max_header_list_size_soft_limit,
|
|
166
|
-
" max_usable_hpack_table_size: ", max_usable_hpack_table_size,
|
|
167
|
-
" initial_sequence_number: ", initial_sequence_number,
|
|
168
|
-
" test_only_ack_pings: ", test_only_ack_pings);
|
|
169
|
-
}
|
|
143
|
+
std::string DebugString() const;
|
|
170
144
|
};
|
|
171
145
|
|
|
172
146
|
void ReadChannelArgs(const ChannelArgs& channel_args,
|
|
@@ -197,15 +171,17 @@ void ProcessOutgoingDataFrameFlowControl(
|
|
|
197
171
|
ValueOrHttp2Status<chttp2::FlowControlAction>
|
|
198
172
|
ProcessIncomingDataFrameFlowControl(Http2FrameHeader& frame,
|
|
199
173
|
chttp2::TransportFlowControl& flow_control,
|
|
200
|
-
|
|
174
|
+
Stream* stream);
|
|
201
175
|
|
|
202
176
|
// Returns true if a write should be triggered
|
|
203
177
|
bool ProcessIncomingWindowUpdateFrameFlowControl(
|
|
204
178
|
const Http2WindowUpdateFrame& frame,
|
|
205
|
-
chttp2::TransportFlowControl& flow_control,
|
|
179
|
+
chttp2::TransportFlowControl& flow_control, Stream* stream);
|
|
180
|
+
|
|
181
|
+
void MaybeAddTransportWindowUpdateFrame(
|
|
182
|
+
chttp2::TransportFlowControl& flow_control, FrameSender& frame_sender);
|
|
206
183
|
|
|
207
|
-
void MaybeAddStreamWindowUpdateFrame(
|
|
208
|
-
std::vector<Http2Frame>& frames);
|
|
184
|
+
void MaybeAddStreamWindowUpdateFrame(Stream& stream, FrameSender& frame_sender);
|
|
209
185
|
|
|
210
186
|
///////////////////////////////////////////////////////////////////////////////
|
|
211
187
|
// Header and Continuation frame processing helpers
|
|
@@ -242,7 +218,7 @@ void MaybeAddStreamWindowUpdateFrame(RefCountedPtr<Stream> stream,
|
|
|
242
218
|
// it returns the original status.
|
|
243
219
|
Http2Status ParseAndDiscardHeaders(HPackParser& parser, SliceBuffer&& buffer,
|
|
244
220
|
HeaderAssembler::ParseHeaderArgs args,
|
|
245
|
-
|
|
221
|
+
Stream* stream,
|
|
246
222
|
Http2Status&& original_status);
|
|
247
223
|
|
|
248
224
|
} // namespace http2
|
|
@@ -295,9 +295,9 @@ struct PromiseEndpointReadTrace {
|
|
|
295
295
|
};
|
|
296
296
|
|
|
297
297
|
struct PromiseEndpointWriteTrace {
|
|
298
|
-
uint64_t
|
|
298
|
+
uint64_t count;
|
|
299
299
|
channelz::PropertyList ChannelzProperties() const {
|
|
300
|
-
return channelz::PropertyList().Set("
|
|
300
|
+
return channelz::PropertyList().Set("frames_count", count);
|
|
301
301
|
}
|
|
302
302
|
};
|
|
303
303
|
|
|
@@ -21,10 +21,15 @@
|
|
|
21
21
|
|
|
22
22
|
#include <cstdint>
|
|
23
23
|
#include <string>
|
|
24
|
+
#include <utility>
|
|
24
25
|
|
|
25
26
|
#include "src/core/call/metadata_info.h"
|
|
26
27
|
#include "src/core/ext/transport/chttp2/transport/frame.h"
|
|
28
|
+
#include "src/core/lib/event_engine/tcp_socket_utils.h"
|
|
29
|
+
#include "src/core/lib/slice/slice.h"
|
|
30
|
+
#include "src/core/lib/transport/promise_endpoint.h"
|
|
27
31
|
#include "src/core/util/grpc_check.h"
|
|
32
|
+
#include "absl/status/statusor.h"
|
|
28
33
|
#include "absl/strings/str_cat.h"
|
|
29
34
|
|
|
30
35
|
namespace grpc_core {
|
|
@@ -41,7 +46,8 @@ class IncomingMetadataTracker {
|
|
|
41
46
|
// a time. This class is distinct from HeaderAssembler, which buffers header
|
|
42
47
|
// payloads on a per-stream basis.
|
|
43
48
|
public:
|
|
44
|
-
IncomingMetadataTracker()
|
|
49
|
+
explicit IncomingMetadataTracker(Slice peer_string)
|
|
50
|
+
: peer_string_(std::move(peer_string)) {}
|
|
45
51
|
~IncomingMetadataTracker() = default;
|
|
46
52
|
|
|
47
53
|
IncomingMetadataTracker(IncomingMetadataTracker&& rvalue) = delete;
|
|
@@ -49,6 +55,18 @@ class IncomingMetadataTracker {
|
|
|
49
55
|
IncomingMetadataTracker(const IncomingMetadataTracker&) = delete;
|
|
50
56
|
IncomingMetadataTracker& operator=(const IncomingMetadataTracker&) = delete;
|
|
51
57
|
|
|
58
|
+
static Slice GetPeerString(const PromiseEndpoint& endpoint) {
|
|
59
|
+
absl::StatusOr<std::string> uri =
|
|
60
|
+
grpc_event_engine::experimental::ResolvedAddressToURI(
|
|
61
|
+
endpoint.GetPeerAddress());
|
|
62
|
+
if (uri.ok()) {
|
|
63
|
+
return Slice::FromCopiedString(*uri);
|
|
64
|
+
}
|
|
65
|
+
return Slice::FromCopiedString("unknown");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
Slice peer_string() const { return peer_string_.Ref(); }
|
|
69
|
+
|
|
52
70
|
void set_soft_limit(uint32_t limit) {
|
|
53
71
|
max_header_list_size_soft_limit_ = limit;
|
|
54
72
|
}
|
|
@@ -88,7 +106,12 @@ class IncomingMetadataTracker {
|
|
|
88
106
|
// Returns stream id of stream for which headers are being received.
|
|
89
107
|
uint32_t GetStreamId() const { return incoming_header_stream_id_; }
|
|
90
108
|
|
|
91
|
-
|
|
109
|
+
// A gRPC server is permitted to send both initial metadata and trailing
|
|
110
|
+
// metadata where initial metadata is optional.
|
|
111
|
+
// A gRPC C++ client is permitted to send only initial metadata.
|
|
112
|
+
// However, other gRPC Client implementations may send trailing metadata too.
|
|
113
|
+
// So we allow only a maximum of 2 metadata per streams.
|
|
114
|
+
bool DidReceiveDuplicateMetadata(
|
|
92
115
|
const bool did_receive_initial_metadata,
|
|
93
116
|
const bool did_receive_trailing_metadata) const {
|
|
94
117
|
const bool is_duplicate_initial_metadata =
|
|
@@ -98,13 +121,6 @@ class IncomingMetadataTracker {
|
|
|
98
121
|
return is_duplicate_initial_metadata || is_duplicate_trailing_metadata;
|
|
99
122
|
}
|
|
100
123
|
|
|
101
|
-
bool ServerReceivedDuplicateMetadata(
|
|
102
|
-
const bool did_receive_initial_metadata) const {
|
|
103
|
-
// TODO(tjagtap) : [PH2][P2] : Verify this when implementing Server.
|
|
104
|
-
// Also write a small unit test for it.
|
|
105
|
-
return !incoming_header_end_stream_ && did_receive_initial_metadata;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
124
|
std::string DebugString() const {
|
|
109
125
|
return absl::StrCat(
|
|
110
126
|
"{ incoming_header_in_progress : ",
|
|
@@ -115,6 +131,10 @@ class IncomingMetadataTracker {
|
|
|
115
131
|
}
|
|
116
132
|
|
|
117
133
|
private:
|
|
134
|
+
// Initialized only once at the time of transport creation.
|
|
135
|
+
// Should remain constant for the lifetime of the transport.
|
|
136
|
+
const Slice peer_string_;
|
|
137
|
+
|
|
118
138
|
bool incoming_header_in_progress_ = false;
|
|
119
139
|
bool incoming_header_end_stream_ = false;
|
|
120
140
|
uint32_t incoming_header_stream_id_ = 0;
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
#include <utility>
|
|
35
35
|
#include <variant>
|
|
36
36
|
|
|
37
|
+
#include "src/core/call/metadata.h"
|
|
37
38
|
#include "src/core/call/metadata_batch.h"
|
|
38
39
|
#include "src/core/channelz/channelz.h"
|
|
39
40
|
#include "src/core/ext/transport/chttp2/transport/call_tracer_wrapper.h"
|
|
@@ -314,6 +315,7 @@ struct grpc_chttp2_transport final : public grpc_core::FilterStackTransport,
|
|
|
314
315
|
transport_framing_endpoint_extension = nullptr;
|
|
315
316
|
|
|
316
317
|
grpc_core::MemoryOwner memory_owner;
|
|
318
|
+
grpc_core::StreamQuotaRefPtr stream_quota;
|
|
317
319
|
const grpc_core::MemoryAllocator::Reservation self_reservation;
|
|
318
320
|
grpc_core::ReclamationSweep active_reclamation;
|
|
319
321
|
grpc_core::InstrumentStorageRefPtr<grpc_core::ResourceQuotaDomain>
|
|
@@ -891,8 +893,10 @@ void grpc_chttp2_reset_ping_clock(grpc_chttp2_transport* t);
|
|
|
891
893
|
void grpc_chttp2_mark_stream_writable(grpc_chttp2_transport* t,
|
|
892
894
|
grpc_chttp2_stream* s);
|
|
893
895
|
|
|
894
|
-
void grpc_chttp2_cancel_stream(
|
|
895
|
-
|
|
896
|
+
void grpc_chttp2_cancel_stream(
|
|
897
|
+
grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
898
|
+
grpc_error_handle due_to_error, bool tarpit,
|
|
899
|
+
grpc_core::ServerMetadataHandle send_trailing_metadata = nullptr);
|
|
896
900
|
|
|
897
901
|
void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_chttp2_transport* t,
|
|
898
902
|
grpc_chttp2_stream* s);
|