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
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
#include <cstdint>
|
|
28
28
|
#include <memory>
|
|
29
29
|
#include <optional>
|
|
30
|
-
#include <
|
|
30
|
+
#include <type_traits>
|
|
31
31
|
#include <utility>
|
|
32
32
|
#include <vector>
|
|
33
33
|
|
|
@@ -46,73 +46,58 @@
|
|
|
46
46
|
#include "src/core/ext/transport/chttp2/transport/incoming_metadata_tracker.h"
|
|
47
47
|
#include "src/core/ext/transport/chttp2/transport/keepalive.h"
|
|
48
48
|
#include "src/core/ext/transport/chttp2/transport/ping_promise.h"
|
|
49
|
+
#include "src/core/ext/transport/chttp2/transport/security_frame.h"
|
|
49
50
|
#include "src/core/ext/transport/chttp2/transport/stream.h"
|
|
50
51
|
#include "src/core/ext/transport/chttp2/transport/stream_data_queue.h"
|
|
51
52
|
#include "src/core/ext/transport/chttp2/transport/writable_streams.h"
|
|
53
|
+
#include "src/core/ext/transport/chttp2/transport/write_cycle.h"
|
|
52
54
|
#include "src/core/lib/channel/channel_args.h"
|
|
53
|
-
#include "src/core/lib/iomgr/closure.h"
|
|
54
55
|
#include "src/core/lib/iomgr/iomgr_fwd.h"
|
|
55
56
|
#include "src/core/lib/promise/activity.h"
|
|
56
57
|
#include "src/core/lib/promise/context.h"
|
|
57
|
-
#include "src/core/lib/promise/if.h"
|
|
58
58
|
#include "src/core/lib/promise/latch.h"
|
|
59
59
|
#include "src/core/lib/promise/map.h"
|
|
60
60
|
#include "src/core/lib/promise/party.h"
|
|
61
61
|
#include "src/core/lib/promise/poll.h"
|
|
62
62
|
#include "src/core/lib/promise/promise.h"
|
|
63
63
|
#include "src/core/lib/promise/race.h"
|
|
64
|
-
#include "src/core/lib/promise/try_seq.h"
|
|
65
64
|
#include "src/core/lib/resource_quota/memory_quota.h"
|
|
66
|
-
#include "src/core/lib/slice/slice.h"
|
|
67
65
|
#include "src/core/lib/slice/slice_buffer.h"
|
|
68
66
|
#include "src/core/lib/transport/connectivity_state.h"
|
|
69
67
|
#include "src/core/lib/transport/promise_endpoint.h"
|
|
70
68
|
#include "src/core/lib/transport/transport.h"
|
|
71
|
-
#include "src/core/util/check_class_size.h"
|
|
72
69
|
#include "src/core/util/debug_location.h"
|
|
73
|
-
#include "src/core/util/grpc_check.h"
|
|
74
70
|
#include "src/core/util/orphanable.h"
|
|
75
71
|
#include "src/core/util/ref_counted_ptr.h"
|
|
76
72
|
#include "src/core/util/sync.h"
|
|
77
73
|
#include "src/core/util/time.h"
|
|
78
74
|
#include "absl/base/thread_annotations.h"
|
|
79
75
|
#include "absl/container/flat_hash_map.h"
|
|
80
|
-
#include "absl/container/flat_hash_set.h"
|
|
81
76
|
#include "absl/functional/any_invocable.h"
|
|
82
77
|
#include "absl/log/log.h"
|
|
78
|
+
#include "absl/meta/type_traits.h"
|
|
83
79
|
#include "absl/status/status.h"
|
|
84
80
|
#include "absl/status/statusor.h"
|
|
85
81
|
#include "absl/strings/string_view.h"
|
|
86
|
-
#include "absl/types/span.h"
|
|
87
82
|
|
|
88
83
|
namespace grpc_core {
|
|
89
84
|
namespace http2 {
|
|
90
85
|
|
|
91
|
-
// Http2 Client Transport Spawns Overview
|
|
92
|
-
|
|
93
|
-
// | Promise Spawn | Max Duration | Promise Resolution | Max Spawns |
|
|
94
|
-
// | | for Spawn | | |
|
|
95
|
-
// |---------------------|--------------|-----------------------|------------|
|
|
96
|
-
// | Endpoint Read Loop | Infinite | On transport close | One |
|
|
97
|
-
// | Endpoint Write Loop | Infinite | On transport close | One |
|
|
98
|
-
// | Stream Multiplexer | Infinite | On transport close | One |
|
|
99
|
-
// | Close Transport | CloseTimeout | On transport close | One |
|
|
100
|
-
|
|
101
|
-
// Max Party Slots (Always): 3
|
|
102
|
-
// Max Promise Slots (Worst Case): 4
|
|
103
|
-
|
|
104
86
|
// Experimental : The code will be written iteratively.
|
|
105
87
|
// Do not use or edit any of these functions unless you are
|
|
106
88
|
// familiar with the PH2 project (Moving chttp2 to promises.)
|
|
107
|
-
// TODO(tjagtap) : [PH2][
|
|
108
|
-
// http2 rollout
|
|
89
|
+
// TODO(tjagtap) : [PH2][P5] : Update the experimental status of the code when
|
|
90
|
+
// http2 rollout is completed.
|
|
109
91
|
class Http2ClientTransport final : public ClientTransport,
|
|
110
92
|
public channelz::DataSource {
|
|
111
|
-
// TODO(
|
|
112
|
-
//
|
|
93
|
+
// TODO(tjagtap) : [PH2][P3] Move the definitions to the header for better
|
|
94
|
+
// inlining. For now definitions are in the cc file to
|
|
95
|
+
// reduce cognitive load in the header.
|
|
113
96
|
public:
|
|
97
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
98
|
+
// Constructor, Destructor etc.
|
|
114
99
|
Http2ClientTransport(
|
|
115
|
-
PromiseEndpoint endpoint,
|
|
100
|
+
PromiseEndpoint endpoint, const ChannelArgs& channel_args,
|
|
116
101
|
std::shared_ptr<grpc_event_engine::experimental::EventEngine>
|
|
117
102
|
event_engine,
|
|
118
103
|
absl::AnyInvocable<void(absl::StatusOr<uint32_t>)> on_receive_settings);
|
|
@@ -128,97 +113,158 @@ class Http2ClientTransport final : public ClientTransport,
|
|
|
128
113
|
ServerTransport* server_transport() override { return nullptr; }
|
|
129
114
|
absl::string_view GetTransportName() const override { return "http2"; }
|
|
130
115
|
|
|
131
|
-
|
|
132
|
-
//
|
|
116
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
117
|
+
// Deprecated Stuff
|
|
118
|
+
|
|
119
|
+
// TODO(tjagtap) : [PH2][EXT] : Remove after event engine rollout
|
|
133
120
|
void SetPollset(grpc_stream*, grpc_pollset*) override {}
|
|
134
121
|
void SetPollsetSet(grpc_stream*, grpc_pollset_set*) override {}
|
|
135
122
|
|
|
123
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
124
|
+
// Transport Functions
|
|
125
|
+
|
|
136
126
|
// Called at the start of a stream.
|
|
137
127
|
void StartCall(CallHandler call_handler) override;
|
|
138
128
|
|
|
139
129
|
void PerformOp(grpc_transport_op*) override;
|
|
140
|
-
void StartConnectivityWatch(
|
|
141
|
-
grpc_connectivity_state state,
|
|
142
|
-
OrphanablePtr<ConnectivityStateWatcherInterface> watcher);
|
|
143
|
-
void StopConnectivityWatch(ConnectivityStateWatcherInterface* watcher);
|
|
144
|
-
|
|
145
|
-
void StartWatch(RefCountedPtr<StateWatcher> watcher) override;
|
|
146
|
-
void StopWatch(RefCountedPtr<StateWatcher> watcher) override;
|
|
147
130
|
|
|
148
131
|
void Orphan() override;
|
|
149
132
|
|
|
150
|
-
|
|
151
|
-
return
|
|
152
|
-
channelz::DataSource::channelz_node())
|
|
153
|
-
->RefAsSubclass<channelz::SocketNode>();
|
|
133
|
+
bool AreTransportFlowControlTokensAvailable() {
|
|
134
|
+
return flow_control_.remote_window() > 0;
|
|
154
135
|
}
|
|
155
136
|
|
|
137
|
+
void SpawnTransportLoops();
|
|
138
|
+
|
|
139
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
140
|
+
// Channelz and ZTrace
|
|
141
|
+
|
|
156
142
|
std::unique_ptr<channelz::ZTrace> GetZTrace(absl::string_view name) override {
|
|
157
143
|
if (name == "transport_frames") return ztrace_collector_->MakeZTrace();
|
|
158
144
|
return nullptr;
|
|
159
145
|
}
|
|
160
146
|
|
|
147
|
+
RefCountedPtr<channelz::SocketNode> GetSocketNode() const override;
|
|
148
|
+
|
|
161
149
|
void AddData(channelz::DataSink sink) override;
|
|
162
150
|
void SpawnAddChannelzData(RefCountedPtr<Party> party,
|
|
163
151
|
channelz::DataSink sink);
|
|
164
152
|
|
|
165
|
-
|
|
166
|
-
|
|
153
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
154
|
+
// Watchers
|
|
155
|
+
|
|
156
|
+
void StartWatch(RefCountedPtr<StateWatcher> watcher) override;
|
|
157
|
+
void StopWatch(RefCountedPtr<StateWatcher> watcher) override;
|
|
158
|
+
|
|
159
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
160
|
+
// Test Only Functions
|
|
161
|
+
|
|
162
|
+
template <typename Factory>
|
|
163
|
+
void TestOnlySpawnPromise(absl::string_view name, Factory&& factory) {
|
|
164
|
+
SpawnInfallible(general_party_, name, std::forward<Factory>(factory));
|
|
167
165
|
}
|
|
168
166
|
|
|
167
|
+
absl::Status TestOnlyTriggerWriteCycle() { return TriggerWriteCycle(); }
|
|
168
|
+
|
|
169
169
|
auto TestOnlySendPing(absl::AnyInvocable<void()> on_initiate,
|
|
170
170
|
bool important = false) {
|
|
171
171
|
return ping_manager_->RequestPing(std::move(on_initiate), important);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
int64_t TestOnlyTransportFlowControlWindow();
|
|
175
|
+
int64_t TestOnlyGetStreamFlowControlWindow(const uint32_t stream_id);
|
|
176
|
+
|
|
177
|
+
private:
|
|
178
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
179
|
+
// Endpoint Helpers
|
|
180
|
+
|
|
181
|
+
// Callers MUST ensure that the transport is not destroyed till the promise is
|
|
182
|
+
// resolved or cancelled.
|
|
183
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION auto EndpointReadSlice(
|
|
184
|
+
const size_t num_bytes) {
|
|
185
|
+
return Map(endpoint_.ReadSlice(num_bytes),
|
|
186
|
+
[this, num_bytes](absl::StatusOr<Slice> status) {
|
|
187
|
+
OnEndpointRead(status.ok(), num_bytes);
|
|
188
|
+
return status;
|
|
189
|
+
});
|
|
177
190
|
}
|
|
178
191
|
|
|
179
|
-
|
|
180
|
-
|
|
192
|
+
// Callers MUST ensure that the transport is not destroyed till the promise is
|
|
193
|
+
// resolved or cancelled.
|
|
194
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION auto EndpointRead(
|
|
195
|
+
const size_t num_bytes) {
|
|
196
|
+
return Map(endpoint_.Read(num_bytes),
|
|
197
|
+
[this, num_bytes](absl::StatusOr<SliceBuffer> status) {
|
|
198
|
+
OnEndpointRead(status.ok(), num_bytes);
|
|
199
|
+
return status;
|
|
200
|
+
});
|
|
181
201
|
}
|
|
182
202
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
203
|
+
void OnEndpointRead(const bool is_ok, const size_t num_bytes) {
|
|
204
|
+
if (is_ok) {
|
|
205
|
+
keepalive_manager_->GotData();
|
|
206
|
+
ztrace_collector_->Append(PromiseEndpointReadTrace{num_bytes});
|
|
187
207
|
}
|
|
188
|
-
return stream->flow_control.remote_window_delta();
|
|
189
208
|
}
|
|
190
209
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
210
|
+
auto EndpointWrite(SliceBuffer&& output_buf);
|
|
211
|
+
|
|
212
|
+
// Serialize and write the frames in the write cycle to the endpoint.
|
|
213
|
+
auto SerializeAndWrite();
|
|
214
|
+
|
|
215
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
216
|
+
// Watchers
|
|
217
|
+
|
|
218
|
+
void StartConnectivityWatch(
|
|
219
|
+
grpc_connectivity_state state,
|
|
220
|
+
OrphanablePtr<ConnectivityStateWatcherInterface> watcher);
|
|
221
|
+
|
|
222
|
+
void StopConnectivityWatch(ConnectivityStateWatcherInterface* watcher);
|
|
223
|
+
|
|
224
|
+
void NotifyStateWatcherOnDisconnectLocked(
|
|
225
|
+
absl::Status status, StateWatcher::DisconnectInfo disconnect_info)
|
|
226
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&transport_mutex_);
|
|
227
|
+
|
|
228
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
229
|
+
// Transport Read Path
|
|
230
|
+
|
|
231
|
+
// Synchronous functions for processing each type of frame
|
|
232
|
+
Http2Status ProcessIncomingFrame(Http2DataFrame&& frame);
|
|
233
|
+
Http2Status ProcessIncomingFrame(Http2HeaderFrame&& frame);
|
|
234
|
+
Http2Status ProcessIncomingFrame(Http2RstStreamFrame&& frame);
|
|
235
|
+
Http2Status ProcessIncomingFrame(Http2SettingsFrame&& frame);
|
|
236
|
+
Http2Status ProcessIncomingFrame(Http2PingFrame&& frame);
|
|
237
|
+
Http2Status ProcessIncomingFrame(Http2GoawayFrame&& frame);
|
|
238
|
+
Http2Status ProcessIncomingFrame(Http2WindowUpdateFrame&& frame);
|
|
239
|
+
Http2Status ProcessIncomingFrame(Http2ContinuationFrame&& frame);
|
|
240
|
+
Http2Status ProcessIncomingFrame(Http2SecurityFrame&& frame);
|
|
241
|
+
Http2Status ProcessIncomingFrame(Http2UnknownFrame&& frame);
|
|
242
|
+
Http2Status ProcessIncomingFrame(Http2EmptyFrame&& frame);
|
|
195
243
|
|
|
196
|
-
private:
|
|
197
|
-
// Promise factory for processing each type of frame
|
|
198
|
-
Http2Status ProcessHttp2DataFrame(Http2DataFrame frame);
|
|
199
|
-
Http2Status ProcessHttp2HeaderFrame(Http2HeaderFrame frame);
|
|
200
|
-
Http2Status ProcessHttp2RstStreamFrame(Http2RstStreamFrame frame);
|
|
201
|
-
Http2Status ProcessHttp2SettingsFrame(Http2SettingsFrame frame);
|
|
202
|
-
auto ProcessHttp2PingFrame(Http2PingFrame frame);
|
|
203
|
-
Http2Status ProcessHttp2GoawayFrame(Http2GoawayFrame frame);
|
|
204
|
-
Http2Status ProcessHttp2WindowUpdateFrame(Http2WindowUpdateFrame frame);
|
|
205
|
-
Http2Status ProcessHttp2ContinuationFrame(Http2ContinuationFrame frame);
|
|
206
|
-
Http2Status ProcessHttp2SecurityFrame(Http2SecurityFrame frame);
|
|
207
244
|
Http2Status ProcessMetadata(RefCountedPtr<Stream> stream);
|
|
208
245
|
|
|
209
|
-
|
|
246
|
+
Http2Status ParseAndDiscardHeaders(SliceBuffer&& buffer, bool is_end_headers,
|
|
247
|
+
Stream* stream,
|
|
248
|
+
Http2Status&& original_status,
|
|
249
|
+
DebugLocation whence = {});
|
|
210
250
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
251
|
+
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Http2Status
|
|
252
|
+
ProcessOneIncomingFrame(Http2Frame&& frame) {
|
|
253
|
+
GRPC_HTTP2_CLIENT_DLOG << "Http2ClientTransport::ProcessOneIncomingFrame";
|
|
254
|
+
return std::visit(
|
|
255
|
+
[this](auto&& frame) {
|
|
256
|
+
return ProcessIncomingFrame(std::forward<decltype(frame)>(frame));
|
|
257
|
+
},
|
|
258
|
+
std::forward<Http2Frame>(frame));
|
|
259
|
+
}
|
|
214
260
|
|
|
215
|
-
// Returns a promise that will read and process one HTTP2 frame.
|
|
216
261
|
auto ReadAndProcessOneFrame();
|
|
217
262
|
|
|
218
|
-
// Returns a promise
|
|
219
|
-
auto
|
|
263
|
+
// Returns a promise to keep reading in a Loop till a fail/close is received.
|
|
264
|
+
auto ReadLoop();
|
|
220
265
|
|
|
221
|
-
|
|
266
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
267
|
+
// Transport Write Path
|
|
222
268
|
|
|
223
269
|
// Write time sensitive control frames to the endpoint. Frames sent from here
|
|
224
270
|
// will be GOAWAY, SETTINGS, PING and PING acks, WINDOW_UPDATE and
|
|
@@ -227,10 +273,30 @@ class Http2ClientTransport final : public ClientTransport,
|
|
|
227
273
|
// module needs to take action after the write (for cases like spawning
|
|
228
274
|
// timeout promises), they MUST plug the call in the
|
|
229
275
|
// NotifyControlFramesWriteDone.
|
|
230
|
-
auto ProcessAndWriteControlFrames();
|
|
231
276
|
|
|
232
|
-
//
|
|
233
|
-
|
|
277
|
+
// Prepares all the HTTP2 control frames that are to be sent out in this write
|
|
278
|
+
// cycle. The modules can choose to either trigger an endpoint write for the
|
|
279
|
+
// frames or defer the write with the stream specific frames. In most cases,
|
|
280
|
+
// the frames are deferred and a single write is triggered for all the
|
|
281
|
+
// frames.
|
|
282
|
+
absl::Status PrepareControlFrames();
|
|
283
|
+
|
|
284
|
+
// If there are any urgent frames this would trigger an additional endpoint
|
|
285
|
+
// write. CAUTION: This will add significant overhead if used for non-urgent
|
|
286
|
+
// frames.
|
|
287
|
+
auto MaybeWriteUrgentFrames();
|
|
288
|
+
|
|
289
|
+
// Notify the modules that an endpoint write is done. This corresponds to the
|
|
290
|
+
// generic endpoint write that happens in the MultiplexerLoop.
|
|
291
|
+
void NotifyFramesWriteDone();
|
|
292
|
+
|
|
293
|
+
// Notify the modules that an urgent endpoint write is done. If some module
|
|
294
|
+
// add frames to this buffer in PrepareControlFrames, they can use this to
|
|
295
|
+
// do post processing after the write is done.
|
|
296
|
+
void NotifyUrgentFramesWriteDone();
|
|
297
|
+
|
|
298
|
+
absl::Status DequeueStreamFrames(RefCountedPtr<Stream> stream,
|
|
299
|
+
WriteCycle& write_cycle);
|
|
234
300
|
|
|
235
301
|
// Returns a promise to keep draining control frames and data frames from all
|
|
236
302
|
// the writable streams and write to the endpoint.
|
|
@@ -238,165 +304,102 @@ class Http2ClientTransport final : public ClientTransport,
|
|
|
238
304
|
|
|
239
305
|
// Returns a promise to fetch data from the callhandler and pass it further
|
|
240
306
|
// down towards the endpoint.
|
|
241
|
-
auto CallOutboundLoop(
|
|
242
|
-
ClientMetadataHandle metadata);
|
|
307
|
+
auto CallOutboundLoop(RefCountedPtr<Stream> stream);
|
|
243
308
|
|
|
244
|
-
// TODO(akshitpatel) : [PH2][P1] : Make this a synchronous function.
|
|
245
309
|
// Force triggers a transport write cycle
|
|
246
|
-
|
|
247
|
-
|
|
310
|
+
absl::Status TriggerWriteCycle(DebugLocation whence = {}) {
|
|
311
|
+
GRPC_HTTP2_CLIENT_DLOG
|
|
312
|
+
<< "Http2ClientTransport::TriggerWriteCycle invoked from "
|
|
313
|
+
<< whence.file() << ":" << whence.line();
|
|
314
|
+
return writable_stream_list_.ForceReadyForWrite();
|
|
248
315
|
}
|
|
249
316
|
|
|
250
|
-
|
|
251
|
-
//
|
|
252
|
-
|
|
253
|
-
|
|
317
|
+
// Triggers a write cycle. If successful, returns true.
|
|
318
|
+
// If failed, calls HandleError and returns false.
|
|
319
|
+
bool TriggerWriteCycleOrHandleError(DebugLocation whence = {}) {
|
|
320
|
+
absl::Status status = TriggerWriteCycle(whence);
|
|
321
|
+
if (GPR_LIKELY(status.ok())) return true;
|
|
322
|
+
GRPC_HTTP2_CLIENT_DLOG
|
|
323
|
+
<< "Http2ClientTransport::TriggerWriteCycleOrHandleError failed with "
|
|
324
|
+
"status: "
|
|
325
|
+
<< status << " at " << whence.file() << ":" << whence.line();
|
|
326
|
+
GRPC_UNUSED absl::Status unused_status =
|
|
327
|
+
HandleError(std::nullopt, ToHttpOkOrConnError(status), whence);
|
|
328
|
+
return false;
|
|
254
329
|
}
|
|
255
|
-
// TODO(tjagtap) [PH2][P2][BDP] Remove this when the BDP code is done.
|
|
256
|
-
void WakeupPeriodicUpdatePromise() { periodic_updates_waker_.Wakeup(); }
|
|
257
330
|
|
|
258
|
-
|
|
259
|
-
void ActOnFlowControlAction(const chttp2::FlowControlAction& action,
|
|
260
|
-
RefCountedPtr<Stream> stream);
|
|
331
|
+
absl::Status InitializeStream(Stream& stream);
|
|
261
332
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&transport_mutex_);
|
|
265
|
-
|
|
266
|
-
RefCountedPtr<Party> general_party_;
|
|
267
|
-
std::shared_ptr<grpc_event_engine::experimental::EventEngine> event_engine_;
|
|
268
|
-
|
|
269
|
-
PromiseEndpoint endpoint_;
|
|
270
|
-
RefCountedPtr<SettingsPromiseManager> settings_;
|
|
333
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
334
|
+
// Spawn Helpers and Promise Helpers
|
|
271
335
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
// (and follows case 1) or sends a half close frame and closes the stream
|
|
284
|
-
// for reads and writes (in the multiplexer loop).
|
|
285
|
-
// 3. Hitting error condition in the transport: In this case, RST stream is
|
|
286
|
-
// is enqueued and the stream is closed for reads immediately. This means
|
|
287
|
-
// we effectively reduce the number of active streams inline (because we
|
|
288
|
-
// remove the stream from the stream_list_). This is fine because the
|
|
289
|
-
// priority logic in list of writable streams ensures that the RST stream
|
|
290
|
-
// frame is given priority over any new streams being created by the
|
|
291
|
-
// client.
|
|
292
|
-
// 4. Application abort: In this case, multiplexer loop will write RST stream
|
|
293
|
-
// frame to the endpoint and close the stream from reads and writes. This
|
|
294
|
-
// then follows the same reasoning as case 1.
|
|
295
|
-
inline uint32_t GetActiveStreamCountLocked() const
|
|
296
|
-
ABSL_EXCLUSIVE_LOCKS_REQUIRED(transport_mutex_) {
|
|
297
|
-
return stream_list_.size();
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// Returns the next stream id. If the next stream id is not available, it
|
|
301
|
-
// returns std::nullopt. MUST be called from the transport party.
|
|
302
|
-
absl::StatusOr<uint32_t> NextStreamId() {
|
|
303
|
-
if (next_stream_id_ > GetMaxAllowedStreamId()) {
|
|
304
|
-
// TODO(tjagtap) : [PH2][P3] : Handle case if transport runs out of stream
|
|
305
|
-
// ids
|
|
306
|
-
// RFC9113 : Stream identifiers cannot be reused. Long-lived connections
|
|
307
|
-
// can result in an endpoint exhausting the available range of stream
|
|
308
|
-
// identifiers. A client that is unable to establish a new stream
|
|
309
|
-
// identifier can establish a new connection for new streams. A server
|
|
310
|
-
// that is unable to establish a new stream identifier can send a GOAWAY
|
|
311
|
-
// frame so that the client is forced to open a new connection for new
|
|
312
|
-
// streams.
|
|
313
|
-
return absl::ResourceExhaustedError("No more stream ids available");
|
|
314
|
-
}
|
|
315
|
-
// TODO(akshitpatel) : [PH2][P3] : There is a channel arg to delay
|
|
316
|
-
// starting new streams instead of failing them. This needs to be
|
|
317
|
-
// implemented.
|
|
318
|
-
{
|
|
319
|
-
MutexLock lock(&transport_mutex_);
|
|
320
|
-
if (GetActiveStreamCountLocked() >=
|
|
321
|
-
settings_->peer().max_concurrent_streams()) {
|
|
322
|
-
return absl::ResourceExhaustedError("Reached max concurrent streams");
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// RFC9113 : Streams initiated by a client MUST use odd-numbered stream
|
|
327
|
-
// identifiers.
|
|
328
|
-
uint32_t new_stream_id =
|
|
329
|
-
std::exchange(next_stream_id_, next_stream_id_ + 2);
|
|
330
|
-
if (GPR_UNLIKELY(next_stream_id_ > GetMaxAllowedStreamId())) {
|
|
331
|
-
ReportDisconnection(
|
|
332
|
-
absl::ResourceExhaustedError("Transport Stream IDs exhausted"),
|
|
333
|
-
{}, // TODO(tjagtap) : [PH2][P2] : Report better disconnect info.
|
|
334
|
-
"no_more_stream_ids");
|
|
335
|
-
}
|
|
336
|
-
return new_stream_id;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// Returns the next stream id without incrementing it. MUST be called from the
|
|
340
|
-
// transport party.
|
|
341
|
-
uint32_t PeekNextStreamId() const { return next_stream_id_; }
|
|
342
|
-
|
|
343
|
-
// Returns the last stream id sent by the transport. If no streams were sent,
|
|
344
|
-
// returns 0. MUST be called from the transport party.
|
|
345
|
-
uint32_t GetLastStreamId() const {
|
|
346
|
-
const uint32_t next_stream_id = PeekNextStreamId();
|
|
347
|
-
return (next_stream_id > 1) ? (next_stream_id - 2) : 0;
|
|
336
|
+
template <typename Promise,
|
|
337
|
+
std::enable_if_t<std::is_same_v<decltype(std::declval<Promise>()()),
|
|
338
|
+
Poll<absl::Status>>,
|
|
339
|
+
bool> = true>
|
|
340
|
+
auto UntilTransportClosed(Promise&& promise) {
|
|
341
|
+
return Race(Map(transport_closed_latch_.Wait(),
|
|
342
|
+
[self = RefAsSubclass<Http2ClientTransport>()](Empty) {
|
|
343
|
+
GRPC_HTTP2_CLIENT_DLOG << "Transport closed";
|
|
344
|
+
return absl::CancelledError("Transport closed");
|
|
345
|
+
}),
|
|
346
|
+
std::forward<Promise>(promise));
|
|
348
347
|
}
|
|
349
348
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
absl::flat_hash_map<uint32_t, RefCountedPtr<Stream>> stream_list_
|
|
357
|
-
ABSL_GUARDED_BY(transport_mutex_);
|
|
358
|
-
|
|
359
|
-
uint32_t next_stream_id_;
|
|
360
|
-
HPackCompressor encoder_;
|
|
361
|
-
HPackParser parser_;
|
|
362
|
-
bool is_transport_closed_ ABSL_GUARDED_BY(transport_mutex_) = false;
|
|
363
|
-
Latch<void> transport_closed_latch_;
|
|
364
|
-
|
|
365
|
-
template <typename Promise>
|
|
366
|
-
auto UntilTransportClosed(Promise promise) {
|
|
349
|
+
template <typename Promise,
|
|
350
|
+
std::enable_if_t<std::is_same_v<decltype(std::declval<Promise>()()),
|
|
351
|
+
Poll<Empty>>,
|
|
352
|
+
bool> = true>
|
|
353
|
+
auto UntilTransportClosed(Promise&& promise) {
|
|
367
354
|
return Race(Map(transport_closed_latch_.Wait(),
|
|
368
|
-
[](Empty) {
|
|
355
|
+
[self = RefAsSubclass<Http2ClientTransport>()](Empty) {
|
|
369
356
|
GRPC_HTTP2_CLIENT_DLOG << "Transport closed";
|
|
370
|
-
return
|
|
357
|
+
return Empty{};
|
|
371
358
|
}),
|
|
372
|
-
std::
|
|
359
|
+
std::forward<Promise>(promise));
|
|
373
360
|
}
|
|
374
361
|
|
|
375
362
|
// Spawns an infallible promise on the given party.
|
|
376
363
|
template <typename Factory>
|
|
377
364
|
void SpawnInfallible(RefCountedPtr<Party> party, absl::string_view name,
|
|
378
|
-
Factory&& factory)
|
|
365
|
+
Factory&& factory) {
|
|
366
|
+
party->Spawn(name, std::forward<Factory>(factory), [](Empty) {});
|
|
367
|
+
}
|
|
379
368
|
|
|
380
369
|
// Spawns an infallible promise on the transport party.
|
|
381
370
|
template <typename Factory>
|
|
382
|
-
void SpawnInfallibleTransportParty(absl::string_view name,
|
|
371
|
+
void SpawnInfallibleTransportParty(absl::string_view name,
|
|
372
|
+
Factory&& factory) {
|
|
373
|
+
SpawnInfallible(general_party_, name, std::forward<Factory>(factory));
|
|
374
|
+
}
|
|
383
375
|
|
|
384
376
|
// Spawns a promise on the transport party. If the promise returns a non-ok
|
|
385
377
|
// status, it is handled by closing the transport with the corresponding
|
|
386
378
|
// status.
|
|
387
379
|
template <typename Factory>
|
|
388
|
-
void SpawnGuardedTransportParty(absl::string_view name, Factory&& factory)
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
380
|
+
void SpawnGuardedTransportParty(absl::string_view name, Factory&& factory) {
|
|
381
|
+
general_party_->Spawn(
|
|
382
|
+
name, std::forward<Factory>(factory),
|
|
383
|
+
[self = RefAsSubclass<Http2ClientTransport>()](absl::Status status) {
|
|
384
|
+
if (!status.ok()) {
|
|
385
|
+
GRPC_UNUSED absl::Status error = self->HandleError(
|
|
386
|
+
/*stream_id=*/std::nullopt, ToHttpOkOrConnError(status));
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
}
|
|
392
390
|
|
|
393
|
-
|
|
391
|
+
template <typename Factory, typename OnDone>
|
|
392
|
+
void SpawnWithOnDoneTransportParty(absl::string_view name, Factory&& factory,
|
|
393
|
+
OnDone&& on_done) {
|
|
394
|
+
general_party_->Spawn(name, std::forward<Factory>(factory),
|
|
395
|
+
std::forward<OnDone>(on_done));
|
|
396
|
+
}
|
|
394
397
|
|
|
395
398
|
// Runs on the call party.
|
|
396
399
|
std::optional<RefCountedPtr<Stream>> MakeStream(CallHandler call_handler);
|
|
397
400
|
|
|
398
401
|
// This function MUST be idempotent.
|
|
399
|
-
void CloseStream(
|
|
402
|
+
void CloseStream(Stream& stream, CloseStreamArgs args,
|
|
400
403
|
DebugLocation whence = {});
|
|
401
404
|
|
|
402
405
|
void BeginCloseStream(RefCountedPtr<Stream> stream,
|
|
@@ -404,83 +407,94 @@ class Http2ClientTransport final : public ClientTransport,
|
|
|
404
407
|
ServerMetadataHandle&& metadata,
|
|
405
408
|
DebugLocation whence = {});
|
|
406
409
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
auto EndpointReadSlice(const size_t num_bytes);
|
|
410
|
-
auto EndpointRead(const size_t num_bytes);
|
|
410
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
411
|
+
// Settings
|
|
411
412
|
|
|
412
|
-
// HTTP2 Settings
|
|
413
413
|
auto WaitForSettingsTimeoutOnDone();
|
|
414
414
|
void MaybeSpawnWaitForSettingsTimeout();
|
|
415
415
|
void EnforceLatestIncomingSettings();
|
|
416
416
|
|
|
417
|
-
|
|
418
|
-
|
|
417
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
418
|
+
// Flow Control and BDP
|
|
419
419
|
|
|
420
|
-
|
|
421
|
-
|
|
420
|
+
// Processes the flow control action and take necessary steps.
|
|
421
|
+
void ActOnFlowControlAction(const chttp2::FlowControlAction& action,
|
|
422
|
+
Stream* stream);
|
|
422
423
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
//
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
// corresponding (failed) absl status.
|
|
431
|
-
absl::Status HandleError(const std::optional<uint32_t> stream_id,
|
|
432
|
-
Http2Status status, DebugLocation whence = {}) {
|
|
433
|
-
auto error_type = status.GetType();
|
|
434
|
-
GRPC_DCHECK(error_type != Http2Status::Http2ErrorType::kOk);
|
|
435
|
-
|
|
436
|
-
if (error_type == Http2Status::Http2ErrorType::kStreamError) {
|
|
437
|
-
GRPC_HTTP2_CLIENT_ERROR_DLOG << "Stream Error: " << status.DebugString();
|
|
438
|
-
GRPC_DCHECK(stream_id.has_value());
|
|
439
|
-
// Passing a cancelled server metadata handle to propagate the error
|
|
440
|
-
// to the upper layers.
|
|
441
|
-
BeginCloseStream(
|
|
442
|
-
LookupStream(stream_id.value()),
|
|
443
|
-
Http2ErrorCodeToFrameErrorCode(status.GetStreamErrorCode()),
|
|
444
|
-
CancelledServerMetadataFromStatus(status.GetAbslStreamError()),
|
|
445
|
-
whence);
|
|
446
|
-
return absl::OkStatus();
|
|
447
|
-
} else if (error_type == Http2Status::Http2ErrorType::kConnectionError) {
|
|
448
|
-
GRPC_HTTP2_CLIENT_ERROR_DLOG << "Connection Error: "
|
|
449
|
-
<< status.DebugString();
|
|
450
|
-
absl::Status absl_status = status.GetAbslConnectionError();
|
|
451
|
-
MaybeSpawnCloseTransport(std::move(status), whence);
|
|
452
|
-
return absl_status;
|
|
453
|
-
}
|
|
454
|
-
GPR_UNREACHABLE_CODE(return absl::InternalError("Invalid error type"));
|
|
424
|
+
void MaybeGetWindowUpdateFrames(FrameSender& frame_sender);
|
|
425
|
+
|
|
426
|
+
auto FlowControlPeriodicUpdateLoop();
|
|
427
|
+
|
|
428
|
+
// TODO(tjagtap) [PH2][P2][BDP] Remove this when the BDP code is done.
|
|
429
|
+
void AddPeriodicUpdatePromiseWaker() {
|
|
430
|
+
periodic_updates_waker_ = GetContext<Activity>()->MakeNonOwningWaker();
|
|
455
431
|
}
|
|
456
432
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
433
|
+
// TODO(tjagtap) [PH2][P2][BDP] Remove this when the BDP code is done.
|
|
434
|
+
void WakeupPeriodicUpdatePromise() { periodic_updates_waker_.Wakeup(); }
|
|
435
|
+
|
|
436
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
437
|
+
// Stream List Operations
|
|
438
|
+
|
|
439
|
+
RefCountedPtr<Stream> LookupStream(uint32_t stream_id);
|
|
440
|
+
|
|
441
|
+
void AddToStreamList(RefCountedPtr<Stream> stream);
|
|
442
|
+
|
|
443
|
+
absl::Status MaybeAddStreamToWritableStreamList(
|
|
444
|
+
const RefCountedPtr<Stream> stream,
|
|
445
|
+
const StreamDataQueue<ClientMetadataHandle>::StreamWritabilityUpdate
|
|
446
|
+
result);
|
|
447
|
+
|
|
448
|
+
// Returns the next stream id. If the next stream id is not available, it
|
|
449
|
+
// returns std::nullopt. MUST be called from the transport party.
|
|
450
|
+
absl::StatusOr<uint32_t> NextStreamId();
|
|
451
|
+
|
|
452
|
+
// Returns the next stream id without incrementing it. MUST be called from the
|
|
453
|
+
// transport party.
|
|
454
|
+
uint32_t PeekNextStreamId() const { return next_stream_id_; }
|
|
455
|
+
|
|
456
|
+
// Returns the last stream id sent by the transport. If no streams were sent,
|
|
457
|
+
// returns 0. MUST be called from the transport party.
|
|
458
|
+
uint32_t GetLastStreamId() const {
|
|
459
|
+
const uint32_t next_stream_id = PeekNextStreamId();
|
|
460
|
+
return (next_stream_id > 1) ? (next_stream_id - 2) : 0;
|
|
461
|
+
}
|
|
460
462
|
|
|
461
|
-
//
|
|
462
|
-
//
|
|
463
|
-
//
|
|
464
|
-
|
|
465
|
-
//
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
//
|
|
469
|
-
//
|
|
470
|
-
//
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
463
|
+
// Returns the number of active streams. A stream is removed from the `active`
|
|
464
|
+
// list once both client and server agree to close the stream. The count of
|
|
465
|
+
// stream_list_(even though stream list represents streams open for reads)
|
|
466
|
+
// works here because of the following cases where the stream is closed:
|
|
467
|
+
// 1. Reading a RST_STREAM frame: In this case, the stream is immediately
|
|
468
|
+
// closed for reads and writes and removed from the stream_list_
|
|
469
|
+
// (effectively tracking the number of active streams).
|
|
470
|
+
// 2. Reading a Trailing Metadata frame: In this case, the stream MAY be
|
|
471
|
+
// closed for reads and writes immediately which follows the above case. In
|
|
472
|
+
// other cases, the transport either reads RST_STREAM frame from the server
|
|
473
|
+
// (and follows case 1) or sends a half close frame and closes the stream
|
|
474
|
+
// for reads and writes (in the multiplexer loop).
|
|
475
|
+
// 3. Hitting error condition in the transport: In this case, RST_STREAM is
|
|
476
|
+
// is enqueued and the stream is closed for reads immediately. This means
|
|
477
|
+
// we effectively reduce the number of active streams inline (because we
|
|
478
|
+
// remove the stream from the stream_list_). This is fine because the
|
|
479
|
+
// priority logic in list of writable streams ensures that the RST_STREAM
|
|
480
|
+
// frame is given priority over any new streams being created by the
|
|
481
|
+
// client.
|
|
482
|
+
// 4. Application abort: In this case, multiplexer loop will write RST_STREAM
|
|
483
|
+
// frame to the endpoint and close the stream from reads and writes. This
|
|
484
|
+
// then follows the same reasoning as case 1.
|
|
485
|
+
inline uint32_t GetActiveStreamCountLocked() const
|
|
486
|
+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(transport_mutex_) {
|
|
487
|
+
return stream_list_.size();
|
|
476
488
|
}
|
|
477
489
|
|
|
478
|
-
|
|
490
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
491
|
+
// Stream Operations
|
|
479
492
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
493
|
+
// This function MUST run on the transport party.
|
|
494
|
+
void CloseTransport();
|
|
495
|
+
|
|
496
|
+
void MaybeSpawnCloseTransport(Http2Status http2_status,
|
|
497
|
+
DebugLocation whence = {});
|
|
484
498
|
|
|
485
499
|
uint32_t GetMaxAllowedStreamId() const;
|
|
486
500
|
|
|
@@ -489,23 +503,46 @@ class Http2ClientTransport final : public ClientTransport,
|
|
|
489
503
|
bool CanCloseTransportLocked() const
|
|
490
504
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(transport_mutex_);
|
|
491
505
|
|
|
492
|
-
|
|
506
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
507
|
+
// Ping Keepalive and Goaway
|
|
493
508
|
|
|
494
|
-
|
|
495
|
-
Duration
|
|
496
|
-
|
|
497
|
-
std::optional<PingManager> ping_manager_;
|
|
498
|
-
std::optional<KeepaliveManager> keepalive_manager_;
|
|
499
|
-
|
|
500
|
-
// Flags
|
|
501
|
-
bool keepalive_permit_without_calls_;
|
|
509
|
+
void MaybeSpawnPingTimeout(std::optional<uint64_t> opaque_data);
|
|
510
|
+
void MaybeSpawnDelayedPing(std::optional<Duration> delayed_ping_wait);
|
|
511
|
+
void MaybeSpawnKeepaliveLoop();
|
|
502
512
|
|
|
503
513
|
auto SendPing(absl::AnyInvocable<void()> on_initiate, bool important) {
|
|
504
514
|
return ping_manager_->RequestPing(std::move(on_initiate), important);
|
|
505
515
|
}
|
|
516
|
+
|
|
506
517
|
auto WaitForPingAck() { return ping_manager_->WaitForPingAck(); }
|
|
507
518
|
|
|
508
|
-
|
|
519
|
+
// Ping Helper functions
|
|
520
|
+
Duration NextAllowedPingInterval() {
|
|
521
|
+
MutexLock lock(&transport_mutex_);
|
|
522
|
+
return (!keepalive_permit_without_calls_ &&
|
|
523
|
+
GetActiveStreamCountLocked() == 0)
|
|
524
|
+
? Duration::Hours(2)
|
|
525
|
+
: Duration::Seconds(1);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
absl::Status AckPing(uint64_t opaque_data);
|
|
529
|
+
|
|
530
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
531
|
+
// Error Path and Close Path
|
|
532
|
+
|
|
533
|
+
// Handles the error status and returns the corresponding absl status. Absl
|
|
534
|
+
// Status is returned so that the error can be gracefully handled
|
|
535
|
+
// by promise primitives.
|
|
536
|
+
// If the error is a stream error, it closes the stream and returns an ok
|
|
537
|
+
// status. Ok status is returned because the calling transport promise loops
|
|
538
|
+
// should not be cancelled in case of stream errors.
|
|
539
|
+
// If the error is a connection error, it closes the transport and returns the
|
|
540
|
+
// corresponding (failed) absl status.
|
|
541
|
+
absl::Status HandleError(const std::optional<uint32_t> stream_id,
|
|
542
|
+
Http2Status status, DebugLocation whence = {});
|
|
543
|
+
|
|
544
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
545
|
+
// Misc Transport Stuff
|
|
509
546
|
|
|
510
547
|
void ReportDisconnection(const absl::Status& status,
|
|
511
548
|
StateWatcher::DisconnectInfo disconnect_info,
|
|
@@ -516,70 +553,42 @@ class Http2ClientTransport final : public ClientTransport,
|
|
|
516
553
|
const char* reason)
|
|
517
554
|
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&transport_mutex_);
|
|
518
555
|
|
|
519
|
-
|
|
520
|
-
Duration NextAllowedPingInterval() {
|
|
521
|
-
MutexLock lock(&transport_mutex_);
|
|
522
|
-
return (!keepalive_permit_without_calls_ &&
|
|
523
|
-
GetActiveStreamCountLocked() == 0)
|
|
524
|
-
? Duration::Hours(2)
|
|
525
|
-
: Duration::Seconds(1);
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
auto AckPing(uint64_t opaque_data) {
|
|
529
|
-
bool valid_ping_ack_received = true;
|
|
556
|
+
bool SetOnDone(CallHandler call_handler, RefCountedPtr<Stream> stream);
|
|
530
557
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
<< opaque_data;
|
|
534
|
-
valid_ping_ack_received = false;
|
|
535
|
-
}
|
|
558
|
+
void ReadChannelArgs(const ChannelArgs& channel_args,
|
|
559
|
+
TransportChannelArgs& args);
|
|
536
560
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
561
|
+
auto SecurityFrameLoop() {
|
|
562
|
+
GRPC_HTTP2_CLIENT_DLOG << "Http2ClientTransport::SecurityFrameLoop Factory";
|
|
563
|
+
return AssertResultType<Empty>(Loop([this]() {
|
|
564
|
+
return Map(security_frame_handler_->WaitForSecurityFrameSending(),
|
|
565
|
+
[this](Empty) -> LoopCtl<Empty> {
|
|
566
|
+
if (security_frame_handler_->TriggerWriteSecurityFrame()
|
|
567
|
+
.terminate) {
|
|
568
|
+
return Empty{};
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
if (!TriggerWriteCycleOrHandleError()) {
|
|
572
|
+
return Empty{};
|
|
573
|
+
}
|
|
574
|
+
return Continue();
|
|
575
|
+
});
|
|
576
|
+
}));
|
|
550
577
|
}
|
|
551
578
|
|
|
579
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
580
|
+
// Inner Classes and Structs
|
|
581
|
+
|
|
552
582
|
class PingSystemInterfaceImpl : public PingInterface {
|
|
553
583
|
public:
|
|
554
|
-
static std::unique_ptr<PingInterface> Make(
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
PingSystemInterfaceImpl(transport));
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
Promise<absl::Status> TriggerWrite() override {
|
|
561
|
-
return transport_->TriggerWriteCycle();
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
Promise<absl::Status> PingTimeout() override {
|
|
565
|
-
GRPC_HTTP2_CLIENT_DLOG << "Ping timeout at time: " << Timestamp::Now();
|
|
566
|
-
|
|
567
|
-
// TODO(akshitpatel) : [PH2][P2] : The error code here has been chosen
|
|
568
|
-
// based on CHTTP2's usage of GRPC_STATUS_UNAVAILABLE (which corresponds
|
|
569
|
-
// to kRefusedStream). However looking at RFC9113, definition of
|
|
570
|
-
// kRefusedStream doesn't seem to fit this case. We should revisit this
|
|
571
|
-
// and update the error code.
|
|
572
|
-
return Immediate(transport_->HandleError(
|
|
573
|
-
std::nullopt,
|
|
574
|
-
Http2Status::Http2ConnectionError(Http2ErrorCode::kRefusedStream,
|
|
575
|
-
GRPC_CHTTP2_PING_TIMEOUT_STR)));
|
|
576
|
-
}
|
|
584
|
+
static std::unique_ptr<PingInterface> Make(Http2ClientTransport* transport);
|
|
585
|
+
absl::Status TriggerWrite() override;
|
|
586
|
+
Promise<absl::Status> PingTimeout() override;
|
|
577
587
|
|
|
578
588
|
private:
|
|
579
|
-
//
|
|
580
|
-
//
|
|
581
|
-
//
|
|
582
|
-
// transport and greatly simpilfy the cleanup path.
|
|
589
|
+
// Holding a raw pointer to transport works because all the promises
|
|
590
|
+
// invoking the methods of this class are invoked while holding a ref to the
|
|
591
|
+
// transport.
|
|
583
592
|
Http2ClientTransport* transport_;
|
|
584
593
|
explicit PingSystemInterfaceImpl(Http2ClientTransport* transport)
|
|
585
594
|
: transport_(transport) {}
|
|
@@ -588,135 +597,109 @@ class Http2ClientTransport final : public ClientTransport,
|
|
|
588
597
|
class KeepAliveInterfaceImpl : public KeepAliveInterface {
|
|
589
598
|
public:
|
|
590
599
|
static std::unique_ptr<KeepAliveInterface> Make(
|
|
591
|
-
Http2ClientTransport* transport)
|
|
592
|
-
return std::make_unique<KeepAliveInterfaceImpl>(
|
|
593
|
-
KeepAliveInterfaceImpl(transport));
|
|
594
|
-
}
|
|
600
|
+
Http2ClientTransport* transport);
|
|
595
601
|
|
|
596
602
|
private:
|
|
597
603
|
explicit KeepAliveInterfaceImpl(Http2ClientTransport* transport)
|
|
598
604
|
: transport_(transport) {}
|
|
599
|
-
Promise<absl::Status> SendPingAndWaitForAck() override
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
GRPC_HTTP2_CLIENT_DLOG << "Keepalive timeout triggered";
|
|
606
|
-
|
|
607
|
-
// TODO(akshitpatel) : [PH2][P2] : The error code here has been chosen
|
|
608
|
-
// based on CHTTP2's usage of GRPC_STATUS_UNAVAILABLE (which corresponds
|
|
609
|
-
// to kRefusedStream). However looking at RFC9113, definition of
|
|
610
|
-
// kRefusedStream doesn't seem to fit this case. We should revisit this
|
|
611
|
-
// and update the error code.
|
|
612
|
-
return Immediate(transport_->HandleError(
|
|
613
|
-
std::nullopt, Http2Status::Http2ConnectionError(
|
|
614
|
-
Http2ErrorCode::kRefusedStream,
|
|
615
|
-
GRPC_CHTTP2_KEEPALIVE_TIMEOUT_STR)));
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
bool NeedToSendKeepAlivePing() override {
|
|
619
|
-
bool need_to_send_ping = false;
|
|
620
|
-
{
|
|
621
|
-
MutexLock lock(&transport_->transport_mutex_);
|
|
622
|
-
need_to_send_ping = (transport_->keepalive_permit_without_calls_ ||
|
|
623
|
-
transport_->GetActiveStreamCountLocked() > 0);
|
|
624
|
-
}
|
|
625
|
-
return need_to_send_ping;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
// TODO(akshitpatel) : [PH2][P2] : Eventually there should be a separate ref
|
|
629
|
-
// counted struct/class passed to all the transport promises/members. This
|
|
630
|
-
// will help removing back references from the transport members to
|
|
631
|
-
// transport and greatly simpilfy the cleanup path.
|
|
605
|
+
Promise<absl::Status> SendPingAndWaitForAck() override;
|
|
606
|
+
Promise<absl::Status> OnKeepAliveTimeout() override;
|
|
607
|
+
bool NeedToSendKeepAlivePing() override;
|
|
608
|
+
// Holding a raw pointer to transport works because all the promises
|
|
609
|
+
// invoking the methods of this class are invoked while holding a ref to the
|
|
610
|
+
// transport.
|
|
632
611
|
Http2ClientTransport* transport_;
|
|
633
612
|
};
|
|
634
613
|
|
|
635
614
|
class GoawayInterfaceImpl : public GoawayInterface {
|
|
636
615
|
public:
|
|
637
616
|
static std::unique_ptr<GoawayInterface> Make(
|
|
638
|
-
Http2ClientTransport* transport)
|
|
639
|
-
return std::make_unique<GoawayInterfaceImpl>(
|
|
640
|
-
GoawayInterfaceImpl(transport));
|
|
641
|
-
}
|
|
617
|
+
Http2ClientTransport* transport);
|
|
642
618
|
|
|
643
619
|
Promise<absl::Status> SendPingAndWaitForAck() override {
|
|
644
620
|
return transport_->ping_manager_->RequestPing(/*on_initiate=*/[] {},
|
|
645
621
|
/*important=*/true);
|
|
646
622
|
}
|
|
647
623
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
uint32_t GetLastAcceptedStreamId() override {
|
|
651
|
-
GRPC_DCHECK(false)
|
|
652
|
-
<< "GetLastAcceptedStreamId is not implemented for client transport.";
|
|
653
|
-
LOG(ERROR) << "GetLastAcceptedStreamId is not implemented for client "
|
|
654
|
-
"transport.";
|
|
655
|
-
return 0;
|
|
624
|
+
absl::Status TriggerWriteCycle() override {
|
|
625
|
+
return transport_->TriggerWriteCycle();
|
|
656
626
|
}
|
|
627
|
+
uint32_t GetLastAcceptedStreamId() override;
|
|
657
628
|
|
|
658
629
|
private:
|
|
659
630
|
explicit GoawayInterfaceImpl(Http2ClientTransport* transport)
|
|
660
631
|
: transport_(transport) {}
|
|
661
|
-
|
|
632
|
+
// Holding a raw pointer to transport works because all the promises
|
|
633
|
+
// invoking the methods of this class are invoked while holding a ref to the
|
|
634
|
+
// transport.
|
|
662
635
|
Http2ClientTransport* transport_;
|
|
663
636
|
};
|
|
664
637
|
|
|
638
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
639
|
+
// All Data Members
|
|
640
|
+
|
|
641
|
+
RefCountedPtr<Party> general_party_; // Refer Gemini.md for party slot usage
|
|
642
|
+
std::shared_ptr<grpc_event_engine::experimental::EventEngine> event_engine_;
|
|
643
|
+
|
|
644
|
+
PromiseEndpoint endpoint_;
|
|
645
|
+
RefCountedPtr<SettingsPromiseManager> settings_;
|
|
646
|
+
|
|
647
|
+
Http2FrameHeader current_frame_header_;
|
|
648
|
+
|
|
649
|
+
Mutex transport_mutex_;
|
|
650
|
+
|
|
651
|
+
absl::flat_hash_map<uint32_t, RefCountedPtr<Stream>> stream_list_
|
|
652
|
+
ABSL_GUARDED_BY(transport_mutex_);
|
|
653
|
+
|
|
654
|
+
uint32_t next_stream_id_;
|
|
655
|
+
HPackCompressor encoder_;
|
|
656
|
+
HPackParser parser_;
|
|
657
|
+
bool is_transport_closed_ ABSL_GUARDED_BY(transport_mutex_) = false;
|
|
658
|
+
Latch<void> transport_closed_latch_;
|
|
659
|
+
|
|
660
|
+
ConnectivityStateTracker state_tracker_ ABSL_GUARDED_BY(transport_mutex_){
|
|
661
|
+
"http2_client", GRPC_CHANNEL_READY};
|
|
662
|
+
|
|
663
|
+
RefCountedPtr<StateWatcher> watcher_ ABSL_GUARDED_BY(transport_mutex_);
|
|
664
|
+
|
|
665
|
+
bool should_reset_ping_clock_;
|
|
666
|
+
IncomingMetadataTracker incoming_headers_;
|
|
667
|
+
|
|
668
|
+
// Transport wide write context. This is used to track the state of the
|
|
669
|
+
// transport during write cycles.
|
|
670
|
+
TransportWriteContext transport_write_context_;
|
|
671
|
+
|
|
672
|
+
// Tracks the max allowed stream id. Currently this is only set on receiving a
|
|
673
|
+
// graceful GOAWAY frame.
|
|
674
|
+
uint32_t max_allowed_stream_id_ = RFC9113::kMaxStreamId31Bit;
|
|
675
|
+
|
|
676
|
+
// Duration between two consecutive keepalive pings.
|
|
677
|
+
Duration keepalive_time_;
|
|
678
|
+
bool test_only_ack_pings_;
|
|
679
|
+
std::optional<PingManager> ping_manager_;
|
|
680
|
+
std::optional<KeepaliveManager> keepalive_manager_;
|
|
681
|
+
|
|
682
|
+
// Flags
|
|
683
|
+
bool keepalive_permit_without_calls_;
|
|
684
|
+
|
|
665
685
|
GoawayManager goaway_manager_;
|
|
666
686
|
|
|
667
687
|
WritableStreams<RefCountedPtr<Stream>> writable_stream_list_;
|
|
668
688
|
|
|
669
|
-
absl::Status MaybeAddStreamToWritableStreamList(
|
|
670
|
-
const RefCountedPtr<Stream> stream,
|
|
671
|
-
const StreamDataQueue<ClientMetadataHandle>::StreamWritabilityUpdate
|
|
672
|
-
result) {
|
|
673
|
-
if (result.became_writable) {
|
|
674
|
-
GRPC_HTTP2_CLIENT_DLOG
|
|
675
|
-
<< "Http2ClientTransport MaybeAddStreamToWritableStreamList "
|
|
676
|
-
" Stream id: "
|
|
677
|
-
<< stream->GetStreamId() << " became writable";
|
|
678
|
-
absl::Status status =
|
|
679
|
-
writable_stream_list_.Enqueue(stream, result.priority);
|
|
680
|
-
if (!status.ok()) {
|
|
681
|
-
return HandleError(
|
|
682
|
-
std::nullopt,
|
|
683
|
-
Http2Status::Http2ConnectionError(
|
|
684
|
-
Http2ErrorCode::kRefusedStream,
|
|
685
|
-
"Failed to enqueue stream to writable stream list"));
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
return absl::OkStatus();
|
|
689
|
-
}
|
|
690
|
-
bool SetOnDone(CallHandler call_handler, RefCountedPtr<Stream> stream);
|
|
691
|
-
absl::StatusOr<std::vector<Http2Frame>> DequeueStreamFrames(
|
|
692
|
-
RefCountedPtr<Stream> stream);
|
|
693
|
-
|
|
694
689
|
/// Based on channel args, preferred_rx_crypto_frame_sizes are advertised to
|
|
695
690
|
/// the peer
|
|
696
691
|
bool enable_preferred_rx_crypto_frame_advertisement_;
|
|
692
|
+
RefCountedPtr<SecurityFrameHandler> security_frame_handler_;
|
|
697
693
|
MemoryOwner memory_owner_;
|
|
698
694
|
chttp2::TransportFlowControl flow_control_;
|
|
699
695
|
std::shared_ptr<PromiseHttp2ZTraceCollector> ztrace_collector_;
|
|
700
|
-
absl::flat_hash_set<uint32_t> window_update_list_;
|
|
701
696
|
|
|
702
697
|
// TODO(tjagtap) [PH2][P2][BDP] Remove this when the BDP code is done.
|
|
703
698
|
Waker periodic_updates_waker_;
|
|
704
699
|
|
|
705
700
|
Http2ReadContext reader_state_;
|
|
706
|
-
Http2Status ParseAndDiscardHeaders(SliceBuffer&& buffer, bool is_end_headers,
|
|
707
|
-
RefCountedPtr<Stream> stream,
|
|
708
|
-
Http2Status&& original_status,
|
|
709
|
-
DebugLocation whence = {});
|
|
710
|
-
void ReadChannelArgs(const ChannelArgs& channel_args,
|
|
711
|
-
TransportChannelArgs& args);
|
|
712
701
|
};
|
|
713
702
|
|
|
714
|
-
// Since the corresponding class in CHTTP2 is about 3.9KB, our goal is to
|
|
715
|
-
// remain within that range. When this check fails, please update it to size
|
|
716
|
-
// (current size + 32) to make sure that it does not fail each time we add a
|
|
717
|
-
// small variable to the class.
|
|
718
|
-
GRPC_CHECK_CLASS_SIZE(Http2ClientTransport, 600);
|
|
719
|
-
|
|
720
703
|
} // namespace http2
|
|
721
704
|
} // namespace grpc_core
|
|
722
705
|
|