grpc 1.37.1 → 1.38.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +64 -58
- data/include/grpc/event_engine/README.md +38 -0
- data/include/grpc/event_engine/channel_args.h +28 -0
- data/include/grpc/event_engine/event_engine.h +336 -0
- data/include/grpc/event_engine/port.h +39 -0
- data/include/grpc/event_engine/slice_allocator.h +81 -0
- data/include/grpc/grpc.h +2 -2
- data/include/grpc/grpc_security_constants.h +14 -0
- data/include/grpc/impl/codegen/grpc_types.h +11 -0
- data/include/grpc/impl/codegen/port_platform.h +5 -0
- data/include/grpc/module.modulemap +14 -14
- data/src/core/ext/filters/client_channel/backup_poller.cc +3 -3
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +177 -202
- data/src/core/ext/filters/client_channel/client_channel.cc +628 -3101
- data/src/core/ext/filters/client_channel/client_channel.h +489 -55
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +1 -1
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +4 -1
- data/src/core/ext/filters/client_channel/config_selector.h +1 -1
- data/src/core/ext/filters/client_channel/connector.h +1 -1
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +9 -10
- data/src/core/ext/filters/client_channel/dynamic_filters.h +3 -3
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +26 -27
- data/src/core/ext/filters/client_channel/health/health_check_client.h +27 -26
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +24 -21
- data/src/core/ext/filters/client_channel/lb_policy.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy.h +4 -4
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +6 -6
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +46 -43
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +2 -1
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +5 -5
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +14 -12
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +4 -4
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +15 -15
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +36 -30
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +23 -23
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +31 -46
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +84 -61
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +4 -4
- data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -1
- data/src/core/ext/filters/client_channel/resolver.h +2 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +23 -15
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +2 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +14 -14
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +33 -24
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +17 -9
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +20 -28
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +7 -5
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +13 -11
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +43 -28
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +32 -239
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +20 -49
- data/src/core/ext/filters/client_channel/retry_filter.cc +2188 -0
- data/src/core/ext/filters/client_channel/retry_filter.h +30 -0
- data/src/core/ext/filters/client_channel/retry_service_config.cc +287 -0
- data/src/core/ext/filters/client_channel/retry_service_config.h +90 -0
- data/src/core/ext/filters/client_channel/server_address.cc +1 -1
- data/src/core/ext/filters/client_channel/service_config.cc +15 -14
- data/src/core/ext/filters/client_channel/service_config.h +7 -6
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +5 -4
- data/src/core/ext/filters/client_channel/service_config_parser.cc +6 -6
- data/src/core/ext/filters/client_channel/service_config_parser.h +7 -4
- data/src/core/ext/filters/client_channel/subchannel.cc +17 -16
- data/src/core/ext/filters/client_channel/subchannel.h +7 -6
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +16 -15
- data/src/core/ext/filters/deadline/deadline_filter.cc +10 -10
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +19 -18
- data/src/core/ext/filters/fault_injection/service_config_parser.cc +5 -5
- data/src/core/ext/filters/fault_injection/service_config_parser.h +1 -1
- data/src/core/ext/filters/http/client/http_client_filter.cc +28 -21
- data/src/core/ext/filters/http/client_authority_filter.cc +3 -3
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +23 -22
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +21 -21
- data/src/core/ext/filters/http/server/http_server_filter.cc +27 -23
- data/src/core/ext/filters/max_age/max_age_filter.cc +12 -10
- data/src/core/ext/filters/message_size/message_size_filter.cc +14 -11
- data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +4 -3
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +7 -7
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +7 -7
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +2 -2
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +1 -1
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +3 -3
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +44 -45
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +2 -2
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +3 -4
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +2 -2
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +3 -4
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +129 -116
- data/src/core/ext/transport/chttp2/transport/context_list.cc +4 -5
- data/src/core/ext/transport/chttp2/transport/context_list.h +4 -4
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +3 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.h +8 -8
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +8 -8
- data/src/core/ext/transport/chttp2/transport/frame_data.h +10 -10
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +7 -8
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +6 -6
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +7 -8
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +7 -6
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +7 -7
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +6 -6
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +6 -5
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +6 -6
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +4 -6
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +4 -6
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +237 -208
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +10 -10
- data/src/core/ext/transport/chttp2/transport/hpack_table.cc +4 -3
- data/src/core/ext/transport/chttp2/transport/hpack_table.h +4 -4
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +2 -2
- data/src/core/ext/transport/chttp2/transport/internal.h +31 -27
- data/src/core/ext/transport/chttp2/transport/parsing.cc +63 -56
- data/src/core/ext/transport/chttp2/transport/writing.cc +7 -3
- data/src/core/ext/transport/inproc/inproc_transport.cc +30 -29
- data/src/core/ext/xds/certificate_provider_factory.h +1 -1
- data/src/core/ext/xds/certificate_provider_store.h +3 -3
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +3 -3
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +2 -2
- data/src/core/ext/xds/xds_api.cc +101 -93
- data/src/core/ext/xds/xds_api.h +6 -6
- data/src/core/ext/xds/xds_bootstrap.cc +97 -159
- data/src/core/ext/xds/xds_bootstrap.h +19 -24
- data/src/core/ext/xds/xds_certificate_provider.cc +4 -4
- data/src/core/ext/xds/xds_certificate_provider.h +4 -4
- data/src/core/ext/xds/xds_channel_args.h +5 -2
- data/src/core/ext/xds/xds_client.cc +310 -178
- data/src/core/ext/xds/xds_client.h +41 -27
- data/src/core/ext/xds/xds_client_stats.h +3 -2
- data/src/core/ext/xds/xds_server_config_fetcher.cc +34 -20
- data/src/core/lib/{iomgr → address_utils}/parse_address.cc +17 -17
- data/src/core/lib/{iomgr → address_utils}/parse_address.h +7 -7
- data/src/core/lib/{iomgr → address_utils}/sockaddr_utils.cc +3 -20
- data/src/core/lib/{iomgr → address_utils}/sockaddr_utils.h +6 -11
- data/src/core/lib/channel/channel_stack.cc +10 -9
- data/src/core/lib/channel/channel_stack.h +10 -9
- data/src/core/lib/channel/channel_stack_builder.cc +2 -2
- data/src/core/lib/channel/channel_stack_builder.h +1 -1
- data/src/core/lib/channel/channelz.cc +21 -13
- data/src/core/lib/channel/connected_channel.cc +4 -4
- data/src/core/lib/channel/handshaker.cc +7 -6
- data/src/core/lib/channel/handshaker.h +5 -5
- data/src/core/lib/event_engine/slice_allocator.cc +59 -0
- data/src/core/lib/event_engine/sockaddr.cc +38 -0
- data/src/core/lib/gprpp/ref_counted.h +28 -14
- data/src/core/lib/gprpp/status_helper.cc +407 -0
- data/src/core/lib/gprpp/status_helper.h +180 -0
- data/src/core/lib/http/httpcli.cc +11 -11
- data/src/core/lib/http/httpcli_security_connector.cc +11 -7
- data/src/core/lib/http/parser.cc +16 -16
- data/src/core/lib/http/parser.h +4 -4
- data/src/core/lib/iomgr/buffer_list.cc +7 -9
- data/src/core/lib/iomgr/buffer_list.h +4 -5
- data/src/core/lib/iomgr/call_combiner.cc +15 -12
- data/src/core/lib/iomgr/call_combiner.h +12 -14
- data/src/core/lib/iomgr/cfstream_handle.cc +3 -3
- data/src/core/lib/iomgr/cfstream_handle.h +1 -1
- data/src/core/lib/iomgr/closure.h +7 -6
- data/src/core/lib/iomgr/combiner.cc +14 -12
- data/src/core/lib/iomgr/combiner.h +2 -2
- data/src/core/lib/iomgr/endpoint.cc +1 -1
- data/src/core/lib/iomgr/endpoint.h +2 -2
- data/src/core/lib/iomgr/endpoint_cfstream.cc +11 -13
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +1 -1
- data/src/core/lib/iomgr/error.cc +167 -61
- data/src/core/lib/iomgr/error.h +217 -106
- data/src/core/lib/iomgr/error_cfstream.cc +3 -2
- data/src/core/lib/iomgr/error_cfstream.h +2 -2
- data/src/core/lib/iomgr/error_internal.h +5 -1
- data/src/core/lib/iomgr/ev_apple.cc +5 -5
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +19 -19
- data/src/core/lib/iomgr/ev_epollex_linux.cc +48 -45
- data/src/core/lib/iomgr/ev_poll_posix.cc +26 -23
- data/src/core/lib/iomgr/ev_posix.cc +9 -8
- data/src/core/lib/iomgr/ev_posix.h +9 -9
- data/src/core/lib/iomgr/exec_ctx.cc +4 -4
- data/src/core/lib/iomgr/exec_ctx.h +1 -1
- data/src/core/lib/iomgr/executor.cc +8 -8
- data/src/core/lib/iomgr/executor.h +2 -2
- data/src/core/lib/iomgr/iomgr.cc +1 -1
- data/src/core/lib/iomgr/iomgr.h +1 -1
- data/src/core/lib/iomgr/iomgr_custom.cc +1 -1
- data/src/core/lib/iomgr/iomgr_internal.cc +2 -2
- data/src/core/lib/iomgr/iomgr_internal.h +3 -3
- data/src/core/lib/iomgr/iomgr_posix.cc +1 -1
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +2 -2
- data/src/core/lib/iomgr/iomgr_windows.cc +1 -1
- data/src/core/lib/iomgr/load_file.cc +4 -4
- data/src/core/lib/iomgr/load_file.h +2 -2
- data/src/core/lib/iomgr/lockfree_event.cc +5 -5
- data/src/core/lib/iomgr/lockfree_event.h +1 -1
- data/src/core/lib/iomgr/pollset.cc +5 -5
- data/src/core/lib/iomgr/pollset.h +9 -9
- data/src/core/lib/iomgr/pollset_custom.cc +5 -5
- data/src/core/lib/iomgr/pollset_windows.cc +5 -5
- data/src/core/lib/iomgr/port.h +1 -1
- data/src/core/lib/iomgr/python_util.h +1 -1
- data/src/core/lib/iomgr/resolve_address.cc +3 -3
- data/src/core/lib/iomgr/resolve_address.h +6 -6
- data/src/core/lib/iomgr/resolve_address_custom.cc +10 -9
- data/src/core/lib/iomgr/resolve_address_custom.h +3 -3
- data/src/core/lib/iomgr/resolve_address_posix.cc +3 -3
- data/src/core/lib/iomgr/resolve_address_windows.cc +4 -4
- data/src/core/lib/iomgr/resource_quota.cc +11 -10
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +22 -20
- data/src/core/lib/iomgr/socket_utils_posix.h +20 -20
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +4 -4
- data/src/core/lib/iomgr/tcp_client_custom.cc +5 -6
- data/src/core/lib/iomgr/tcp_client_posix.cc +15 -17
- data/src/core/lib/iomgr/tcp_client_posix.h +3 -4
- data/src/core/lib/iomgr/tcp_client_windows.cc +5 -5
- data/src/core/lib/iomgr/tcp_custom.cc +14 -16
- data/src/core/lib/iomgr/tcp_custom.h +13 -12
- data/src/core/lib/iomgr/tcp_posix.cc +36 -34
- data/src/core/lib/iomgr/tcp_server.cc +6 -6
- data/src/core/lib/iomgr/tcp_server.h +12 -11
- data/src/core/lib/iomgr/tcp_server_custom.cc +23 -21
- data/src/core/lib/iomgr/tcp_server_posix.cc +22 -21
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +13 -12
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +19 -17
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +9 -9
- data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +4 -4
- data/src/core/lib/iomgr/tcp_server_windows.cc +26 -25
- data/src/core/lib/iomgr/tcp_uv.cc +25 -23
- data/src/core/lib/iomgr/tcp_windows.cc +13 -13
- data/src/core/lib/iomgr/tcp_windows.h +2 -2
- data/src/core/lib/iomgr/timer_custom.cc +2 -1
- data/src/core/lib/iomgr/timer_custom.h +1 -1
- data/src/core/lib/iomgr/timer_generic.cc +6 -6
- data/src/core/lib/iomgr/udp_server.cc +21 -20
- data/src/core/lib/iomgr/unix_sockets_posix.cc +3 -3
- data/src/core/lib/iomgr/unix_sockets_posix.h +2 -2
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +10 -7
- data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +3 -3
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +4 -4
- data/src/core/lib/iomgr/wakeup_fd_posix.cc +3 -3
- data/src/core/lib/iomgr/wakeup_fd_posix.h +8 -6
- data/src/core/lib/iomgr/work_serializer.h +17 -1
- data/src/core/lib/json/json.h +1 -1
- data/src/core/lib/json/json_reader.cc +4 -4
- data/src/core/lib/matchers/matchers.cc +39 -39
- data/src/core/lib/matchers/matchers.h +28 -28
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +4 -4
- data/src/core/lib/security/credentials/composite/composite_credentials.h +2 -2
- data/src/core/lib/security/credentials/credentials.h +2 -2
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +17 -13
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +13 -11
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +2 -1
- data/src/core/lib/security/credentials/external/aws_request_signer.h +1 -1
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +15 -12
- data/src/core/lib/security/credentials/external/external_account_credentials.h +9 -8
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +5 -4
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +4 -3
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +8 -8
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +9 -7
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +2 -2
- data/src/core/lib/security/credentials/fake/fake_credentials.h +2 -2
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +9 -9
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +2 -2
- data/src/core/lib/security/credentials/iam/iam_credentials.h +2 -2
- data/src/core/lib/security/credentials/jwt/json_token.cc +2 -2
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +3 -3
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +2 -2
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +7 -5
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +21 -19
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +5 -5
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +5 -5
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +2 -2
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +8 -7
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +9 -9
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +19 -13
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +4 -0
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +3 -3
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +13 -3
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +13 -3
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +2 -2
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +12 -2
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +1 -1
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +14 -4
- data/src/core/lib/security/security_connector/security_connector.h +9 -4
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +16 -6
- data/src/core/lib/security/security_connector/ssl_utils.cc +22 -4
- data/src/core/lib/security/security_connector/ssl_utils.h +4 -4
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +56 -60
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +66 -48
- data/src/core/lib/security/transport/client_auth_filter.cc +18 -10
- data/src/core/lib/security/transport/secure_endpoint.cc +4 -4
- data/src/core/lib/security/transport/security_handshaker.cc +33 -32
- data/src/core/lib/security/transport/server_auth_filter.cc +19 -13
- data/src/core/lib/security/transport/tsi_error.cc +2 -1
- data/src/core/lib/security/transport/tsi_error.h +2 -1
- data/src/core/lib/security/util/json_util.cc +2 -2
- data/src/core/lib/security/util/json_util.h +1 -1
- data/src/core/lib/surface/call.cc +46 -45
- data/src/core/lib/surface/call.h +2 -2
- data/src/core/lib/surface/channel.cc +6 -6
- data/src/core/lib/surface/channel.h +3 -2
- data/src/core/lib/surface/channel_ping.cc +1 -1
- data/src/core/lib/surface/completion_queue.cc +46 -47
- data/src/core/lib/surface/completion_queue.h +2 -1
- data/src/core/lib/surface/lame_client.cc +11 -11
- data/src/core/lib/surface/lame_client.h +1 -1
- data/src/core/lib/surface/server.cc +28 -22
- data/src/core/lib/surface/server.h +16 -15
- data/src/core/lib/surface/validate_metadata.cc +7 -7
- data/src/core/lib/surface/validate_metadata.h +3 -2
- data/src/core/lib/surface/version.cc +4 -2
- data/src/core/lib/transport/byte_stream.cc +5 -5
- data/src/core/lib/transport/byte_stream.h +8 -8
- data/src/core/lib/transport/connectivity_state.cc +1 -1
- data/src/core/lib/transport/error_utils.cc +19 -8
- data/src/core/lib/transport/error_utils.h +11 -5
- data/src/core/lib/transport/metadata_batch.cc +37 -37
- data/src/core/lib/transport/metadata_batch.h +19 -18
- data/src/core/lib/transport/transport.cc +4 -3
- data/src/core/lib/transport/transport.h +4 -4
- data/src/core/lib/transport/transport_op_string.cc +5 -5
- data/src/core/tsi/alts/crypt/gsec.h +4 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +5 -4
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +7 -6
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +2 -1
- data/src/core/tsi/ssl_transport_security.cc +32 -14
- data/src/core/tsi/ssl_transport_security.h +3 -4
- data/src/ruby/bin/math_services_pb.rb +1 -1
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_services_pb.rb +1 -1
- data/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb +6 -6
- data/third_party/abseil-cpp/absl/algorithm/container.h +3 -3
- data/third_party/abseil-cpp/absl/base/attributes.h +24 -4
- data/third_party/abseil-cpp/absl/base/call_once.h +2 -9
- data/third_party/abseil-cpp/absl/base/config.h +37 -9
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +24 -10
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +4 -1
- data/third_party/abseil-cpp/absl/base/internal/endian.h +61 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h +2 -3
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +34 -32
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +16 -6
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +11 -2
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +14 -5
- data/third_party/abseil-cpp/absl/base/internal/spinlock_akaros.inc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +3 -3
- data/third_party/abseil-cpp/absl/base/internal/spinlock_posix.inc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +11 -11
- data/third_party/abseil-cpp/absl/base/internal/spinlock_win32.inc +5 -5
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +1 -1
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +5 -2
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +43 -42
- data/third_party/abseil-cpp/absl/base/internal/throw_delegate.cc +111 -7
- data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +0 -76
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +1 -3
- data/third_party/abseil-cpp/absl/base/log_severity.h +4 -4
- data/third_party/abseil-cpp/absl/base/macros.h +11 -0
- data/third_party/abseil-cpp/absl/base/optimization.h +10 -7
- data/third_party/abseil-cpp/absl/base/options.h +1 -1
- data/third_party/abseil-cpp/absl/base/port.h +0 -1
- data/third_party/abseil-cpp/absl/base/thread_annotations.h +1 -1
- data/third_party/abseil-cpp/absl/container/fixed_array.h +2 -2
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +5 -3
- data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +1 -1
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +5 -1
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +2 -1
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_force_weak_definition.cc +2 -1
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +141 -66
- data/third_party/abseil-cpp/absl/container/internal/layout.h +4 -4
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +14 -1
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +136 -136
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +16 -12
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +5 -2
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +3 -12
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +6 -1
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +3 -5
- data/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +2 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +2 -2
- data/third_party/abseil-cpp/absl/hash/internal/city.cc +15 -12
- data/third_party/abseil-cpp/absl/hash/internal/city.h +1 -19
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +25 -10
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +86 -37
- data/third_party/abseil-cpp/absl/hash/internal/wyhash.cc +111 -0
- data/third_party/abseil-cpp/absl/hash/internal/wyhash.h +48 -0
- data/third_party/abseil-cpp/absl/meta/type_traits.h +16 -2
- data/third_party/abseil-cpp/absl/numeric/bits.h +177 -0
- data/third_party/abseil-cpp/absl/numeric/int128.cc +3 -3
- data/third_party/abseil-cpp/absl/numeric/internal/bits.h +358 -0
- data/third_party/abseil-cpp/absl/numeric/internal/representation.h +55 -0
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +18 -0
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +4 -7
- data/third_party/abseil-cpp/absl/status/status.cc +29 -22
- data/third_party/abseil-cpp/absl/status/status.h +81 -20
- data/third_party/abseil-cpp/absl/status/statusor.h +3 -3
- data/third_party/abseil-cpp/absl/strings/charconv.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/cord.cc +326 -371
- data/third_party/abseil-cpp/absl/strings/cord.h +182 -64
- data/third_party/abseil-cpp/absl/strings/escaping.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +83 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +387 -17
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +146 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +897 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +589 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h +114 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +15 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +19 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +36 -18
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.h +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +14 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +15 -40
- data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +64 -0
- data/third_party/abseil-cpp/absl/strings/match.cc +6 -3
- data/third_party/abseil-cpp/absl/strings/match.h +16 -6
- data/third_party/abseil-cpp/absl/strings/numbers.cc +132 -4
- data/third_party/abseil-cpp/absl/strings/numbers.h +10 -10
- data/third_party/abseil-cpp/absl/strings/str_join.h +1 -1
- data/third_party/abseil-cpp/absl/strings/str_split.h +38 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +154 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +2 -1
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +2 -2
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +4 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +1 -65
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +2 -6
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +71 -59
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +79 -62
- data/third_party/abseil-cpp/absl/time/clock.cc +146 -130
- data/third_party/abseil-cpp/absl/time/clock.h +2 -2
- data/third_party/abseil-cpp/absl/time/duration.cc +3 -2
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +7 -11
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +7 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +4 -4
- data/third_party/abseil-cpp/absl/time/time.cc +4 -3
- data/third_party/abseil-cpp/absl/time/time.h +26 -24
- data/third_party/abseil-cpp/absl/types/internal/variant.h +1 -1
- data/third_party/abseil-cpp/absl/types/variant.h +9 -4
- data/third_party/boringssl-with-bazel/err_data.c +477 -461
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bool.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c +18 -8
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +1 -2
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_locl.h +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_tls.c +1 -88
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h +14 -3
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c +119 -273
- data/third_party/boringssl-with-bazel/src/crypto/err/err.c +87 -80
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +11 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/e_aes.c +25 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/digests.c +10 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/md32_common.h +4 -43
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h +0 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +104 -93
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/internal.h +39 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md4/md4.c +43 -46
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md5/md5.c +43 -46
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/cbc.c +33 -22
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/cfb.c +9 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ctr.c +9 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm.c +17 -13
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/internal.h +1 -22
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ofb.c +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +26 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/fips.c +79 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +14 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha1.c +45 -48
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha256.c +38 -43
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/sha512.c +37 -45
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +103 -42
- data/third_party/boringssl-with-bazel/src/crypto/hpke/internal.h +58 -37
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +65 -0
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +14 -0
- data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7_x509.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +95 -48
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/thread_pthread.c +0 -28
- data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +19 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/t_req.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c +19 -25
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c +3 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c +39 -89
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c +9 -16
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_algor.c +21 -17
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_attrib.c +7 -25
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c +25 -22
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_val.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +2 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_purp.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c +1 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/aead.h +0 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +120 -41
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +9 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +0 -8
- data/third_party/boringssl-with-bazel/src/include/openssl/crypto.h +24 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +5 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +19 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/err.h +3 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +1 -38
- data/third_party/boringssl-with-bazel/src/{crypto/x509/x509_r2x.c → include/openssl/evp_errors.h} +41 -58
- data/third_party/boringssl-with-bazel/src/include/openssl/obj.h +24 -5
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +2 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +9 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +2 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +185 -17
- data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +1 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +416 -121
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +2 -0
- data/third_party/boringssl-with-bazel/src/ssl/d1_both.cc +5 -0
- data/third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc +444 -0
- data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +244 -1
- data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +43 -12
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +149 -8
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +220 -46
- data/third_party/boringssl-with-bazel/src/ssl/s3_both.cc +7 -1
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc +4 -6
- data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +23 -26
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +74 -15
- data/third_party/boringssl-with-bazel/src/ssl/t1_lib.cc +98 -64
- data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +34 -4
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +205 -100
- data/third_party/boringssl-with-bazel/src/ssl/tls_method.cc +4 -2
- metadata +68 -45
- data/src/core/lib/iomgr/poller/eventmanager_libuv.cc +0 -88
- data/src/core/lib/iomgr/poller/eventmanager_libuv.h +0 -88
- data/third_party/abseil-cpp/absl/base/internal/bits.h +0 -219
- data/third_party/abseil-cpp/absl/synchronization/internal/mutex_nonprod.inc +0 -249
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/is_fips.c +0 -29
@@ -39,7 +39,7 @@ static void add_to_write_list(grpc_chttp2_write_cb** list,
|
|
39
39
|
}
|
40
40
|
|
41
41
|
static void finish_write_cb(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
42
|
-
grpc_chttp2_write_cb* cb,
|
42
|
+
grpc_chttp2_write_cb* cb, grpc_error_handle error) {
|
43
43
|
grpc_chttp2_complete_closure_step(t, s, &cb->closure, error,
|
44
44
|
"finish_write_cb");
|
45
45
|
cb->next = t->write_cb_pool;
|
@@ -75,6 +75,10 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
|
|
75
75
|
}
|
76
76
|
return;
|
77
77
|
}
|
78
|
+
// InvalidateNow to avoid getting stuck re-initializing the ping timer
|
79
|
+
// in a loop while draining the currently-held combiner. Also see
|
80
|
+
// https://github.com/grpc/grpc/issues/26079.
|
81
|
+
grpc_core::ExecCtx::Get()->InvalidateNow();
|
78
82
|
grpc_millis now = grpc_core::ExecCtx::Get()->Now();
|
79
83
|
|
80
84
|
grpc_millis next_allowed_ping_interval =
|
@@ -134,7 +138,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
|
|
134
138
|
|
135
139
|
static bool update_list(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
136
140
|
int64_t send_bytes, grpc_chttp2_write_cb** list,
|
137
|
-
int64_t* ctr,
|
141
|
+
int64_t* ctr, grpc_error_handle error) {
|
138
142
|
bool sched_any = false;
|
139
143
|
grpc_chttp2_write_cb* cb = *list;
|
140
144
|
*list = nullptr;
|
@@ -678,7 +682,7 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
|
|
678
682
|
return ctx.Result();
|
679
683
|
}
|
680
684
|
|
681
|
-
void grpc_chttp2_end_write(grpc_chttp2_transport* t,
|
685
|
+
void grpc_chttp2_end_write(grpc_chttp2_transport* t, grpc_error_handle error) {
|
682
686
|
GPR_TIMER_SCOPE("grpc_chttp2_end_write", 0);
|
683
687
|
grpc_chttp2_stream* s;
|
684
688
|
|
@@ -50,15 +50,15 @@ grpc_slice g_fake_auth_key;
|
|
50
50
|
grpc_slice g_fake_auth_value;
|
51
51
|
|
52
52
|
struct inproc_stream;
|
53
|
-
bool cancel_stream_locked(inproc_stream* s,
|
54
|
-
void maybe_process_ops_locked(inproc_stream* s,
|
55
|
-
void op_state_machine_locked(inproc_stream* s,
|
53
|
+
bool cancel_stream_locked(inproc_stream* s, grpc_error_handle error);
|
54
|
+
void maybe_process_ops_locked(inproc_stream* s, grpc_error_handle error);
|
55
|
+
void op_state_machine_locked(inproc_stream* s, grpc_error_handle error);
|
56
56
|
void log_metadata(const grpc_metadata_batch* md_batch, bool is_client,
|
57
57
|
bool is_initial);
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
grpc_error_handle fill_in_metadata(inproc_stream* s,
|
59
|
+
const grpc_metadata_batch* metadata,
|
60
|
+
uint32_t flags, grpc_metadata_batch* out_md,
|
61
|
+
uint32_t* outflags, bool* markfilled);
|
62
62
|
|
63
63
|
struct shared_mu {
|
64
64
|
shared_mu() {
|
@@ -239,7 +239,7 @@ struct inproc_stream {
|
|
239
239
|
grpc_millis write_buffer_deadline = GRPC_MILLIS_INF_FUTURE;
|
240
240
|
grpc_metadata_batch write_buffer_trailing_md;
|
241
241
|
bool write_buffer_trailing_md_filled = false;
|
242
|
-
|
242
|
+
grpc_error_handle write_buffer_cancel_error = GRPC_ERROR_NONE;
|
243
243
|
|
244
244
|
struct inproc_stream* other_side;
|
245
245
|
bool other_side_closed = false; // won't talk anymore
|
@@ -270,8 +270,8 @@ struct inproc_stream {
|
|
270
270
|
|
271
271
|
bool closed = false;
|
272
272
|
|
273
|
-
|
274
|
-
|
273
|
+
grpc_error_handle cancel_self_error = GRPC_ERROR_NONE;
|
274
|
+
grpc_error_handle cancel_other_error = GRPC_ERROR_NONE;
|
275
275
|
|
276
276
|
grpc_millis deadline = GRPC_MILLIS_INF_FUTURE;
|
277
277
|
|
@@ -293,10 +293,10 @@ void log_metadata(const grpc_metadata_batch* md_batch, bool is_client,
|
|
293
293
|
}
|
294
294
|
}
|
295
295
|
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
296
|
+
grpc_error_handle fill_in_metadata(inproc_stream* s,
|
297
|
+
const grpc_metadata_batch* metadata,
|
298
|
+
uint32_t flags, grpc_metadata_batch* out_md,
|
299
|
+
uint32_t* outflags, bool* markfilled) {
|
300
300
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_inproc_trace)) {
|
301
301
|
log_metadata(metadata, s->t->is_client, outflags != nullptr);
|
302
302
|
}
|
@@ -307,7 +307,7 @@ grpc_error* fill_in_metadata(inproc_stream* s,
|
|
307
307
|
if (markfilled != nullptr) {
|
308
308
|
*markfilled = true;
|
309
309
|
}
|
310
|
-
|
310
|
+
grpc_error_handle error = GRPC_ERROR_NONE;
|
311
311
|
for (grpc_linked_mdelem* elem = metadata->list.head;
|
312
312
|
(elem != nullptr) && (error == GRPC_ERROR_NONE); elem = elem->next) {
|
313
313
|
grpc_linked_mdelem* nelem =
|
@@ -374,7 +374,7 @@ void close_other_side_locked(inproc_stream* s, const char* reason) {
|
|
374
374
|
// this stream_op_batch is only one of the pending operations for this
|
375
375
|
// stream. This is called when one of the pending operations for the stream
|
376
376
|
// is done and about to be NULLed out
|
377
|
-
void complete_if_batch_end_locked(inproc_stream* s,
|
377
|
+
void complete_if_batch_end_locked(inproc_stream* s, grpc_error_handle error,
|
378
378
|
grpc_transport_stream_op_batch* op,
|
379
379
|
const char* msg) {
|
380
380
|
int is_sm = static_cast<int>(op == s->send_message_op);
|
@@ -394,14 +394,14 @@ void complete_if_batch_end_locked(inproc_stream* s, grpc_error* error,
|
|
394
394
|
}
|
395
395
|
}
|
396
396
|
|
397
|
-
void maybe_process_ops_locked(inproc_stream* s,
|
397
|
+
void maybe_process_ops_locked(inproc_stream* s, grpc_error_handle error) {
|
398
398
|
if (s && (error != GRPC_ERROR_NONE || s->ops_needed)) {
|
399
399
|
s->ops_needed = false;
|
400
400
|
op_state_machine_locked(s, error);
|
401
401
|
}
|
402
402
|
}
|
403
403
|
|
404
|
-
void fail_helper_locked(inproc_stream* s,
|
404
|
+
void fail_helper_locked(inproc_stream* s, grpc_error_handle error) {
|
405
405
|
INPROC_LOG(GPR_INFO, "op_state_machine %p fail_helper", s);
|
406
406
|
// If we're failing this side, we need to make sure that
|
407
407
|
// we also send or have already sent trailing metadata
|
@@ -431,7 +431,7 @@ void fail_helper_locked(inproc_stream* s, grpc_error* error) {
|
|
431
431
|
}
|
432
432
|
}
|
433
433
|
if (s->recv_initial_md_op) {
|
434
|
-
|
434
|
+
grpc_error_handle err;
|
435
435
|
if (!s->t->is_client) {
|
436
436
|
// If this is a server, provide initial metadata with a path and authority
|
437
437
|
// since it expects that as well as no error yet
|
@@ -550,7 +550,7 @@ void message_transfer_locked(inproc_stream* sender, inproc_stream* receiver) {
|
|
550
550
|
GPR_ASSERT(
|
551
551
|
sender->send_message_op->payload->send_message.send_message->Next(
|
552
552
|
SIZE_MAX, &unused));
|
553
|
-
|
553
|
+
grpc_error_handle error =
|
554
554
|
sender->send_message_op->payload->send_message.send_message->Pull(
|
555
555
|
&message_slice);
|
556
556
|
if (error != GRPC_ERROR_NONE) {
|
@@ -583,13 +583,13 @@ void message_transfer_locked(inproc_stream* sender, inproc_stream* receiver) {
|
|
583
583
|
sender->send_message_op = nullptr;
|
584
584
|
}
|
585
585
|
|
586
|
-
void op_state_machine_locked(inproc_stream* s,
|
586
|
+
void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
|
587
587
|
// This function gets called when we have contents in the unprocessed reads
|
588
588
|
// Get what we want based on our ops wanted
|
589
589
|
// Schedule our appropriate closures
|
590
590
|
// and then return to ops_needed state if still needed
|
591
591
|
|
592
|
-
|
592
|
+
grpc_error_handle new_err = GRPC_ERROR_NONE;
|
593
593
|
|
594
594
|
bool needs_close = false;
|
595
595
|
|
@@ -887,9 +887,10 @@ done:
|
|
887
887
|
GRPC_ERROR_UNREF(new_err);
|
888
888
|
}
|
889
889
|
|
890
|
-
bool cancel_stream_locked(inproc_stream* s,
|
890
|
+
bool cancel_stream_locked(inproc_stream* s, grpc_error_handle error) {
|
891
891
|
bool ret = false; // was the cancel accepted
|
892
|
-
INPROC_LOG(GPR_INFO, "cancel_stream %p with %s", s,
|
892
|
+
INPROC_LOG(GPR_INFO, "cancel_stream %p with %s", s,
|
893
|
+
grpc_error_std_string(error).c_str());
|
893
894
|
if (s->cancel_self_error == GRPC_ERROR_NONE) {
|
894
895
|
ret = true;
|
895
896
|
s->cancel_self_error = GRPC_ERROR_REF(error);
|
@@ -943,7 +944,7 @@ bool cancel_stream_locked(inproc_stream* s, grpc_error* error) {
|
|
943
944
|
return ret;
|
944
945
|
}
|
945
946
|
|
946
|
-
void do_nothing(void* /*arg*/,
|
947
|
+
void do_nothing(void* /*arg*/, grpc_error_handle /*error*/) {}
|
947
948
|
|
948
949
|
void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
949
950
|
grpc_transport_stream_op_batch* op) {
|
@@ -962,7 +963,7 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
|
962
963
|
s->t->is_client, false);
|
963
964
|
}
|
964
965
|
}
|
965
|
-
|
966
|
+
grpc_error_handle error = GRPC_ERROR_NONE;
|
966
967
|
grpc_closure* on_complete = op->on_complete;
|
967
968
|
// TODO(roth): This is a hack needed because we use data inside of the
|
968
969
|
// closure itself to do the barrier calculation (i.e., to ensure that
|
@@ -1293,7 +1294,7 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server,
|
|
1293
1294
|
client_args);
|
1294
1295
|
|
1295
1296
|
// TODO(ncteisen): design and support channelz GetSocket for inproc.
|
1296
|
-
|
1297
|
+
grpc_error_handle error = server->core_server->SetupTransport(
|
1297
1298
|
server_transport, nullptr, server_args, nullptr);
|
1298
1299
|
grpc_channel* channel = nullptr;
|
1299
1300
|
if (error == GRPC_ERROR_NONE) {
|
@@ -1303,7 +1304,7 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server,
|
|
1303
1304
|
if (error != GRPC_ERROR_NONE) {
|
1304
1305
|
GPR_ASSERT(!channel);
|
1305
1306
|
gpr_log(GPR_ERROR, "Failed to create client channel: %s",
|
1306
|
-
|
1307
|
+
grpc_error_std_string(error).c_str());
|
1307
1308
|
intptr_t integer;
|
1308
1309
|
grpc_status_code status = GRPC_STATUS_INTERNAL;
|
1309
1310
|
if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &integer)) {
|
@@ -1318,7 +1319,7 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server,
|
|
1318
1319
|
} else {
|
1319
1320
|
GPR_ASSERT(!channel);
|
1320
1321
|
gpr_log(GPR_ERROR, "Failed to create server channel: %s",
|
1321
|
-
|
1322
|
+
grpc_error_std_string(error).c_str());
|
1322
1323
|
intptr_t integer;
|
1323
1324
|
grpc_status_code status = GRPC_STATUS_INTERNAL;
|
1324
1325
|
if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &integer)) {
|
@@ -49,7 +49,7 @@ class CertificateProviderFactory {
|
|
49
49
|
virtual const char* name() const = 0;
|
50
50
|
|
51
51
|
virtual RefCountedPtr<Config> CreateCertificateProviderConfig(
|
52
|
-
const Json& config_json,
|
52
|
+
const Json& config_json, grpc_error_handle* error) = 0;
|
53
53
|
|
54
54
|
// Create a CertificateProvider instance from config.
|
55
55
|
virtual RefCountedPtr<grpc_tls_certificate_provider>
|
@@ -92,7 +92,7 @@ class CertificateProviderStore
|
|
92
92
|
};
|
93
93
|
|
94
94
|
RefCountedPtr<CertificateProviderWrapper> CreateCertificateProviderLocked(
|
95
|
-
absl::string_view key);
|
95
|
+
absl::string_view key) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
|
96
96
|
|
97
97
|
// Releases a previously created certificate provider from the certificate
|
98
98
|
// provider map if the value matches \a wrapper.
|
@@ -101,10 +101,10 @@ class CertificateProviderStore
|
|
101
101
|
|
102
102
|
Mutex mu_;
|
103
103
|
// Map of plugin configurations
|
104
|
-
PluginDefinitionMap plugin_config_map_;
|
104
|
+
PluginDefinitionMap plugin_config_map_ ABSL_GUARDED_BY(mu_);
|
105
105
|
// Underlying map for the providers.
|
106
106
|
std::map<absl::string_view, CertificateProviderWrapper*>
|
107
|
-
certificate_providers_map_;
|
107
|
+
certificate_providers_map_ ABSL_GUARDED_BY(mu_);
|
108
108
|
};
|
109
109
|
|
110
110
|
} // namespace grpc_core
|
@@ -64,14 +64,14 @@ std::string FileWatcherCertificateProviderFactory::Config::ToString() const {
|
|
64
64
|
|
65
65
|
RefCountedPtr<FileWatcherCertificateProviderFactory::Config>
|
66
66
|
FileWatcherCertificateProviderFactory::Config::Parse(const Json& config_json,
|
67
|
-
|
67
|
+
grpc_error_handle* error) {
|
68
68
|
auto config = MakeRefCounted<FileWatcherCertificateProviderFactory::Config>();
|
69
69
|
if (config_json.type() != Json::Type::OBJECT) {
|
70
70
|
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
71
71
|
"error:config type should be OBJECT.");
|
72
72
|
return nullptr;
|
73
73
|
}
|
74
|
-
std::vector<
|
74
|
+
std::vector<grpc_error_handle> error_list;
|
75
75
|
ParseJsonObjectField(config_json.object_value(), "certificate_file",
|
76
76
|
&config->identity_cert_file_, &error_list, false);
|
77
77
|
ParseJsonObjectField(config_json.object_value(), "private_key_file",
|
@@ -112,7 +112,7 @@ const char* FileWatcherCertificateProviderFactory::name() const {
|
|
112
112
|
|
113
113
|
RefCountedPtr<CertificateProviderFactory::Config>
|
114
114
|
FileWatcherCertificateProviderFactory::CreateCertificateProviderConfig(
|
115
|
-
const Json& config_json,
|
115
|
+
const Json& config_json, grpc_error_handle* error) {
|
116
116
|
return FileWatcherCertificateProviderFactory::Config::Parse(config_json,
|
117
117
|
error);
|
118
118
|
}
|
@@ -31,7 +31,7 @@ class FileWatcherCertificateProviderFactory
|
|
31
31
|
class Config : public CertificateProviderFactory::Config {
|
32
32
|
public:
|
33
33
|
static RefCountedPtr<Config> Parse(const Json& config_json,
|
34
|
-
|
34
|
+
grpc_error_handle* error);
|
35
35
|
|
36
36
|
const char* name() const override;
|
37
37
|
|
@@ -58,7 +58,7 @@ class FileWatcherCertificateProviderFactory
|
|
58
58
|
|
59
59
|
RefCountedPtr<CertificateProviderFactory::Config>
|
60
60
|
CreateCertificateProviderConfig(const Json& config_json,
|
61
|
-
|
61
|
+
grpc_error_handle* error) override;
|
62
62
|
|
63
63
|
RefCountedPtr<grpc_tls_certificate_provider> CreateCertificateProvider(
|
64
64
|
RefCountedPtr<CertificateProviderFactory::Config> config) override;
|
data/src/core/ext/xds/xds_api.cc
CHANGED
@@ -90,13 +90,13 @@
|
|
90
90
|
#include <grpc/support/string_util.h>
|
91
91
|
|
92
92
|
#include "src/core/ext/xds/xds_api.h"
|
93
|
+
#include "src/core/lib/address_utils/sockaddr_utils.h"
|
93
94
|
#include "src/core/lib/gpr/env.h"
|
94
95
|
#include "src/core/lib/gpr/string.h"
|
95
96
|
#include "src/core/lib/gpr/useful.h"
|
96
97
|
#include "src/core/lib/gprpp/host_port.h"
|
97
98
|
#include "src/core/lib/iomgr/error.h"
|
98
99
|
#include "src/core/lib/iomgr/sockaddr.h"
|
99
|
-
#include "src/core/lib/iomgr/sockaddr_utils.h"
|
100
100
|
#include "src/core/lib/iomgr/socket_utils.h"
|
101
101
|
#include "src/core/lib/slice/slice_utils.h"
|
102
102
|
|
@@ -1068,8 +1068,8 @@ absl::string_view TypeUrlExternalToInternal(bool use_v3,
|
|
1068
1068
|
grpc_slice XdsApi::CreateAdsRequest(
|
1069
1069
|
const XdsBootstrap::XdsServer& server, const std::string& type_url,
|
1070
1070
|
const std::set<absl::string_view>& resource_names,
|
1071
|
-
const std::string& version, const std::string& nonce,
|
1072
|
-
bool populate_node) {
|
1071
|
+
const std::string& version, const std::string& nonce,
|
1072
|
+
grpc_error_handle error, bool populate_node) {
|
1073
1073
|
upb::Arena arena;
|
1074
1074
|
const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
|
1075
1075
|
server.ShouldUseV3()};
|
@@ -1092,6 +1092,7 @@ grpc_slice XdsApi::CreateAdsRequest(
|
|
1092
1092
|
request, StdStringToUpbString(nonce));
|
1093
1093
|
}
|
1094
1094
|
// Set error_detail if it's a NACK.
|
1095
|
+
std::string error_string_storage;
|
1095
1096
|
if (error != GRPC_ERROR_NONE) {
|
1096
1097
|
google_rpc_Status* error_detail =
|
1097
1098
|
envoy_service_discovery_v3_DiscoveryRequest_mutable_error_detail(
|
@@ -1102,8 +1103,8 @@ grpc_slice XdsApi::CreateAdsRequest(
|
|
1102
1103
|
// generate them in the parsing code, and then use that here.
|
1103
1104
|
google_rpc_Status_set_code(error_detail, GRPC_STATUS_INVALID_ARGUMENT);
|
1104
1105
|
// Error description comes from the error that was passed in.
|
1105
|
-
|
1106
|
-
|
1106
|
+
error_string_storage = grpc_error_std_string(error);
|
1107
|
+
upb_strview error_description = StdStringToUpbString(error_string_storage);
|
1107
1108
|
google_rpc_Status_set_message(error_detail, error_description);
|
1108
1109
|
GRPC_ERROR_UNREF(error);
|
1109
1110
|
}
|
@@ -1197,8 +1198,9 @@ void MaybeLogClusterLoadAssignment(
|
|
1197
1198
|
}
|
1198
1199
|
}
|
1199
1200
|
|
1200
|
-
|
1201
|
-
|
1201
|
+
grpc_error_handle RoutePathMatchParse(
|
1202
|
+
const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route,
|
1203
|
+
bool* ignore_route) {
|
1202
1204
|
auto* case_sensitive_ptr =
|
1203
1205
|
envoy_config_route_v3_RouteMatch_case_sensitive(match);
|
1204
1206
|
bool case_sensitive = true;
|
@@ -1231,7 +1233,7 @@ grpc_error* RoutePathMatchParse(const envoy_config_route_v3_RouteMatch* match,
|
|
1231
1233
|
return GRPC_ERROR_NONE;
|
1232
1234
|
}
|
1233
1235
|
}
|
1234
|
-
type = StringMatcher::Type::
|
1236
|
+
type = StringMatcher::Type::kPrefix;
|
1235
1237
|
match_string = std::string(prefix);
|
1236
1238
|
} else if (envoy_config_route_v3_RouteMatch_has_path(match)) {
|
1237
1239
|
absl::string_view path =
|
@@ -1265,13 +1267,13 @@ grpc_error* RoutePathMatchParse(const envoy_config_route_v3_RouteMatch* match,
|
|
1265
1267
|
*ignore_route = true;
|
1266
1268
|
return GRPC_ERROR_NONE;
|
1267
1269
|
}
|
1268
|
-
type = StringMatcher::Type::
|
1270
|
+
type = StringMatcher::Type::kExact;
|
1269
1271
|
match_string = std::string(path);
|
1270
1272
|
} else if (envoy_config_route_v3_RouteMatch_has_safe_regex(match)) {
|
1271
1273
|
const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
|
1272
1274
|
envoy_config_route_v3_RouteMatch_safe_regex(match);
|
1273
1275
|
GPR_ASSERT(regex_matcher != nullptr);
|
1274
|
-
type = StringMatcher::Type::
|
1276
|
+
type = StringMatcher::Type::kSafeRegex;
|
1275
1277
|
match_string = UpbStringToStdString(
|
1276
1278
|
envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
|
1277
1279
|
} else {
|
@@ -1290,7 +1292,7 @@ grpc_error* RoutePathMatchParse(const envoy_config_route_v3_RouteMatch* match,
|
|
1290
1292
|
return GRPC_ERROR_NONE;
|
1291
1293
|
}
|
1292
1294
|
|
1293
|
-
|
1295
|
+
grpc_error_handle RouteHeaderMatchersParse(
|
1294
1296
|
const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route) {
|
1295
1297
|
size_t size;
|
1296
1298
|
const envoy_config_route_v3_HeaderMatcher* const* headers =
|
@@ -1305,7 +1307,7 @@ grpc_error* RouteHeaderMatchersParse(
|
|
1305
1307
|
int64_t range_end = 0;
|
1306
1308
|
bool present_match = false;
|
1307
1309
|
if (envoy_config_route_v3_HeaderMatcher_has_exact_match(header)) {
|
1308
|
-
type = HeaderMatcher::Type::
|
1310
|
+
type = HeaderMatcher::Type::kExact;
|
1309
1311
|
match_string = UpbStringToStdString(
|
1310
1312
|
envoy_config_route_v3_HeaderMatcher_exact_match(header));
|
1311
1313
|
} else if (envoy_config_route_v3_HeaderMatcher_has_safe_regex_match(
|
@@ -1313,28 +1315,28 @@ grpc_error* RouteHeaderMatchersParse(
|
|
1313
1315
|
const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
|
1314
1316
|
envoy_config_route_v3_HeaderMatcher_safe_regex_match(header);
|
1315
1317
|
GPR_ASSERT(regex_matcher != nullptr);
|
1316
|
-
type = HeaderMatcher::Type::
|
1318
|
+
type = HeaderMatcher::Type::kSafeRegex;
|
1317
1319
|
match_string = UpbStringToStdString(
|
1318
1320
|
envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
|
1319
1321
|
} else if (envoy_config_route_v3_HeaderMatcher_has_range_match(header)) {
|
1320
|
-
type = HeaderMatcher::Type::
|
1322
|
+
type = HeaderMatcher::Type::kRange;
|
1321
1323
|
const envoy_type_v3_Int64Range* range_matcher =
|
1322
1324
|
envoy_config_route_v3_HeaderMatcher_range_match(header);
|
1323
1325
|
range_start = envoy_type_v3_Int64Range_start(range_matcher);
|
1324
1326
|
range_end = envoy_type_v3_Int64Range_end(range_matcher);
|
1325
1327
|
} else if (envoy_config_route_v3_HeaderMatcher_has_present_match(header)) {
|
1326
|
-
type = HeaderMatcher::Type::
|
1328
|
+
type = HeaderMatcher::Type::kPresent;
|
1327
1329
|
present_match = envoy_config_route_v3_HeaderMatcher_present_match(header);
|
1328
1330
|
} else if (envoy_config_route_v3_HeaderMatcher_has_prefix_match(header)) {
|
1329
|
-
type = HeaderMatcher::Type::
|
1331
|
+
type = HeaderMatcher::Type::kPrefix;
|
1330
1332
|
match_string = UpbStringToStdString(
|
1331
1333
|
envoy_config_route_v3_HeaderMatcher_prefix_match(header));
|
1332
1334
|
} else if (envoy_config_route_v3_HeaderMatcher_has_suffix_match(header)) {
|
1333
|
-
type = HeaderMatcher::Type::
|
1335
|
+
type = HeaderMatcher::Type::kSuffix;
|
1334
1336
|
match_string = UpbStringToStdString(
|
1335
1337
|
envoy_config_route_v3_HeaderMatcher_suffix_match(header));
|
1336
1338
|
} else if (envoy_config_route_v3_HeaderMatcher_has_contains_match(header)) {
|
1337
|
-
type = HeaderMatcher::Type::
|
1339
|
+
type = HeaderMatcher::Type::kContains;
|
1338
1340
|
match_string = UpbStringToStdString(
|
1339
1341
|
envoy_config_route_v3_HeaderMatcher_contains_match(header));
|
1340
1342
|
} else {
|
@@ -1357,7 +1359,7 @@ grpc_error* RouteHeaderMatchersParse(
|
|
1357
1359
|
return GRPC_ERROR_NONE;
|
1358
1360
|
}
|
1359
1361
|
|
1360
|
-
|
1362
|
+
grpc_error_handle RouteRuntimeFractionParse(
|
1361
1363
|
const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route) {
|
1362
1364
|
const envoy_config_core_v3_RuntimeFractionalPercent* runtime_fraction =
|
1363
1365
|
envoy_config_route_v3_RouteMatch_runtime_fraction(match);
|
@@ -1390,9 +1392,9 @@ grpc_error* RouteRuntimeFractionParse(
|
|
1390
1392
|
return GRPC_ERROR_NONE;
|
1391
1393
|
}
|
1392
1394
|
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1395
|
+
grpc_error_handle ExtractHttpFilterTypeName(const EncodingContext& context,
|
1396
|
+
const google_protobuf_Any* any,
|
1397
|
+
absl::string_view* filter_type) {
|
1396
1398
|
*filter_type = UpbStringToAbsl(google_protobuf_Any_type_url(any));
|
1397
1399
|
if (*filter_type == "type.googleapis.com/udpa.type.v1.TypedStruct") {
|
1398
1400
|
upb_strview any_value = google_protobuf_Any_value(any);
|
@@ -1410,7 +1412,7 @@ grpc_error* ExtractHttpFilterTypeName(const EncodingContext& context,
|
|
1410
1412
|
}
|
1411
1413
|
|
1412
1414
|
template <typename ParentType, typename EntryType>
|
1413
|
-
|
1415
|
+
grpc_error_handle ParseTypedPerFilterConfig(
|
1414
1416
|
const EncodingContext& context, const ParentType* parent,
|
1415
1417
|
const EntryType* (*entry_func)(const ParentType*, size_t*),
|
1416
1418
|
upb_strview (*key_func)(const EntryType*),
|
@@ -1454,7 +1456,8 @@ grpc_error* ParseTypedPerFilterConfig(
|
|
1454
1456
|
.c_str());
|
1455
1457
|
}
|
1456
1458
|
}
|
1457
|
-
|
1459
|
+
grpc_error_handle error =
|
1460
|
+
ExtractHttpFilterTypeName(context, any, &filter_type);
|
1458
1461
|
if (error != GRPC_ERROR_NONE) return error;
|
1459
1462
|
const XdsHttpFilterImpl* filter_impl =
|
1460
1463
|
XdsHttpFilterRegistry::GetFilterForType(filter_type);
|
@@ -1478,9 +1481,9 @@ grpc_error* ParseTypedPerFilterConfig(
|
|
1478
1481
|
return GRPC_ERROR_NONE;
|
1479
1482
|
}
|
1480
1483
|
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
+
grpc_error_handle RouteActionParse(const EncodingContext& context,
|
1485
|
+
const envoy_config_route_v3_Route* route_msg,
|
1486
|
+
XdsApi::Route* route, bool* ignore_route) {
|
1484
1487
|
if (!envoy_config_route_v3_Route_has_route(route_msg)) {
|
1485
1488
|
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1486
1489
|
"No RouteAction found in route.");
|
@@ -1533,7 +1536,7 @@ grpc_error* RouteActionParse(const EncodingContext& context,
|
|
1533
1536
|
if (cluster.weight == 0) continue;
|
1534
1537
|
sum_of_weights += cluster.weight;
|
1535
1538
|
if (context.use_v3) {
|
1536
|
-
|
1539
|
+
grpc_error_handle error = ParseTypedPerFilterConfig<
|
1537
1540
|
envoy_config_route_v3_WeightedCluster_ClusterWeight,
|
1538
1541
|
envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry>(
|
1539
1542
|
context, cluster_weight,
|
@@ -1663,7 +1666,7 @@ grpc_error* RouteActionParse(const EncodingContext& context,
|
|
1663
1666
|
return GRPC_ERROR_NONE;
|
1664
1667
|
}
|
1665
1668
|
|
1666
|
-
|
1669
|
+
grpc_error_handle RouteConfigParse(
|
1667
1670
|
const EncodingContext& context,
|
1668
1671
|
const envoy_config_route_v3_RouteConfiguration* route_config,
|
1669
1672
|
XdsApi::RdsUpdate* rds_update) {
|
@@ -1695,7 +1698,7 @@ grpc_error* RouteConfigParse(
|
|
1695
1698
|
}
|
1696
1699
|
// Parse typed_per_filter_config.
|
1697
1700
|
if (context.use_v3) {
|
1698
|
-
|
1701
|
+
grpc_error_handle error = ParseTypedPerFilterConfig<
|
1699
1702
|
envoy_config_route_v3_VirtualHost,
|
1700
1703
|
envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry>(
|
1701
1704
|
context, virtual_hosts[i],
|
@@ -1728,7 +1731,8 @@ grpc_error* RouteConfigParse(
|
|
1728
1731
|
}
|
1729
1732
|
XdsApi::Route route;
|
1730
1733
|
bool ignore_route = false;
|
1731
|
-
|
1734
|
+
grpc_error_handle error =
|
1735
|
+
RoutePathMatchParse(match, &route, &ignore_route);
|
1732
1736
|
if (error != GRPC_ERROR_NONE) return error;
|
1733
1737
|
if (ignore_route) continue;
|
1734
1738
|
error = RouteHeaderMatchersParse(match, &route);
|
@@ -1739,7 +1743,7 @@ grpc_error* RouteConfigParse(
|
|
1739
1743
|
if (error != GRPC_ERROR_NONE) return error;
|
1740
1744
|
if (ignore_route) continue;
|
1741
1745
|
if (context.use_v3) {
|
1742
|
-
|
1746
|
+
grpc_error_handle error = ParseTypedPerFilterConfig<
|
1743
1747
|
envoy_config_route_v3_Route,
|
1744
1748
|
envoy_config_route_v3_Route_TypedPerFilterConfigEntry>(
|
1745
1749
|
context, routes[j],
|
@@ -1771,11 +1775,11 @@ CertificateProviderInstanceParse(
|
|
1771
1775
|
certificate_provider_instance_proto))};
|
1772
1776
|
}
|
1773
1777
|
|
1774
|
-
|
1778
|
+
grpc_error_handle CommonTlsContextParse(
|
1775
1779
|
const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
|
1776
1780
|
common_tls_context_proto,
|
1777
1781
|
XdsApi::CommonTlsContext* common_tls_context) GRPC_MUST_USE_RESULT;
|
1778
|
-
|
1782
|
+
grpc_error_handle CommonTlsContextParse(
|
1779
1783
|
const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
|
1780
1784
|
common_tls_context_proto,
|
1781
1785
|
XdsApi::CommonTlsContext* common_tls_context) {
|
@@ -1796,31 +1800,31 @@ grpc_error* CommonTlsContextParse(
|
|
1796
1800
|
std::string matcher;
|
1797
1801
|
if (envoy_type_matcher_v3_StringMatcher_has_exact(
|
1798
1802
|
subject_alt_names_matchers[i])) {
|
1799
|
-
type = StringMatcher::Type::
|
1803
|
+
type = StringMatcher::Type::kExact;
|
1800
1804
|
matcher =
|
1801
1805
|
UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_exact(
|
1802
1806
|
subject_alt_names_matchers[i]));
|
1803
1807
|
} else if (envoy_type_matcher_v3_StringMatcher_has_prefix(
|
1804
1808
|
subject_alt_names_matchers[i])) {
|
1805
|
-
type = StringMatcher::Type::
|
1809
|
+
type = StringMatcher::Type::kPrefix;
|
1806
1810
|
matcher =
|
1807
1811
|
UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_prefix(
|
1808
1812
|
subject_alt_names_matchers[i]));
|
1809
1813
|
} else if (envoy_type_matcher_v3_StringMatcher_has_suffix(
|
1810
1814
|
subject_alt_names_matchers[i])) {
|
1811
|
-
type = StringMatcher::Type::
|
1815
|
+
type = StringMatcher::Type::kSuffix;
|
1812
1816
|
matcher =
|
1813
1817
|
UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_suffix(
|
1814
1818
|
subject_alt_names_matchers[i]));
|
1815
1819
|
} else if (envoy_type_matcher_v3_StringMatcher_has_contains(
|
1816
1820
|
subject_alt_names_matchers[i])) {
|
1817
|
-
type = StringMatcher::Type::
|
1821
|
+
type = StringMatcher::Type::kContains;
|
1818
1822
|
matcher =
|
1819
1823
|
UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_contains(
|
1820
1824
|
subject_alt_names_matchers[i]));
|
1821
1825
|
} else if (envoy_type_matcher_v3_StringMatcher_has_safe_regex(
|
1822
1826
|
subject_alt_names_matchers[i])) {
|
1823
|
-
type = StringMatcher::Type::
|
1827
|
+
type = StringMatcher::Type::kSafeRegex;
|
1824
1828
|
auto* regex_matcher = envoy_type_matcher_v3_StringMatcher_safe_regex(
|
1825
1829
|
subject_alt_names_matchers[i]);
|
1826
1830
|
matcher = UpbStringToStdString(
|
@@ -1840,7 +1844,7 @@ grpc_error* CommonTlsContextParse(
|
|
1840
1844
|
string_matcher.status().message())
|
1841
1845
|
.c_str());
|
1842
1846
|
}
|
1843
|
-
if (type == StringMatcher::Type::
|
1847
|
+
if (type == StringMatcher::Type::kSafeRegex && ignore_case) {
|
1844
1848
|
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1845
1849
|
"StringMatcher: ignore_case has no effect for SAFE_REGEX.");
|
1846
1850
|
}
|
@@ -1870,7 +1874,7 @@ grpc_error* CommonTlsContextParse(
|
|
1870
1874
|
return GRPC_ERROR_NONE;
|
1871
1875
|
}
|
1872
1876
|
|
1873
|
-
|
1877
|
+
grpc_error_handle HttpConnectionManagerParse(
|
1874
1878
|
bool is_client, const EncodingContext& context,
|
1875
1879
|
const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*
|
1876
1880
|
http_connection_manager_proto,
|
@@ -1925,7 +1929,8 @@ grpc_error* HttpConnectionManagerParse(
|
|
1925
1929
|
.c_str());
|
1926
1930
|
}
|
1927
1931
|
absl::string_view filter_type;
|
1928
|
-
|
1932
|
+
grpc_error_handle error =
|
1933
|
+
ExtractHttpFilterTypeName(context, any, &filter_type);
|
1929
1934
|
if (error != GRPC_ERROR_NONE) return error;
|
1930
1935
|
const XdsHttpFilterImpl* filter_impl =
|
1931
1936
|
XdsHttpFilterRegistry::GetFilterForType(filter_type);
|
@@ -1974,7 +1979,8 @@ grpc_error* HttpConnectionManagerParse(
|
|
1974
1979
|
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(
|
1975
1980
|
http_connection_manager_proto);
|
1976
1981
|
XdsApi::RdsUpdate rds_update;
|
1977
|
-
|
1982
|
+
grpc_error_handle error =
|
1983
|
+
RouteConfigParse(context, route_config, &rds_update);
|
1978
1984
|
if (error != GRPC_ERROR_NONE) return error;
|
1979
1985
|
http_connection_manager->rds_update = std::move(rds_update);
|
1980
1986
|
return GRPC_ERROR_NONE;
|
@@ -2007,7 +2013,7 @@ grpc_error* HttpConnectionManagerParse(
|
|
2007
2013
|
return GRPC_ERROR_NONE;
|
2008
2014
|
}
|
2009
2015
|
|
2010
|
-
|
2016
|
+
grpc_error_handle LdsResponseParseClient(
|
2011
2017
|
const EncodingContext& context,
|
2012
2018
|
const envoy_config_listener_v3_ApiListener* api_listener, bool is_v2,
|
2013
2019
|
XdsApi::LdsUpdate* lds_update) {
|
@@ -2026,7 +2032,7 @@ grpc_error* LdsResponseParseClient(
|
|
2026
2032
|
&lds_update->http_connection_manager);
|
2027
2033
|
}
|
2028
2034
|
|
2029
|
-
|
2035
|
+
grpc_error_handle DownstreamTlsContextParse(
|
2030
2036
|
const EncodingContext& context,
|
2031
2037
|
const envoy_config_core_v3_TransportSocket* transport_socket,
|
2032
2038
|
XdsApi::DownstreamTlsContext* downstream_tls_context) {
|
@@ -2050,7 +2056,7 @@ grpc_error* DownstreamTlsContextParse(
|
|
2050
2056
|
envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_common_tls_context(
|
2051
2057
|
downstream_tls_context_proto);
|
2052
2058
|
if (common_tls_context != nullptr) {
|
2053
|
-
|
2059
|
+
grpc_error_handle error = CommonTlsContextParse(
|
2054
2060
|
common_tls_context, &downstream_tls_context->common_tls_context);
|
2055
2061
|
if (error != GRPC_ERROR_NONE) return error;
|
2056
2062
|
}
|
@@ -2073,13 +2079,13 @@ grpc_error* DownstreamTlsContextParse(
|
|
2073
2079
|
return GRPC_ERROR_NONE;
|
2074
2080
|
}
|
2075
2081
|
|
2076
|
-
|
2082
|
+
grpc_error_handle CidrRangeParse(
|
2077
2083
|
const envoy_config_core_v3_CidrRange* cidr_range_proto,
|
2078
2084
|
XdsApi::LdsUpdate::FilterChainMap::CidrRange* cidr_range) {
|
2079
2085
|
std::string address_prefix = UpbStringToStdString(
|
2080
2086
|
envoy_config_core_v3_CidrRange_address_prefix(cidr_range_proto));
|
2081
|
-
|
2082
|
-
|
2087
|
+
grpc_error_handle error =
|
2088
|
+
grpc_string_to_sockaddr(&cidr_range->address, address_prefix.c_str(), 0);
|
2083
2089
|
if (error != GRPC_ERROR_NONE) return error;
|
2084
2090
|
cidr_range->prefix_len = 0;
|
2085
2091
|
auto* prefix_len_proto =
|
@@ -2097,7 +2103,7 @@ grpc_error* CidrRangeParse(
|
|
2097
2103
|
return GRPC_ERROR_NONE;
|
2098
2104
|
}
|
2099
2105
|
|
2100
|
-
|
2106
|
+
grpc_error_handle FilterChainMatchParse(
|
2101
2107
|
const envoy_config_listener_v3_FilterChainMatch* filter_chain_match_proto,
|
2102
2108
|
FilterChain::FilterChainMatch* filter_chain_match) {
|
2103
2109
|
auto* destination_port =
|
@@ -2113,7 +2119,7 @@ grpc_error* FilterChainMatchParse(
|
|
2113
2119
|
filter_chain_match->prefix_ranges.reserve(size);
|
2114
2120
|
for (size_t i = 0; i < size; i++) {
|
2115
2121
|
XdsApi::LdsUpdate::FilterChainMap::CidrRange cidr_range;
|
2116
|
-
|
2122
|
+
grpc_error_handle error = CidrRangeParse(prefix_ranges[i], &cidr_range);
|
2117
2123
|
if (error != GRPC_ERROR_NONE) return error;
|
2118
2124
|
filter_chain_match->prefix_ranges.push_back(cidr_range);
|
2119
2125
|
}
|
@@ -2127,7 +2133,8 @@ grpc_error* FilterChainMatchParse(
|
|
2127
2133
|
filter_chain_match->source_prefix_ranges.reserve(size);
|
2128
2134
|
for (size_t i = 0; i < size; i++) {
|
2129
2135
|
XdsApi::LdsUpdate::FilterChainMap::CidrRange cidr_range;
|
2130
|
-
|
2136
|
+
grpc_error_handle error =
|
2137
|
+
CidrRangeParse(source_prefix_ranges[i], &cidr_range);
|
2131
2138
|
if (error != GRPC_ERROR_NONE) return error;
|
2132
2139
|
filter_chain_match->source_prefix_ranges.push_back(cidr_range);
|
2133
2140
|
}
|
@@ -2156,11 +2163,11 @@ grpc_error* FilterChainMatchParse(
|
|
2156
2163
|
return GRPC_ERROR_NONE;
|
2157
2164
|
}
|
2158
2165
|
|
2159
|
-
|
2166
|
+
grpc_error_handle FilterChainParse(
|
2160
2167
|
const EncodingContext& context,
|
2161
2168
|
const envoy_config_listener_v3_FilterChain* filter_chain_proto, bool is_v2,
|
2162
2169
|
FilterChain* filter_chain) {
|
2163
|
-
|
2170
|
+
grpc_error_handle error = GRPC_ERROR_NONE;
|
2164
2171
|
auto* filter_chain_match =
|
2165
2172
|
envoy_config_listener_v3_FilterChain_filter_chain_match(
|
2166
2173
|
filter_chain_proto);
|
@@ -2223,8 +2230,8 @@ grpc_error* FilterChainParse(
|
|
2223
2230
|
return error;
|
2224
2231
|
}
|
2225
2232
|
|
2226
|
-
|
2227
|
-
|
2233
|
+
grpc_error_handle AddressParse(
|
2234
|
+
const envoy_config_core_v3_Address* address_proto, std::string* address) {
|
2228
2235
|
const auto* socket_address =
|
2229
2236
|
envoy_config_core_v3_Address_socket_address(address_proto);
|
2230
2237
|
if (socket_address == nullptr) {
|
@@ -2263,7 +2270,7 @@ struct InternalFilterChainMap {
|
|
2263
2270
|
DestinationIpMap destination_ip_map;
|
2264
2271
|
};
|
2265
2272
|
|
2266
|
-
|
2273
|
+
grpc_error_handle AddFilterChainDataForSourcePort(
|
2267
2274
|
const FilterChain& filter_chain,
|
2268
2275
|
XdsApi::LdsUpdate::FilterChainMap::SourcePortsMap* ports_map,
|
2269
2276
|
uint32_t port) {
|
@@ -2280,14 +2287,14 @@ grpc_error* AddFilterChainDataForSourcePort(
|
|
2280
2287
|
return GRPC_ERROR_NONE;
|
2281
2288
|
}
|
2282
2289
|
|
2283
|
-
|
2290
|
+
grpc_error_handle AddFilterChainDataForSourcePorts(
|
2284
2291
|
const FilterChain& filter_chain,
|
2285
2292
|
XdsApi::LdsUpdate::FilterChainMap::SourcePortsMap* ports_map) {
|
2286
2293
|
if (filter_chain.filter_chain_match.source_ports.empty()) {
|
2287
2294
|
return AddFilterChainDataForSourcePort(filter_chain, ports_map, 0);
|
2288
2295
|
} else {
|
2289
2296
|
for (uint32_t port : filter_chain.filter_chain_match.source_ports) {
|
2290
|
-
|
2297
|
+
grpc_error_handle error =
|
2291
2298
|
AddFilterChainDataForSourcePort(filter_chain, ports_map, port);
|
2292
2299
|
if (error != GRPC_ERROR_NONE) return error;
|
2293
2300
|
}
|
@@ -2295,7 +2302,7 @@ grpc_error* AddFilterChainDataForSourcePorts(
|
|
2295
2302
|
return GRPC_ERROR_NONE;
|
2296
2303
|
}
|
2297
2304
|
|
2298
|
-
|
2305
|
+
grpc_error_handle AddFilterChainDataForSourceIpRange(
|
2299
2306
|
const FilterChain& filter_chain,
|
2300
2307
|
InternalFilterChainMap::SourceIpMap* source_ip_map) {
|
2301
2308
|
if (filter_chain.filter_chain_match.source_prefix_ranges.empty()) {
|
@@ -2313,7 +2320,7 @@ grpc_error* AddFilterChainDataForSourceIpRange(
|
|
2313
2320
|
if (insert_result.second) {
|
2314
2321
|
insert_result.first->second.prefix_range.emplace(prefix_range);
|
2315
2322
|
}
|
2316
|
-
|
2323
|
+
grpc_error_handle error = AddFilterChainDataForSourcePorts(
|
2317
2324
|
filter_chain, &insert_result.first->second.ports_map);
|
2318
2325
|
if (error != GRPC_ERROR_NONE) return error;
|
2319
2326
|
}
|
@@ -2321,7 +2328,7 @@ grpc_error* AddFilterChainDataForSourceIpRange(
|
|
2321
2328
|
return GRPC_ERROR_NONE;
|
2322
2329
|
}
|
2323
2330
|
|
2324
|
-
|
2331
|
+
grpc_error_handle AddFilterChainDataForSourceType(
|
2325
2332
|
const FilterChain& filter_chain,
|
2326
2333
|
InternalFilterChainMap::DestinationIp* destination_ip) {
|
2327
2334
|
GPR_ASSERT(static_cast<unsigned int>(
|
@@ -2331,7 +2338,7 @@ grpc_error* AddFilterChainDataForSourceType(
|
|
2331
2338
|
filter_chain.filter_chain_match.source_type)]);
|
2332
2339
|
}
|
2333
2340
|
|
2334
|
-
|
2341
|
+
grpc_error_handle AddFilterChainDataForApplicationProtocols(
|
2335
2342
|
const FilterChain& filter_chain,
|
2336
2343
|
InternalFilterChainMap::DestinationIp* destination_ip) {
|
2337
2344
|
// Only allow filter chains that do not mention application protocols
|
@@ -2341,7 +2348,7 @@ grpc_error* AddFilterChainDataForApplicationProtocols(
|
|
2341
2348
|
return AddFilterChainDataForSourceType(filter_chain, destination_ip);
|
2342
2349
|
}
|
2343
2350
|
|
2344
|
-
|
2351
|
+
grpc_error_handle AddFilterChainDataForTransportProtocol(
|
2345
2352
|
const FilterChain& filter_chain,
|
2346
2353
|
InternalFilterChainMap::DestinationIp* destination_ip) {
|
2347
2354
|
const std::string& transport_protocol =
|
@@ -2369,7 +2376,7 @@ grpc_error* AddFilterChainDataForTransportProtocol(
|
|
2369
2376
|
destination_ip);
|
2370
2377
|
}
|
2371
2378
|
|
2372
|
-
|
2379
|
+
grpc_error_handle AddFilterChainDataForServerNames(
|
2373
2380
|
const FilterChain& filter_chain,
|
2374
2381
|
InternalFilterChainMap::DestinationIp* destination_ip) {
|
2375
2382
|
// Don't continue adding filter chains with server names mentioned
|
@@ -2379,7 +2386,7 @@ grpc_error* AddFilterChainDataForServerNames(
|
|
2379
2386
|
return AddFilterChainDataForTransportProtocol(filter_chain, destination_ip);
|
2380
2387
|
}
|
2381
2388
|
|
2382
|
-
|
2389
|
+
grpc_error_handle AddFilterChainDataForDestinationIpRange(
|
2383
2390
|
const FilterChain& filter_chain,
|
2384
2391
|
InternalFilterChainMap::DestinationIpMap* destination_ip_map) {
|
2385
2392
|
if (filter_chain.filter_chain_match.prefix_ranges.empty()) {
|
@@ -2397,7 +2404,7 @@ grpc_error* AddFilterChainDataForDestinationIpRange(
|
|
2397
2404
|
if (insert_result.second) {
|
2398
2405
|
insert_result.first->second.prefix_range.emplace(prefix_range);
|
2399
2406
|
}
|
2400
|
-
|
2407
|
+
grpc_error_handle error = AddFilterChainDataForServerNames(
|
2401
2408
|
filter_chain, &insert_result.first->second);
|
2402
2409
|
if (error != GRPC_ERROR_NONE) return error;
|
2403
2410
|
}
|
@@ -2424,14 +2431,14 @@ XdsApi::LdsUpdate::FilterChainMap BuildFromInternalFilterChainMap(
|
|
2424
2431
|
return filter_chain_map;
|
2425
2432
|
}
|
2426
2433
|
|
2427
|
-
|
2434
|
+
grpc_error_handle BuildFilterChainMap(
|
2428
2435
|
const std::vector<FilterChain>& filter_chains,
|
2429
2436
|
XdsApi::LdsUpdate::FilterChainMap* filter_chain_map) {
|
2430
2437
|
InternalFilterChainMap internal_filter_chain_map;
|
2431
2438
|
for (const auto& filter_chain : filter_chains) {
|
2432
2439
|
// Discard filter chain entries that specify destination port
|
2433
2440
|
if (filter_chain.filter_chain_match.destination_port != 0) continue;
|
2434
|
-
|
2441
|
+
grpc_error_handle error = AddFilterChainDataForDestinationIpRange(
|
2435
2442
|
filter_chain, &internal_filter_chain_map.destination_ip_map);
|
2436
2443
|
if (error != GRPC_ERROR_NONE) return error;
|
2437
2444
|
}
|
@@ -2440,12 +2447,12 @@ grpc_error* BuildFilterChainMap(
|
|
2440
2447
|
return GRPC_ERROR_NONE;
|
2441
2448
|
}
|
2442
2449
|
|
2443
|
-
|
2450
|
+
grpc_error_handle LdsResponseParseServer(
|
2444
2451
|
const EncodingContext& context,
|
2445
2452
|
const envoy_config_listener_v3_Listener* listener, bool is_v2,
|
2446
2453
|
XdsApi::LdsUpdate* lds_update) {
|
2447
2454
|
lds_update->type = XdsApi::LdsUpdate::ListenerType::kTcpListener;
|
2448
|
-
|
2455
|
+
grpc_error_handle error =
|
2449
2456
|
AddressParse(envoy_config_listener_v3_Listener_address(listener),
|
2450
2457
|
&lds_update->address);
|
2451
2458
|
if (error != GRPC_ERROR_NONE) return error;
|
@@ -2489,13 +2496,13 @@ grpc_error* LdsResponseParseServer(
|
|
2489
2496
|
return GRPC_ERROR_NONE;
|
2490
2497
|
}
|
2491
2498
|
|
2492
|
-
|
2499
|
+
grpc_error_handle LdsResponseParse(
|
2493
2500
|
const EncodingContext& context,
|
2494
2501
|
const envoy_service_discovery_v3_DiscoveryResponse* response,
|
2495
2502
|
const std::set<absl::string_view>& expected_listener_names,
|
2496
2503
|
XdsApi::LdsUpdateMap* lds_update_map,
|
2497
2504
|
std::set<std::string>* resource_names_failed) {
|
2498
|
-
std::vector<
|
2505
|
+
std::vector<grpc_error_handle> errors;
|
2499
2506
|
// Get the resources from the response.
|
2500
2507
|
size_t size;
|
2501
2508
|
const google_protobuf_Any* const* resources =
|
@@ -2564,7 +2571,7 @@ grpc_error* LdsResponseParse(
|
|
2564
2571
|
resource_names_failed->insert(listener_name);
|
2565
2572
|
continue;
|
2566
2573
|
}
|
2567
|
-
|
2574
|
+
grpc_error_handle error = GRPC_ERROR_NONE;
|
2568
2575
|
if (api_listener != nullptr) {
|
2569
2576
|
error = LdsResponseParseClient(context, api_listener, is_v2, &lds_update);
|
2570
2577
|
} else {
|
@@ -2581,13 +2588,13 @@ grpc_error* LdsResponseParse(
|
|
2581
2588
|
return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing LDS response", &errors);
|
2582
2589
|
}
|
2583
2590
|
|
2584
|
-
|
2591
|
+
grpc_error_handle RdsResponseParse(
|
2585
2592
|
const EncodingContext& context,
|
2586
2593
|
const envoy_service_discovery_v3_DiscoveryResponse* response,
|
2587
2594
|
const std::set<absl::string_view>& expected_route_configuration_names,
|
2588
2595
|
XdsApi::RdsUpdateMap* rds_update_map,
|
2589
2596
|
std::set<std::string>* resource_names_failed) {
|
2590
|
-
std::vector<
|
2597
|
+
std::vector<grpc_error_handle> errors;
|
2591
2598
|
// Get the resources from the response.
|
2592
2599
|
size_t size;
|
2593
2600
|
const google_protobuf_Any* const* resources =
|
@@ -2638,7 +2645,8 @@ grpc_error* RdsResponseParse(
|
|
2638
2645
|
rds_resource_data.serialized_proto =
|
2639
2646
|
UpbStringToStdString(encoded_route_config);
|
2640
2647
|
// Parse the route_config.
|
2641
|
-
|
2648
|
+
grpc_error_handle error =
|
2649
|
+
RouteConfigParse(context, route_config, &rds_update);
|
2642
2650
|
if (error != GRPC_ERROR_NONE) {
|
2643
2651
|
errors.push_back(grpc_error_add_child(
|
2644
2652
|
GRPC_ERROR_CREATE_FROM_COPIED_STRING(
|
@@ -2650,13 +2658,13 @@ grpc_error* RdsResponseParse(
|
|
2650
2658
|
return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing RDS response", &errors);
|
2651
2659
|
}
|
2652
2660
|
|
2653
|
-
|
2661
|
+
grpc_error_handle CdsResponseParse(
|
2654
2662
|
const EncodingContext& context,
|
2655
2663
|
const envoy_service_discovery_v3_DiscoveryResponse* response,
|
2656
2664
|
const std::set<absl::string_view>& expected_cluster_names,
|
2657
2665
|
XdsApi::CdsUpdateMap* cds_update_map,
|
2658
2666
|
std::set<std::string>* resource_names_failed) {
|
2659
|
-
std::vector<
|
2667
|
+
std::vector<grpc_error_handle> errors;
|
2660
2668
|
// Get the resources from the response.
|
2661
2669
|
size_t size;
|
2662
2670
|
const google_protobuf_Any* const* resources =
|
@@ -2912,7 +2920,7 @@ grpc_error* CdsResponseParse(
|
|
2912
2920
|
envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(
|
2913
2921
|
upstream_tls_context);
|
2914
2922
|
if (common_tls_context != nullptr) {
|
2915
|
-
|
2923
|
+
grpc_error_handle error = CommonTlsContextParse(
|
2916
2924
|
common_tls_context, &cds_update.common_tls_context);
|
2917
2925
|
if (error != GRPC_ERROR_NONE) {
|
2918
2926
|
errors.push_back(grpc_error_add_child(
|
@@ -2983,7 +2991,7 @@ grpc_error* CdsResponseParse(
|
|
2983
2991
|
return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing CDS response", &errors);
|
2984
2992
|
}
|
2985
2993
|
|
2986
|
-
|
2994
|
+
grpc_error_handle ServerAddressParseAndAppend(
|
2987
2995
|
const envoy_config_endpoint_v3_LbEndpoint* lb_endpoint,
|
2988
2996
|
ServerAddressList* list) {
|
2989
2997
|
// If health_status is not HEALTHY or UNKNOWN, skip this endpoint.
|
@@ -3008,15 +3016,15 @@ grpc_error* ServerAddressParseAndAppend(
|
|
3008
3016
|
}
|
3009
3017
|
// Populate grpc_resolved_address.
|
3010
3018
|
grpc_resolved_address addr;
|
3011
|
-
|
3012
|
-
|
3019
|
+
grpc_error_handle error =
|
3020
|
+
grpc_string_to_sockaddr(&addr, address_str.c_str(), port);
|
3013
3021
|
if (error != GRPC_ERROR_NONE) return error;
|
3014
3022
|
// Append the address to the list.
|
3015
3023
|
list->emplace_back(addr, nullptr);
|
3016
3024
|
return GRPC_ERROR_NONE;
|
3017
3025
|
}
|
3018
3026
|
|
3019
|
-
|
3027
|
+
grpc_error_handle LocalityParse(
|
3020
3028
|
const envoy_config_endpoint_v3_LocalityLbEndpoints* locality_lb_endpoints,
|
3021
3029
|
XdsApi::EdsUpdate::Priority::Locality* output_locality, size_t* priority) {
|
3022
3030
|
// Parse LB weight.
|
@@ -3050,7 +3058,7 @@ grpc_error* LocalityParse(
|
|
3050
3058
|
envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(
|
3051
3059
|
locality_lb_endpoints, &size);
|
3052
3060
|
for (size_t i = 0; i < size; ++i) {
|
3053
|
-
|
3061
|
+
grpc_error_handle error = ServerAddressParseAndAppend(
|
3054
3062
|
lb_endpoints[i], &output_locality->endpoints);
|
3055
3063
|
if (error != GRPC_ERROR_NONE) return error;
|
3056
3064
|
}
|
@@ -3060,7 +3068,7 @@ grpc_error* LocalityParse(
|
|
3060
3068
|
return GRPC_ERROR_NONE;
|
3061
3069
|
}
|
3062
3070
|
|
3063
|
-
|
3071
|
+
grpc_error_handle DropParseAndAppend(
|
3064
3072
|
const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*
|
3065
3073
|
drop_overload,
|
3066
3074
|
XdsApi::EdsUpdate::DropConfig* drop_config) {
|
@@ -3099,13 +3107,13 @@ grpc_error* DropParseAndAppend(
|
|
3099
3107
|
return GRPC_ERROR_NONE;
|
3100
3108
|
}
|
3101
3109
|
|
3102
|
-
|
3110
|
+
grpc_error_handle EdsResponseParse(
|
3103
3111
|
const EncodingContext& context,
|
3104
3112
|
const envoy_service_discovery_v3_DiscoveryResponse* response,
|
3105
3113
|
const std::set<absl::string_view>& expected_eds_service_names,
|
3106
3114
|
XdsApi::EdsUpdateMap* eds_update_map,
|
3107
3115
|
std::set<std::string>* resource_names_failed) {
|
3108
|
-
std::vector<
|
3116
|
+
std::vector<grpc_error_handle> errors;
|
3109
3117
|
// Get the resources from the response.
|
3110
3118
|
size_t size;
|
3111
3119
|
const google_protobuf_Any* const* resources =
|
@@ -3162,7 +3170,7 @@ grpc_error* EdsResponseParse(
|
|
3162
3170
|
const envoy_config_endpoint_v3_LocalityLbEndpoints* const* endpoints =
|
3163
3171
|
envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(
|
3164
3172
|
cluster_load_assignment, &locality_size);
|
3165
|
-
|
3173
|
+
grpc_error_handle error = GRPC_ERROR_NONE;
|
3166
3174
|
for (size_t j = 0; j < locality_size; ++j) {
|
3167
3175
|
size_t priority;
|
3168
3176
|
XdsApi::EdsUpdate::Priority::Locality locality;
|
@@ -3476,10 +3484,10 @@ grpc_slice XdsApi::CreateLrsRequest(
|
|
3476
3484
|
return SerializeLrsRequest(context, request);
|
3477
3485
|
}
|
3478
3486
|
|
3479
|
-
|
3480
|
-
|
3481
|
-
|
3482
|
-
|
3487
|
+
grpc_error_handle XdsApi::ParseLrsResponse(
|
3488
|
+
const grpc_slice& encoded_response, bool* send_all_clusters,
|
3489
|
+
std::set<std::string>* cluster_names,
|
3490
|
+
grpc_millis* load_reporting_interval) {
|
3483
3491
|
upb::Arena arena;
|
3484
3492
|
// Decode the response.
|
3485
3493
|
const envoy_service_load_stats_v3_LoadStatsResponse* decoded_response =
|