grpc 1.56.2 → 1.57.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +29 -22
- data/include/grpc/event_engine/event_engine.h +22 -32
- data/include/grpc/impl/grpc_types.h +3 -0
- data/include/grpc/support/port_platform.h +29 -23
- data/src/core/ext/filters/client_channel/client_channel.cc +44 -8
- data/src/core/ext/filters/client_channel/dynamic_filters.h +3 -3
- data/src/core/ext/filters/client_channel/http_proxy.cc +5 -0
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +21 -52
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +19 -7
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +25 -35
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +78 -132
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +2 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +4 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +3 -1
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +38 -15
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client.h +3 -5
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client_internal.h +22 -6
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h +2 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +97 -71
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +2 -16
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +56 -11
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.h +25 -0
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +6 -32
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +4 -6
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +20 -79
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +31 -19
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +7 -41
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +3 -67
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +8 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +31 -74
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +7 -51
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +16 -87
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +16 -50
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +12 -74
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +1 -4
- data/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +69 -59
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +7 -2
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +1 -0
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +25 -13
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +366 -311
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +17 -1
- data/src/core/ext/filters/client_channel/retry_filter.cc +39 -2498
- data/src/core/ext/filters/client_channel/retry_filter.h +91 -1
- data/src/core/ext/filters/client_channel/retry_filter_legacy_call_data.cc +2052 -0
- data/src/core/ext/filters/client_channel/retry_filter_legacy_call_data.h +442 -0
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +38 -58
- data/src/core/ext/filters/client_channel/subchannel.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +3 -0
- data/src/core/ext/filters/rbac/rbac_filter.cc +40 -111
- data/src/core/ext/filters/rbac/rbac_filter.h +12 -30
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +162 -86
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +0 -6
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +7 -4
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +131 -186
- data/src/core/ext/transport/chttp2/transport/decode_huff.cc +6569 -174
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +2278 -441
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +2 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +4 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +9 -8
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +4 -4
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +3 -2
- data/src/core/ext/transport/chttp2/transport/internal.h +8 -4
- data/src/core/ext/transport/chttp2/transport/parsing.cc +15 -3
- data/src/core/ext/transport/chttp2/transport/writing.cc +2 -3
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +27 -6
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +143 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +2 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +0 -39
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +13 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +35 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +17 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +85 -20
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +26 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +45 -3
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +4 -3
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +21 -0
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +30 -6
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +180 -0
- data/src/core/ext/upb-generated/envoy/data/accesslog/v3/accesslog.upb.c +558 -0
- data/src/core/ext/upb-generated/envoy/data/accesslog/v3/accesslog.upb.h +2710 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +30 -11
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +53 -24
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +30 -5
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +110 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +41 -15
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +150 -27
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +1 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.h +93 -0
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +88 -76
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +11 -12
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +0 -5
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +162 -160
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +129 -118
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +141 -135
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c +19 -12
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +38 -30
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/data/accesslog/v3/accesslog.upbdefs.c +402 -0
- data/src/core/ext/upbdefs-generated/envoy/data/accesslog/v3/accesslog.upbdefs.h +111 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +80 -74
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +63 -47
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +315 -293
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +29 -29
- data/src/core/ext/xds/xds_bootstrap_grpc.cc +33 -30
- data/src/core/ext/xds/xds_bootstrap_grpc.h +5 -13
- data/src/core/ext/xds/xds_client_grpc.cc +11 -6
- data/src/core/ext/xds/xds_client_grpc.h +16 -2
- data/src/core/ext/xds/xds_client_stats.h +10 -0
- data/src/core/ext/xds/xds_cluster.cc +26 -16
- data/src/core/ext/xds/xds_endpoint.cc +4 -7
- data/src/core/ext/xds/xds_health_status.cc +0 -17
- data/src/core/ext/xds/xds_health_status.h +5 -25
- data/src/core/ext/xds/xds_lb_policy_registry.cc +39 -0
- data/src/core/ext/xds/xds_route_config.cc +4 -0
- data/src/core/ext/xds/xds_transport_grpc.cc +1 -3
- data/src/core/lib/address_utils/parse_address.cc +63 -1
- data/src/core/lib/address_utils/parse_address.h +8 -0
- data/src/core/lib/address_utils/sockaddr_utils.cc +46 -1
- data/src/core/lib/address_utils/sockaddr_utils.h +2 -2
- data/src/core/lib/channel/channel_args.cc +21 -10
- data/src/core/lib/channel/channel_args.h +3 -0
- data/src/core/lib/channel/connected_channel.cc +4 -1
- data/src/core/lib/channel/promise_based_filter.h +1 -0
- data/src/core/lib/debug/trace.cc +1 -4
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +2 -1
- data/src/core/lib/event_engine/cf_engine/cf_engine.h +1 -1
- data/src/core/lib/event_engine/event_engine.cc +0 -12
- data/src/core/lib/event_engine/forkable.cc +47 -42
- data/src/core/lib/event_engine/handle_containers.h +0 -4
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +4 -6
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +4 -6
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +25 -11
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +3 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +2 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +8 -12
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +37 -27
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +2 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +4 -2
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +42 -2
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +6 -0
- data/src/core/lib/event_engine/posix_engine/timer.h +10 -37
- data/src/core/lib/event_engine/tcp_socket_utils.cc +67 -7
- data/src/core/lib/event_engine/tcp_socket_utils.h +3 -0
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +90 -37
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +32 -12
- data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc +12 -21
- data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.h +8 -12
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +55 -54
- data/src/core/lib/event_engine/windows/windows_endpoint.h +15 -12
- data/src/core/lib/event_engine/windows/windows_engine.cc +2 -1
- data/src/core/lib/event_engine/windows/windows_engine.h +8 -12
- data/src/core/lib/experiments/config.cc +60 -22
- data/src/core/lib/experiments/config.h +20 -8
- data/src/core/lib/experiments/experiments.cc +278 -0
- data/src/core/lib/experiments/experiments.h +59 -1
- data/src/core/lib/gprpp/dual_ref_counted.h +9 -9
- data/src/core/lib/gprpp/fork.cc +8 -9
- data/src/core/lib/gprpp/fork.h +6 -5
- data/src/core/lib/gprpp/if_list.h +4530 -0
- data/src/core/lib/gprpp/orphanable.h +3 -3
- data/src/core/lib/gprpp/ref_counted.h +6 -6
- data/src/core/lib/gprpp/sorted_pack.h +3 -12
- data/src/core/lib/gprpp/status_helper.h +16 -15
- data/src/core/lib/gprpp/time.h +12 -0
- data/src/core/lib/gprpp/type_list.h +32 -0
- data/src/core/lib/http/httpcli.h +6 -9
- data/src/core/lib/iomgr/error.cc +32 -2
- data/src/core/lib/iomgr/error.h +9 -10
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +5 -7
- data/src/core/lib/iomgr/ev_poll_posix.cc +6 -5
- data/src/core/lib/iomgr/exec_ctx.h +11 -0
- data/src/core/lib/iomgr/pollset.h +4 -5
- data/src/core/lib/iomgr/port.h +10 -0
- data/src/core/lib/iomgr/resolve_address.cc +13 -1
- data/src/core/lib/iomgr/resolve_address.h +17 -3
- data/src/core/lib/iomgr/sockaddr_posix.h +7 -0
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +29 -0
- data/src/core/lib/iomgr/socket_utils_posix.cc +2 -0
- data/src/core/lib/iomgr/socket_utils_posix.h +6 -0
- data/src/core/lib/iomgr/tcp_client_posix.cc +4 -1
- data/src/core/lib/iomgr/tcp_posix.cc +21 -4
- data/src/core/lib/iomgr/tcp_server_posix.cc +3 -2
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +5 -2
- data/src/core/lib/iomgr/tcp_windows.cc +1 -3
- data/src/core/lib/iomgr/vsock.cc +59 -0
- data/src/core/lib/iomgr/vsock.h +38 -0
- data/src/core/lib/iomgr/wakeup_fd_posix.h +3 -6
- data/src/core/lib/load_balancing/delegating_helper.h +115 -0
- data/src/core/lib/load_balancing/lb_policy.h +20 -0
- data/src/core/lib/load_balancing/subchannel_interface.h +6 -0
- data/src/core/lib/promise/party.h +1 -1
- data/src/core/lib/resolver/resolver_factory.h +3 -2
- data/src/core/lib/resolver/server_address.cc +9 -94
- data/src/core/lib/resolver/server_address.h +10 -64
- data/src/core/lib/resource_quota/memory_quota.h +1 -1
- data/src/core/lib/security/credentials/channel_creds_registry.h +51 -27
- data/src/core/lib/security/credentials/channel_creds_registry_init.cc +169 -9
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +1 -1
- data/src/core/lib/security/credentials/composite/composite_credentials.h +3 -1
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +40 -1
- data/src/core/lib/security/credentials/external/external_account_credentials.h +6 -0
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +30 -38
- data/src/core/lib/security/credentials/fake/fake_credentials.h +28 -0
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +1 -1
- data/src/core/lib/security/credentials/tls/tls_credentials.h +3 -1
- data/src/core/lib/service_config/service_config_call_data.h +5 -0
- data/src/core/lib/slice/slice.h +16 -0
- data/src/core/lib/surface/call.cc +31 -29
- data/src/core/lib/surface/server.h +2 -2
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/metadata_batch.cc +7 -7
- data/src/core/lib/transport/metadata_batch.h +86 -48
- data/src/core/lib/transport/parsed_metadata.h +34 -20
- data/src/core/lib/transport/simple_slice_based_metadata.h +9 -2
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +4 -6
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +1 -2
- data/src/core/tsi/ssl_transport_security.cc +28 -7
- data/src/ruby/bin/math_pb.rb +24 -18
- data/src/ruby/ext/grpc/extconf.rb +19 -18
- data/src/ruby/ext/grpc/rb_call.c +62 -39
- data/src/ruby/ext/grpc/rb_call_credentials.c +0 -1
- data/src/ruby/ext/grpc/rb_channel.c +126 -49
- data/src/ruby/ext/grpc/rb_channel.h +1 -0
- data/src/ruby/ext/grpc/rb_channel_args.c +16 -2
- data/src/ruby/ext/grpc/rb_channel_args.h +4 -0
- data/src/ruby/ext/grpc/rb_channel_credentials.c +0 -1
- data/src/ruby/ext/grpc/rb_compression_options.c +0 -1
- data/src/ruby/ext/grpc/rb_event_thread.c +22 -6
- data/src/ruby/ext/grpc/rb_event_thread.h +1 -0
- data/src/ruby/ext/grpc/rb_grpc.c +192 -30
- data/src/ruby/ext/grpc/rb_grpc.h +8 -2
- data/src/ruby/ext/grpc/rb_server.c +62 -45
- data/src/ruby/ext/grpc/rb_server_credentials.c +0 -1
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +0 -1
- data/src/ruby/ext/grpc/rb_xds_server_credentials.c +0 -1
- data/src/ruby/lib/grpc/generic/bidi_call.rb +2 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_pb.rb +24 -13
- data/src/ruby/pb/src/proto/grpc/testing/empty_pb.rb +24 -3
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +25 -111
- data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +25 -2
- data/third_party/boringssl-with-bazel/err_data.c +552 -552
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +34 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +4 -1
- data/third_party/boringssl-with-bazel/src/crypto/bio/bio.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/bio/bio_mem.c +7 -8
- data/third_party/boringssl-with-bazel/src/crypto/bio/connect.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bio/fd.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +8 -8
- data/third_party/boringssl-with-bazel/src/crypto/bio/socket.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c +19 -1
- data/third_party/boringssl-with-bazel/src/crypto/chacha/internal.h +8 -1
- data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +28 -185
- data/third_party/boringssl-with-bazel/src/crypto/conf/conf_def.h +3 -7
- data/third_party/boringssl-with-bazel/src/crypto/conf/internal.h +8 -0
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.c +3 -0
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c +49 -46
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519_64_adx.c +18 -0
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519_tables.h +2809 -7417
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/internal.h +27 -5
- data/third_party/boringssl-with-bazel/src/crypto/dsa/internal.h +20 -0
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c +110 -72
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_derive.c +4 -3
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c +15 -14
- data/third_party/boringssl-with-bazel/src/crypto/err/err.c +13 -10
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp.c +35 -12
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_ec.c +2 -4
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_ec_asn1.c +3 -7
- data/third_party/boringssl-with-bazel/src/crypto/evp/pbkdf.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/evp/print.c +7 -6
- data/third_party/boringssl-with-bazel/src/crypto/ex_data.c +34 -72
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/div.c +12 -5
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/gcd.c +5 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +12 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/montgomery.c +17 -18
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/montgomery_inv.c +51 -15
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/rsaz_exp.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/delocate.h +5 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/internal.h +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/builtin_curves.h +277 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +180 -404
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_montgomery.c +24 -57
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/felem.c +17 -13
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h +33 -71
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/oct.c +18 -17
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p224-64.c +5 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256-nistz.c +15 -18
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256.c +9 -11
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/scalar.c +24 -24
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple.c +11 -27
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple_mul.c +8 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/wnaf.c +4 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +9 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/hkdf/hkdf.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/fork_detect.c +40 -26
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +21 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/rand.c +38 -19
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +2 -29
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/internal.h +55 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +33 -52
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +3 -8
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +198 -79
- data/third_party/boringssl-with-bazel/src/crypto/kyber/kyber.c +5 -4
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +7 -8
- data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +19 -23
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/p5_pbev2.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +8 -5
- data/third_party/boringssl-with-bazel/src/crypto/pool/internal.h +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c +7 -6
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/forkunsafe.c +6 -12
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/getentropy.c +48 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/{fuchsia.c → ios.c} +8 -8
- data/third_party/boringssl-with-bazel/src/crypto/{refcount_no_threads.c → rand_extra/trusty.c} +15 -19
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c +41 -19
- data/third_party/boringssl-with-bazel/src/crypto/{refcount_c11.c → refcount.c} +11 -17
- data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +147 -72
- data/third_party/boringssl-with-bazel/src/crypto/thread_none.c +0 -8
- data/third_party/boringssl-with-bazel/src/crypto/thread_pthread.c +6 -35
- data/third_party/boringssl-with-bazel/src/crypto/thread_win.c +5 -26
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c +14 -18
- data/third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c +54 -143
- data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +7 -13
- data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c +2 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c +8 -12
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +19 -20
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509name.c +11 -15
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_name.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +2 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +4 -6
- data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +4 -119
- data/third_party/boringssl-with-bazel/src/include/openssl/asm_base.h +207 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +5 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +2 -116
- data/third_party/boringssl-with-bazel/src/include/openssl/bn.h +0 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/chacha.h +6 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/conf.h +5 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +0 -21
- data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +21 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/ec_key.h +19 -6
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +11 -7
- data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +13 -14
- data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +0 -61
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +127 -81
- data/third_party/boringssl-with-bazel/src/include/openssl/stack.h +224 -209
- data/third_party/boringssl-with-bazel/src/include/openssl/target.h +154 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/thread.h +1 -29
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +4 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +3 -2
- data/third_party/boringssl-with-bazel/src/ssl/extensions.cc +9 -65
- data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +20 -20
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +4 -11
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +24 -18
- data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +37 -30
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +125 -26
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +2 -3
- data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_64_adx.h +691 -0
- data/third_party/upb/upb/collections/map.c +3 -3
- metadata +27 -12
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.cc +0 -42
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.h +0 -64
- data/src/core/ext/transport/chttp2/transport/stream_map.cc +0 -177
- data/src/core/ext/transport/chttp2/transport/stream_map.h +0 -68
- data/third_party/boringssl-with-bazel/src/crypto/refcount_win.c +0 -89
@@ -41,8 +41,10 @@
|
|
41
41
|
|
42
42
|
#include "src/core/lib/compression/compression_internal.h"
|
43
43
|
#include "src/core/lib/gprpp/chunked_vector.h"
|
44
|
+
#include "src/core/lib/gprpp/if_list.h"
|
44
45
|
#include "src/core/lib/gprpp/packed_table.h"
|
45
46
|
#include "src/core/lib/gprpp/time.h"
|
47
|
+
#include "src/core/lib/gprpp/type_list.h"
|
46
48
|
#include "src/core/lib/resource_quota/arena.h"
|
47
49
|
#include "src/core/lib/slice/slice.h"
|
48
50
|
#include "src/core/lib/transport/custom_metadata.h"
|
@@ -78,7 +80,9 @@ struct GrpcTimeoutMetadata {
|
|
78
80
|
using MementoType = Duration;
|
79
81
|
using CompressionTraits = TimeoutCompressor;
|
80
82
|
static absl::string_view key() { return "grpc-timeout"; }
|
81
|
-
static MementoType ParseMemento(Slice value,
|
83
|
+
static MementoType ParseMemento(Slice value,
|
84
|
+
bool will_keep_past_request_lifetime,
|
85
|
+
MetadataParseErrorFn on_error);
|
82
86
|
static ValueType MementoToValue(MementoType timeout);
|
83
87
|
static Slice Encode(ValueType x);
|
84
88
|
static std::string DisplayValue(ValueType x) { return x.ToString(); }
|
@@ -98,7 +102,9 @@ struct TeMetadata {
|
|
98
102
|
using MementoType = ValueType;
|
99
103
|
using CompressionTraits = KnownValueCompressor<ValueType, kTrailers>;
|
100
104
|
static absl::string_view key() { return "te"; }
|
101
|
-
static MementoType ParseMemento(Slice value,
|
105
|
+
static MementoType ParseMemento(Slice value,
|
106
|
+
bool will_keep_past_request_lifetime,
|
107
|
+
MetadataParseErrorFn on_error);
|
102
108
|
static ValueType MementoToValue(MementoType te) { return te; }
|
103
109
|
static StaticSlice Encode(ValueType x) {
|
104
110
|
GPR_ASSERT(x == kTrailers);
|
@@ -126,7 +132,9 @@ struct ContentTypeMetadata {
|
|
126
132
|
using MementoType = ValueType;
|
127
133
|
using CompressionTraits = KnownValueCompressor<ValueType, kApplicationGrpc>;
|
128
134
|
static absl::string_view key() { return "content-type"; }
|
129
|
-
static MementoType ParseMemento(Slice value,
|
135
|
+
static MementoType ParseMemento(Slice value,
|
136
|
+
bool will_keep_past_request_lifetime,
|
137
|
+
MetadataParseErrorFn on_error);
|
130
138
|
static ValueType MementoToValue(MementoType content_type) {
|
131
139
|
return content_type;
|
132
140
|
}
|
@@ -149,7 +157,8 @@ struct HttpSchemeMetadata {
|
|
149
157
|
using MementoType = ValueType;
|
150
158
|
using CompressionTraits = HttpSchemeCompressor;
|
151
159
|
static absl::string_view key() { return ":scheme"; }
|
152
|
-
static MementoType ParseMemento(Slice value,
|
160
|
+
static MementoType ParseMemento(Slice value, bool,
|
161
|
+
MetadataParseErrorFn on_error) {
|
153
162
|
return Parse(value.as_string_view(), on_error);
|
154
163
|
}
|
155
164
|
static ValueType Parse(absl::string_view value,
|
@@ -178,7 +187,9 @@ struct HttpMethodMetadata {
|
|
178
187
|
using MementoType = ValueType;
|
179
188
|
using CompressionTraits = HttpMethodCompressor;
|
180
189
|
static absl::string_view key() { return ":method"; }
|
181
|
-
static MementoType ParseMemento(Slice value,
|
190
|
+
static MementoType ParseMemento(Slice value,
|
191
|
+
bool will_keep_past_request_lifetime,
|
192
|
+
MetadataParseErrorFn on_error);
|
182
193
|
static ValueType MementoToValue(MementoType content_type) {
|
183
194
|
return content_type;
|
184
195
|
}
|
@@ -194,7 +205,9 @@ struct HttpMethodMetadata {
|
|
194
205
|
struct CompressionAlgorithmBasedMetadata {
|
195
206
|
using ValueType = grpc_compression_algorithm;
|
196
207
|
using MementoType = ValueType;
|
197
|
-
static MementoType ParseMemento(Slice value,
|
208
|
+
static MementoType ParseMemento(Slice value,
|
209
|
+
bool will_keep_past_request_lifetime,
|
210
|
+
MetadataParseErrorFn on_error);
|
198
211
|
static ValueType MementoToValue(MementoType x) { return x; }
|
199
212
|
static Slice Encode(ValueType x) {
|
200
213
|
GPR_ASSERT(x != GRPC_COMPRESS_ALGORITHMS_COUNT);
|
@@ -232,7 +245,7 @@ struct GrpcAcceptEncodingMetadata {
|
|
232
245
|
using ValueType = CompressionAlgorithmSet;
|
233
246
|
using MementoType = ValueType;
|
234
247
|
using CompressionTraits = StableValueCompressor;
|
235
|
-
static MementoType ParseMemento(Slice value, MetadataParseErrorFn) {
|
248
|
+
static MementoType ParseMemento(Slice value, bool, MetadataParseErrorFn) {
|
236
249
|
return CompressionAlgorithmSet::FromString(value.as_string_view());
|
237
250
|
}
|
238
251
|
static ValueType MementoToValue(MementoType x) { return x; }
|
@@ -322,7 +335,7 @@ struct SimpleIntBasedMetadataBase {
|
|
322
335
|
template <typename Int, Int kInvalidValue>
|
323
336
|
struct SimpleIntBasedMetadata : public SimpleIntBasedMetadataBase<Int> {
|
324
337
|
static constexpr Int invalid_value() { return kInvalidValue; }
|
325
|
-
static Int ParseMemento(Slice value, MetadataParseErrorFn on_error) {
|
338
|
+
static Int ParseMemento(Slice value, bool, MetadataParseErrorFn on_error) {
|
326
339
|
Int out;
|
327
340
|
if (!absl::SimpleAtoi(value.as_string_view(), &out)) {
|
328
341
|
on_error("not an integer", value);
|
@@ -359,7 +372,9 @@ struct GrpcRetryPushbackMsMetadata {
|
|
359
372
|
static Slice Encode(Duration x) { return Slice::FromInt64(x.millis()); }
|
360
373
|
static int64_t DisplayValue(Duration x) { return x.millis(); }
|
361
374
|
static int64_t DisplayMemento(Duration x) { return DisplayValue(x); }
|
362
|
-
static Duration ParseMemento(Slice value,
|
375
|
+
static Duration ParseMemento(Slice value,
|
376
|
+
bool will_keep_past_request_lifetime,
|
377
|
+
MetadataParseErrorFn on_error);
|
363
378
|
};
|
364
379
|
|
365
380
|
// :status metadata trait.
|
@@ -386,7 +401,7 @@ struct GrpcLbClientStatsMetadata {
|
|
386
401
|
static const char* DisplayMemento(MementoType) {
|
387
402
|
return "<internal-lb-stats>";
|
388
403
|
}
|
389
|
-
static MementoType ParseMemento(Slice, MetadataParseErrorFn) {
|
404
|
+
static MementoType ParseMemento(Slice, bool, MetadataParseErrorFn) {
|
390
405
|
return nullptr;
|
391
406
|
}
|
392
407
|
};
|
@@ -417,7 +432,9 @@ struct LbCostBinMetadata {
|
|
417
432
|
static Slice Encode(const ValueType& x);
|
418
433
|
static std::string DisplayValue(ValueType x);
|
419
434
|
static std::string DisplayMemento(MementoType x) { return DisplayValue(x); }
|
420
|
-
static MementoType ParseMemento(Slice value,
|
435
|
+
static MementoType ParseMemento(Slice value,
|
436
|
+
bool will_keep_past_request_lifetime,
|
437
|
+
MetadataParseErrorFn on_error);
|
421
438
|
};
|
422
439
|
|
423
440
|
// Annotation added by a transport to note whether a failed request was never
|
@@ -517,44 +534,53 @@ struct IsEncodableTrait<Trait, absl::void_t<decltype(Trait::key())>> {
|
|
517
534
|
static const bool value = true;
|
518
535
|
};
|
519
536
|
|
520
|
-
// Helper type - maps a string name to a trait.
|
521
537
|
template <typename MustBeVoid, typename... Traits>
|
522
|
-
struct
|
538
|
+
struct EncodableTraits;
|
523
539
|
|
524
540
|
template <typename Trait, typename... Traits>
|
525
|
-
struct
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
static auto Lookup(absl::string_view key, Op* op)
|
531
|
-
-> decltype(op->Found(Trait())) {
|
532
|
-
if (key == Trait::key()) {
|
533
|
-
return op->Found(Trait());
|
534
|
-
}
|
535
|
-
return NameLookup<void, Traits...>::Lookup(key, op);
|
536
|
-
}
|
541
|
+
struct EncodableTraits<absl::enable_if_t<IsEncodableTrait<Trait>::value, void>,
|
542
|
+
Trait, Traits...> {
|
543
|
+
using List =
|
544
|
+
typename EncodableTraits<void,
|
545
|
+
Traits...>::List::template PushFront<Trait>;
|
537
546
|
};
|
538
547
|
|
539
548
|
template <typename Trait, typename... Traits>
|
540
|
-
struct
|
541
|
-
|
542
|
-
|
543
|
-
static auto Lookup(absl::string_view key, Op* op)
|
544
|
-
-> decltype(NameLookup<void, Traits...>::Lookup(key, op)) {
|
545
|
-
return NameLookup<void, Traits...>::Lookup(key, op);
|
546
|
-
}
|
549
|
+
struct EncodableTraits<absl::enable_if_t<!IsEncodableTrait<Trait>::value, void>,
|
550
|
+
Trait, Traits...> {
|
551
|
+
using List = typename EncodableTraits<void, Traits...>::List;
|
547
552
|
};
|
548
553
|
|
549
554
|
template <>
|
550
|
-
struct
|
555
|
+
struct EncodableTraits<void> {
|
556
|
+
using List = Typelist<>;
|
557
|
+
};
|
558
|
+
|
559
|
+
template <typename Trait>
|
560
|
+
struct EncodableNameLookupKeyComparison {
|
561
|
+
bool operator()(absl::string_view key) { return key == Trait::key(); }
|
562
|
+
};
|
563
|
+
|
564
|
+
template <typename Trait, typename Op>
|
565
|
+
struct EncodableNameLookupOnFound {
|
566
|
+
auto operator()(Op* op) { return op->Found(Trait()); }
|
567
|
+
};
|
568
|
+
|
569
|
+
template <typename... Traits>
|
570
|
+
struct EncodableNameLookup {
|
551
571
|
template <typename Op>
|
552
|
-
static auto Lookup(absl::string_view key, Op* op)
|
553
|
-
|
554
|
-
|
572
|
+
static auto Lookup(absl::string_view key, Op* op) {
|
573
|
+
return IfList(
|
574
|
+
key, op, [key](Op* op) { return op->NotFound(key); },
|
575
|
+
EncodableNameLookupKeyComparison<Traits>()...,
|
576
|
+
EncodableNameLookupOnFound<Traits, Op>()...);
|
555
577
|
}
|
556
578
|
};
|
557
579
|
|
580
|
+
template <typename... Traits>
|
581
|
+
using NameLookup = typename EncodableTraits<
|
582
|
+
void, Traits...>::List::template Instantiate<EncodableNameLookup>;
|
583
|
+
|
558
584
|
// Helper to take a slice to a memento to a value.
|
559
585
|
// By splitting this part out we can scale code size as the number of
|
560
586
|
// (memento, value) types, rather than as the number of traits.
|
@@ -563,9 +589,9 @@ struct ParseValue {
|
|
563
589
|
template <ParseMementoFn parse_memento, MementoToValueFn memento_to_value>
|
564
590
|
static GPR_ATTRIBUTE_NOINLINE auto Parse(Slice* value,
|
565
591
|
MetadataParseErrorFn on_error)
|
566
|
-
-> decltype(memento_to_value(parse_memento(std::move(*value),
|
592
|
+
-> decltype(memento_to_value(parse_memento(std::move(*value), false,
|
567
593
|
on_error))) {
|
568
|
-
return memento_to_value(parse_memento(std::move(*value), on_error));
|
594
|
+
return memento_to_value(parse_memento(std::move(*value), false, on_error));
|
569
595
|
}
|
570
596
|
};
|
571
597
|
|
@@ -575,8 +601,10 @@ struct ParseValue {
|
|
575
601
|
template <typename Container>
|
576
602
|
class ParseHelper {
|
577
603
|
public:
|
578
|
-
ParseHelper(Slice value,
|
604
|
+
ParseHelper(Slice value, bool will_keep_past_request_lifetime,
|
605
|
+
MetadataParseErrorFn on_error, size_t transport_size)
|
579
606
|
: value_(std::move(value)),
|
607
|
+
will_keep_past_request_lifetime_(will_keep_past_request_lifetime),
|
580
608
|
on_error_(on_error),
|
581
609
|
transport_size_(transport_size) {}
|
582
610
|
|
@@ -596,12 +624,14 @@ class ParseHelper {
|
|
596
624
|
}
|
597
625
|
|
598
626
|
private:
|
599
|
-
template <typename T, T (*parse_memento)(Slice, MetadataParseErrorFn)>
|
627
|
+
template <typename T, T (*parse_memento)(Slice, bool, MetadataParseErrorFn)>
|
600
628
|
GPR_ATTRIBUTE_NOINLINE T ParseValueToMemento() {
|
601
|
-
return parse_memento(std::move(value_),
|
629
|
+
return parse_memento(std::move(value_), will_keep_past_request_lifetime_,
|
630
|
+
on_error_);
|
602
631
|
}
|
603
632
|
|
604
633
|
Slice value_;
|
634
|
+
const bool will_keep_past_request_lifetime_;
|
605
635
|
MetadataParseErrorFn on_error_;
|
606
636
|
const size_t transport_size_;
|
607
637
|
};
|
@@ -1096,8 +1126,14 @@ MetadataValueAsSlice(typename Which::ValueType value) {
|
|
1096
1126
|
// static absl::string_view key() { return "grpc-xyz"; }
|
1097
1127
|
// // Parse a memento from a slice
|
1098
1128
|
// // Takes ownership of value
|
1129
|
+
// // If will_keep_past_request_lifetime is true, expect that the returned
|
1130
|
+
// // memento will be kept for a long time, and so try not to keep a ref to
|
1131
|
+
// // the input slice.
|
1099
1132
|
// // Calls fn in the case of an error that should be reported to the user
|
1100
|
-
// static MementoType ParseMemento(
|
1133
|
+
// static MementoType ParseMemento(
|
1134
|
+
// Slice value,
|
1135
|
+
// bool will_keep_past_request_lifetime,
|
1136
|
+
// MementoParseErrorFn fn) {
|
1101
1137
|
// ...
|
1102
1138
|
// }
|
1103
1139
|
// // Convert a memento to a value
|
@@ -1277,7 +1313,7 @@ class MetadataMap {
|
|
1277
1313
|
// Remove some metadata by name
|
1278
1314
|
void Remove(absl::string_view key) {
|
1279
1315
|
metadata_detail::RemoveHelper<Derived> helper(static_cast<Derived*>(this));
|
1280
|
-
metadata_detail::NameLookup<
|
1316
|
+
metadata_detail::NameLookup<Traits...>::Lookup(key, &helper);
|
1281
1317
|
}
|
1282
1318
|
|
1283
1319
|
void Remove(const char* key) { Remove(absl::string_view(key)); }
|
@@ -1287,7 +1323,7 @@ class MetadataMap {
|
|
1287
1323
|
std::string* buffer) const {
|
1288
1324
|
metadata_detail::GetStringValueHelper<Derived> helper(
|
1289
1325
|
static_cast<const Derived*>(this), buffer);
|
1290
|
-
return metadata_detail::NameLookup<
|
1326
|
+
return metadata_detail::NameLookup<Traits...>::Lookup(name, &helper);
|
1291
1327
|
}
|
1292
1328
|
|
1293
1329
|
// Extract a piece of known metadata.
|
@@ -1324,11 +1360,13 @@ class MetadataMap {
|
|
1324
1360
|
// Parse metadata from a key/value pair, and return an object representing
|
1325
1361
|
// that result.
|
1326
1362
|
static ParsedMetadata<Derived> Parse(absl::string_view key, Slice value,
|
1363
|
+
bool will_keep_past_request_lifetime,
|
1327
1364
|
uint32_t transport_size,
|
1328
1365
|
MetadataParseErrorFn on_error) {
|
1329
|
-
metadata_detail::ParseHelper<Derived> helper(
|
1330
|
-
|
1331
|
-
|
1366
|
+
metadata_detail::ParseHelper<Derived> helper(
|
1367
|
+
value.TakeOwned(), will_keep_past_request_lifetime, on_error,
|
1368
|
+
transport_size);
|
1369
|
+
return metadata_detail::NameLookup<Traits...>::Lookup(key, &helper);
|
1332
1370
|
}
|
1333
1371
|
|
1334
1372
|
// Set a value from a parsed metadata object.
|
@@ -1341,7 +1379,7 @@ class MetadataMap {
|
|
1341
1379
|
MetadataParseErrorFn on_error) {
|
1342
1380
|
metadata_detail::AppendHelper<Derived> helper(static_cast<Derived*>(this),
|
1343
1381
|
value.TakeOwned(), on_error);
|
1344
|
-
metadata_detail::NameLookup<
|
1382
|
+
metadata_detail::NameLookup<Traits...>::Lookup(key, &helper);
|
1345
1383
|
}
|
1346
1384
|
|
1347
1385
|
void Clear();
|
@@ -33,6 +33,7 @@
|
|
33
33
|
|
34
34
|
#include <grpc/slice.h>
|
35
35
|
|
36
|
+
#include "src/core/lib/experiments/experiments.h"
|
36
37
|
#include "src/core/lib/gprpp/time.h"
|
37
38
|
#include "src/core/lib/slice/slice.h"
|
38
39
|
|
@@ -193,14 +194,16 @@ class ParsedMetadata {
|
|
193
194
|
// HTTP2 defined storage size of this metadatum.
|
194
195
|
uint32_t transport_size() const { return transport_size_; }
|
195
196
|
// Create a new parsed metadata with the same key but a different value.
|
196
|
-
ParsedMetadata WithNewValue(Slice value,
|
197
|
+
ParsedMetadata WithNewValue(Slice value, bool will_keep_past_request_lifetime,
|
198
|
+
uint32_t value_wire_size,
|
197
199
|
MetadataParseErrorFn on_error) const {
|
198
200
|
ParsedMetadata result;
|
199
201
|
result.vtable_ = vtable_;
|
200
202
|
result.value_ = value_;
|
201
203
|
result.transport_size_ =
|
202
204
|
TransportSize(static_cast<uint32_t>(key().length()), value_wire_size);
|
203
|
-
vtable_->with_new_value(&value, on_error,
|
205
|
+
vtable_->with_new_value(&value, will_keep_past_request_lifetime, on_error,
|
206
|
+
&result);
|
204
207
|
return result;
|
205
208
|
}
|
206
209
|
std::string DebugString() const { return vtable_->debug_string(value_); }
|
@@ -224,6 +227,7 @@ class ParsedMetadata {
|
|
224
227
|
void (*const set)(const Buffer& value, MetadataContainer* container);
|
225
228
|
// result is a bitwise copy of the originating ParsedMetadata.
|
226
229
|
void (*const with_new_value)(Slice* new_value,
|
230
|
+
bool will_keep_past_request_lifetime,
|
227
231
|
MetadataParseErrorFn on_error,
|
228
232
|
ParsedMetadata* result);
|
229
233
|
std::string (*const debug_string)(const Buffer& value);
|
@@ -241,17 +245,22 @@ class ParsedMetadata {
|
|
241
245
|
template <typename Which>
|
242
246
|
static const VTable* SliceTraitVTable();
|
243
247
|
|
244
|
-
template <Slice (*ParseMemento)(Slice, MetadataParseErrorFn)>
|
248
|
+
template <Slice (*ParseMemento)(Slice, bool, MetadataParseErrorFn)>
|
245
249
|
GPR_ATTRIBUTE_NOINLINE static void WithNewValueSetSlice(
|
246
|
-
Slice* slice,
|
250
|
+
Slice* slice, bool will_keep_past_request_lifetime,
|
251
|
+
MetadataParseErrorFn on_error, ParsedMetadata* result) {
|
247
252
|
result->value_.slice =
|
248
|
-
ParseMemento(std::move(*slice),
|
253
|
+
ParseMemento(std::move(*slice), will_keep_past_request_lifetime,
|
254
|
+
on_error)
|
255
|
+
.TakeCSlice();
|
249
256
|
}
|
250
257
|
|
251
|
-
template <typename T, T (*ParseMemento)(Slice, MetadataParseErrorFn)>
|
258
|
+
template <typename T, T (*ParseMemento)(Slice, bool, MetadataParseErrorFn)>
|
252
259
|
GPR_ATTRIBUTE_NOINLINE static void WithNewValueSetTrivial(
|
253
|
-
Slice* slice,
|
254
|
-
|
260
|
+
Slice* slice, bool will_keep_past_request_lifetime,
|
261
|
+
MetadataParseErrorFn on_error, ParsedMetadata* result) {
|
262
|
+
T memento = ParseMemento(std::move(*slice), will_keep_past_request_lifetime,
|
263
|
+
on_error);
|
255
264
|
memcpy(result->value_.trivial, &memento, sizeof(memento));
|
256
265
|
}
|
257
266
|
|
@@ -272,7 +281,7 @@ ParsedMetadata<MetadataContainer>::EmptyVTable() {
|
|
272
281
|
// set
|
273
282
|
[](const Buffer&, MetadataContainer*) {},
|
274
283
|
// with_new_value
|
275
|
-
[](Slice*, MetadataParseErrorFn, ParsedMetadata*) {},
|
284
|
+
[](Slice*, bool, MetadataParseErrorFn, ParsedMetadata*) {},
|
276
285
|
// debug_string
|
277
286
|
[](const Buffer&) -> std::string { return "empty"; },
|
278
287
|
// key
|
@@ -330,9 +339,11 @@ ParsedMetadata<MetadataContainer>::NonTrivialTraitVTable() {
|
|
330
339
|
map->Set(Which(), Which::MementoToValue(*p));
|
331
340
|
},
|
332
341
|
// with_new_value
|
333
|
-
[](Slice* value,
|
334
|
-
|
335
|
-
|
342
|
+
[](Slice* value, bool will_keep_past_request_lifetime,
|
343
|
+
MetadataParseErrorFn on_error, ParsedMetadata* result) {
|
344
|
+
result->value_.pointer =
|
345
|
+
new typename Which::MementoType(Which::ParseMemento(
|
346
|
+
std::move(*value), will_keep_past_request_lifetime, on_error));
|
336
347
|
},
|
337
348
|
// debug_string
|
338
349
|
[](const Buffer& value) {
|
@@ -387,14 +398,17 @@ ParsedMetadata<MetadataContainer>::KeyValueVTable(absl::string_view key) {
|
|
387
398
|
auto* p = static_cast<KV*>(value.pointer);
|
388
399
|
map->unknown_.Append(p->first.as_string_view(), p->second.Ref());
|
389
400
|
};
|
390
|
-
static const auto with_new_value =
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
401
|
+
static const auto with_new_value =
|
402
|
+
[](Slice* value, bool will_keep_past_request_lifetime,
|
403
|
+
MetadataParseErrorFn, ParsedMetadata* result) {
|
404
|
+
auto* p = new KV{
|
405
|
+
static_cast<KV*>(result->value_.pointer)->first.Ref(),
|
406
|
+
will_keep_past_request_lifetime && IsUniqueMetadataStringsEnabled()
|
407
|
+
? value->TakeUniquelyOwned()
|
408
|
+
: std::move(*value),
|
409
|
+
};
|
410
|
+
result->value_.pointer = p;
|
411
|
+
};
|
398
412
|
static const auto debug_string = [](const Buffer& value) {
|
399
413
|
auto* p = static_cast<KV*>(value.pointer);
|
400
414
|
return absl::StrCat(p->first.as_string_view(), ": ",
|
@@ -19,6 +19,7 @@
|
|
19
19
|
|
20
20
|
#include "absl/strings/string_view.h"
|
21
21
|
|
22
|
+
#include "src/core/lib/experiments/experiments.h"
|
22
23
|
#include "src/core/lib/slice/slice.h"
|
23
24
|
#include "src/core/lib/transport/parsed_metadata.h"
|
24
25
|
|
@@ -30,8 +31,14 @@ namespace grpc_core {
|
|
30
31
|
struct SimpleSliceBasedMetadata {
|
31
32
|
using ValueType = Slice;
|
32
33
|
using MementoType = Slice;
|
33
|
-
static MementoType ParseMemento(Slice value,
|
34
|
-
|
34
|
+
static MementoType ParseMemento(Slice value,
|
35
|
+
bool will_keep_past_request_lifetime,
|
36
|
+
MetadataParseErrorFn) {
|
37
|
+
if (will_keep_past_request_lifetime && IsUniqueMetadataStringsEnabled()) {
|
38
|
+
return value.TakeUniquelyOwned();
|
39
|
+
} else {
|
40
|
+
return value.TakeOwned();
|
41
|
+
}
|
35
42
|
}
|
36
43
|
static ValueType MementoToValue(MementoType value) { return value; }
|
37
44
|
static Slice Encode(const ValueType& x) { return x.Ref(); }
|
@@ -124,9 +124,8 @@ tsi_result alts_grpc_record_protocol_init(alts_grpc_record_protocol* rp,
|
|
124
124
|
tsi_result alts_grpc_record_protocol_protect(
|
125
125
|
alts_grpc_record_protocol* self, grpc_slice_buffer* unprotected_slices,
|
126
126
|
grpc_slice_buffer* protected_slices) {
|
127
|
-
if (
|
128
|
-
|
129
|
-
protected_slices == nullptr) {
|
127
|
+
if (self == nullptr || self->vtable == nullptr ||
|
128
|
+
unprotected_slices == nullptr || protected_slices == nullptr) {
|
130
129
|
return TSI_INVALID_ARGUMENT;
|
131
130
|
}
|
132
131
|
if (self->vtable->protect == nullptr) {
|
@@ -138,9 +137,8 @@ tsi_result alts_grpc_record_protocol_protect(
|
|
138
137
|
tsi_result alts_grpc_record_protocol_unprotect(
|
139
138
|
alts_grpc_record_protocol* self, grpc_slice_buffer* protected_slices,
|
140
139
|
grpc_slice_buffer* unprotected_slices) {
|
141
|
-
if (
|
142
|
-
|
143
|
-
unprotected_slices == nullptr) {
|
140
|
+
if (self == nullptr || self->vtable == nullptr ||
|
141
|
+
protected_slices == nullptr || unprotected_slices == nullptr) {
|
144
142
|
return TSI_INVALID_ARGUMENT;
|
145
143
|
}
|
146
144
|
if (self->vtable->unprotect == nullptr) {
|
@@ -263,8 +263,7 @@ tsi_result alts_zero_copy_grpc_protector_create(
|
|
263
263
|
bool is_integrity_only, bool enable_extra_copy,
|
264
264
|
size_t* max_protected_frame_size,
|
265
265
|
tsi_zero_copy_grpc_protector** protector) {
|
266
|
-
if (
|
267
|
-
protector == nullptr) {
|
266
|
+
if (key == nullptr || protector == nullptr) {
|
268
267
|
gpr_log(
|
269
268
|
GPR_ERROR,
|
270
269
|
"Invalid nullptr arguments to alts_zero_copy_grpc_protector create.");
|
@@ -65,6 +65,7 @@
|
|
65
65
|
|
66
66
|
// --- Constants. ---
|
67
67
|
|
68
|
+
#define TSI_SSL_MAX_BIO_WRITE_ATTEMPTS 100
|
68
69
|
#define TSI_SSL_MAX_PROTECTED_FRAME_SIZE_UPPER_BOUND 16384
|
69
70
|
#define TSI_SSL_MAX_PROTECTED_FRAME_SIZE_LOWER_BOUND 1024
|
70
71
|
#define TSI_SSL_HANDSHAKER_OUTGOING_BUFFER_INITIAL_SIZE 1024
|
@@ -1538,15 +1539,35 @@ static tsi_result ssl_handshaker_next(tsi_handshaker* self,
|
|
1538
1539
|
// If there are received bytes, process them first.
|
1539
1540
|
tsi_ssl_handshaker* impl = reinterpret_cast<tsi_ssl_handshaker*>(self);
|
1540
1541
|
tsi_result status = TSI_OK;
|
1541
|
-
size_t bytes_consumed = received_bytes_size;
|
1542
1542
|
size_t bytes_written = 0;
|
1543
1543
|
if (received_bytes_size > 0) {
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1544
|
+
unsigned char* remaining_bytes_to_write_to_openssl =
|
1545
|
+
const_cast<unsigned char*>(received_bytes);
|
1546
|
+
size_t remaining_bytes_to_write_to_openssl_size = received_bytes_size;
|
1547
|
+
size_t number_bio_write_attempts = 0;
|
1548
|
+
while (remaining_bytes_to_write_to_openssl_size > 0 &&
|
1549
|
+
(status == TSI_OK || status == TSI_INCOMPLETE_DATA) &&
|
1550
|
+
number_bio_write_attempts < TSI_SSL_MAX_BIO_WRITE_ATTEMPTS) {
|
1551
|
+
++number_bio_write_attempts;
|
1552
|
+
// Try to write all of the remaining bytes to the BIO.
|
1553
|
+
size_t bytes_written_to_openssl =
|
1554
|
+
remaining_bytes_to_write_to_openssl_size;
|
1555
|
+
status = ssl_handshaker_process_bytes_from_peer(
|
1556
|
+
impl, remaining_bytes_to_write_to_openssl, &bytes_written_to_openssl,
|
1557
|
+
error);
|
1558
|
+
// As long as the BIO is full, drive the SSL handshake to consume bytes
|
1559
|
+
// from the BIO. If the SSL handshake returns any bytes, write them to the
|
1560
|
+
// peer.
|
1561
|
+
while (status == TSI_DRAIN_BUFFER) {
|
1562
|
+
status =
|
1563
|
+
ssl_handshaker_write_output_buffer(self, &bytes_written, error);
|
1564
|
+
if (status != TSI_OK) return status;
|
1565
|
+
status = ssl_handshaker_do_handshake(impl, error);
|
1566
|
+
}
|
1567
|
+
// Move the pointer to the first byte not yet successfully written to the
|
1568
|
+
// BIO.
|
1569
|
+
remaining_bytes_to_write_to_openssl_size -= bytes_written_to_openssl;
|
1570
|
+
remaining_bytes_to_write_to_openssl += bytes_written_to_openssl;
|
1550
1571
|
}
|
1551
1572
|
}
|
1552
1573
|
if (status != TSI_OK) return status;
|
data/src/ruby/bin/math_pb.rb
CHANGED
@@ -1,28 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: math.proto
|
3
4
|
|
4
5
|
require 'google/protobuf'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
7
|
+
|
8
|
+
descriptor_data = "\n\nmath.proto\x12\x04math\",\n\x07\x44ivArgs\x12\x10\n\x08\x64ividend\x18\x01 \x01(\x03\x12\x0f\n\x07\x64ivisor\x18\x02 \x01(\x03\"/\n\x08\x44ivReply\x12\x10\n\x08quotient\x18\x01 \x01(\x03\x12\x11\n\tremainder\x18\x02 \x01(\x03\"\x18\n\x07\x46ibArgs\x12\r\n\x05limit\x18\x01 \x01(\x03\"\x12\n\x03Num\x12\x0b\n\x03num\x18\x01 \x01(\x03\"\x19\n\x08\x46ibReply\x12\r\n\x05\x63ount\x18\x01 \x01(\x03\x32\xa4\x01\n\x04Math\x12&\n\x03\x44iv\x12\r.math.DivArgs\x1a\x0e.math.DivReply\"\x00\x12.\n\x07\x44ivMany\x12\r.math.DivArgs\x1a\x0e.math.DivReply\"\x00(\x01\x30\x01\x12#\n\x03\x46ib\x12\r.math.FibArgs\x1a\t.math.Num\"\x00\x30\x01\x12\x1f\n\x03Sum\x12\t.math.Num\x1a\t.math.Num\"\x00(\x01\x62\x06proto3"
|
9
|
+
|
10
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
11
|
+
|
12
|
+
begin
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
14
|
+
rescue TypeError => e
|
15
|
+
# Compatibility code: will be removed in the next major version.
|
16
|
+
require 'google/protobuf/descriptor_pb'
|
17
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
18
|
+
parsed.clear_dependency
|
19
|
+
serialized = parsed.class.encode(parsed)
|
20
|
+
file = pool.add_serialized_file(serialized)
|
21
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
22
|
+
imports = [
|
23
|
+
]
|
24
|
+
imports.each do |type_name, expected_filename|
|
25
|
+
import_file = pool.lookup(type_name).file_descriptor
|
26
|
+
if import_file.name != expected_filename
|
27
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
24
28
|
end
|
25
29
|
end
|
30
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
31
|
+
warn "This will become an error in the next major version."
|
26
32
|
end
|
27
33
|
|
28
34
|
module Math
|
@@ -88,11 +88,15 @@ env_append 'CPPFLAGS', '-DGRPC_XDS_USER_AGENT_NAME_SUFFIX="\"RUBY\""'
|
|
88
88
|
|
89
89
|
require_relative '../../lib/grpc/version'
|
90
90
|
env_append 'CPPFLAGS', '-DGRPC_XDS_USER_AGENT_VERSION_SUFFIX="\"' + GRPC::VERSION + '\""'
|
91
|
+
env_append 'CPPFLAGS', '-DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1'
|
91
92
|
|
92
93
|
output_dir = File.expand_path(RbConfig::CONFIG['topdir'])
|
93
94
|
grpc_lib_dir = File.join(output_dir, 'libs', grpc_config)
|
94
95
|
ENV['BUILDDIR'] = output_dir
|
95
96
|
|
97
|
+
strip_tool = RbConfig::CONFIG['STRIP']
|
98
|
+
strip_tool += ' -x' if apple_toolchain
|
99
|
+
|
96
100
|
unless windows
|
97
101
|
puts 'Building internal gRPC into ' + grpc_lib_dir
|
98
102
|
nproc = 4
|
@@ -107,6 +111,17 @@ unless windows
|
|
107
111
|
puts "Building grpc native library: #{cmd}"
|
108
112
|
system(cmd)
|
109
113
|
exit 1 unless $? == 0
|
114
|
+
|
115
|
+
if grpc_config == 'opt'
|
116
|
+
rm_obj_cmd = "rm -rf #{File.join(output_dir, 'objs')}"
|
117
|
+
puts "Removing grpc object files: #{rm_obj_cmd}"
|
118
|
+
system(rm_obj_cmd)
|
119
|
+
exit 1 unless $? == 0
|
120
|
+
strip_cmd = "#{strip_tool} #{grpc_lib_dir}/*.a"
|
121
|
+
puts "Stripping grpc native library: #{strip_cmd}"
|
122
|
+
system(strip_cmd)
|
123
|
+
exit 1 unless $? == 0
|
124
|
+
end
|
110
125
|
end
|
111
126
|
|
112
127
|
$CFLAGS << ' -DGRPC_RUBY_WINDOWS_UCRT' if windows_ucrt
|
@@ -141,7 +156,10 @@ end
|
|
141
156
|
|
142
157
|
ext_export_file = File.join(grpc_root, 'src', 'ruby', 'ext', 'grpc', ext_export_filename())
|
143
158
|
$LDFLAGS << ' -Wl,--version-script="' + ext_export_file + '.gcc"' if linux
|
144
|
-
|
159
|
+
if apple_toolchain
|
160
|
+
$LDFLAGS << ' -weak_framework CoreFoundation' if RUBY_PLATFORM =~ /arm64/
|
161
|
+
$LDFLAGS << ' -Wl,-exported_symbols_list,"' + ext_export_file + '.clang"'
|
162
|
+
end
|
145
163
|
|
146
164
|
$LDFLAGS << ' ' + File.join(grpc_lib_dir, 'libgrpc.a') unless windows
|
147
165
|
if grpc_config == 'gcov'
|
@@ -169,23 +187,6 @@ output = File.join('grpc', 'grpc_c')
|
|
169
187
|
puts 'Generating Makefile for ' + output
|
170
188
|
create_makefile(output)
|
171
189
|
|
172
|
-
strip_tool = RbConfig::CONFIG['STRIP']
|
173
|
-
strip_tool += ' -x' if apple_toolchain
|
174
|
-
|
175
|
-
if grpc_config == 'opt'
|
176
|
-
File.open('Makefile.new', 'w') do |o|
|
177
|
-
o.puts 'hijack: all strip'
|
178
|
-
o.puts
|
179
|
-
File.foreach('Makefile') do |i|
|
180
|
-
o.puts i
|
181
|
-
end
|
182
|
-
o.puts
|
183
|
-
o.puts 'strip: $(DLLIB)'
|
184
|
-
o.puts "\t$(ECHO) Stripping $(DLLIB)"
|
185
|
-
o.puts "\t$(Q) #{strip_tool} $(DLLIB)"
|
186
|
-
end
|
187
|
-
File.rename('Makefile.new', 'Makefile')
|
188
|
-
end
|
189
190
|
if ENV['GRPC_RUBY_TEST_ONLY_WORKAROUND_MAKE_INSTALL_BUG']
|
190
191
|
# Note: this env var setting is intended to work around a problem observed
|
191
192
|
# with the ginstall command on grpc's macos automated test infrastructure,
|